Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Use temporary_tables
to create temporary tables and models in RSpec specs,
rather than create and maintain a dummy Rails application or messy block-level
constants.
This gem was extracted from Keygen.
Sponsored by:
A fair source software licensing and distribution API.
Add this line to your application's Gemfile
:
gem 'temporary_tables'
And then execute:
$ bundle
Or install it yourself as:
$ gem install temporary_tables
temporary_table
To define a temporary table:
describe Example do
temporary_table :user do |t|
t.string :email
t.string :first_name
t.string :last_name
t.index :email, unique: true
end
it 'should define a table' do
expect(ActiveRecord::Base.connection.table_exists?(:user)).to be true
end
end
The full Active Record schema API is available.
temporary_model
To define an Active Record:
describe Example do
temporary_model :user do
has_many :posts
end
it 'should define a record' do
expect(const_defined?(:User)).to be true
end
end
To define an Active Model:
describe Example do
temporary_model :guest_user, table_name: nil, base_class: nil do
include ActiveModel::Model
end
it 'should define a model' do
expect(const_defined?(:GuestUser)).to be true
end
end
To define a PORO:
describe Example do
temporary_model :null_user, table_name: nil, base_class: nil do
# ...
end
it 'should define a PORO' do
expect(const_defined?(:NullUser)).to be true
end
end
Right now, the gem only supports RSpec, but we're open to pull requests that extend the functionality to other testing frameworks.
temporary_tables
supports Ruby 3.1 and above. We encourage you to upgrade
if you're on an older version. Ruby 3 provides a lot of great features, like
better pattern matching and a new shorthand hash syntax.
Yes.
If you have an idea, or have discovered a bug, please open an issue or create a pull request.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that temporary_tables demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.