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.
spira-active_record_isomorphisms
Advanced tools
Establish isomorphisms between your Spira and ActiveRecord models.
Add this line to your application's Gemfile:
gem 'spira-active_record_isomorphisms'
And then execute:
$ bundle
Or install it yourself as:
$ gem install spira-active_record_isomorphisms
Isomorphisms are established by adding an isomorphic_with
call to your
Spira model declaration. For example, given an ActiveRecord User
model:
class User < ActiveRecord::Base; end
with id
, email
and encrypted_password
properties, an isomorphic Spira Person
model can be defined:
class Person < Spira::Base
configure base_uri: 'http://example.org/example/people',
default_vocabulary: 'http://example.org/example/vocab'
isomorphic_with :user
property :name, predicate: FOAF.name, type: String
end
Models can be associated by setting the corresponding attributes:
> bob = Person.for('bob')
=> <Person:2202810640 @subject: http://example.org/example/people/bob>
> bob.user = User.find(1)
=> #<User id: 1, email: "bob@example.com", ...>
> bob.user
=> #<User id: 1, email: "bob@example.com", ...>
> bob.save
=> <Person:2202810640 @subject: http://example.org/example/people/bob>
> User.find(1).person
=> <Person:2202810640 @subject: http://example.org/example/people/bob>
> bob.user_id
=> 1
Note that:
default_vocabulary
must be set on the Spira model.user_id
).By default, attributes are delegated in both directions:
> bob = Person.for('bob')
=> <Person:2202810640 @subject: http://example.org/example/people/bob>
> bob.user = User.find(1)
=> #<User id: 1, email: "bob@example.com", ...>
> bob.email
=> "bob@example.com"
> bob.name = 'Bob'
=> "Bob"
> User.find(1).name
=> "Bob"
This can be disabled by setting delegation
to false
: isomorphic_with :user, delegation: false
git checkout -b feature/my-new-feature
)git commit -am 'Add some feature'
)git push origin feature/my-new-feature
)FAQs
Unknown package
We found that spira-active_record_isomorphisms demonstrated a not healthy version release cadence and project activity because the last version was released 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.