Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Monkey patch for AWS ruby SDK HashModel to support models backed by DynamoDB tables with hash-range keys.
As of June 2013 AWS-sdk for ruby HasModel for DynamoDB does not support working with tables having a hash-range main key. Additionally the main key in hash tables is alway called :id.
Another well known DynamoDB ORM is Dynamoid, but they lack this as well. Most likely because they've built on top of HashModel and hence they are subject to its current functionality.
Having the ability to perform queries in hash-range tables and the recent addition of secondary indexes for this kind of tables, we monkey patched the HashModel class to offer some initial support.
Depending on when and how Amazon supports this kind of tables, Minidynamo will continue to be supported. Since this gem is very small and mostly based on their own code, we're optimistic that Amazon will implement something similar. In the meantime, we hope this is useful.
Minidynamo offers the following compared to HashModel:
This simple additions, even though still not offering the full range of posibilities for hash-range tables in DynamoDB current API, will cover lots of use cases. We currently use it in more than 3 internal applications. Hash-range + DynamoDB in this applications enable low latency data availability to improve response times in internal components and make scaling a matter of clicks.
Include minidynamo in your Gemfile.
gem 'minidynamo', '~> 0.1.0'
Don't forget to do bundle install
right after.
class TestModel < Minidynamo::Model
table name: "my_table",
hash_key: {:my_attribute => :string},
range_key: {:my_range_name => :string}
initial_throughput read_capacity: 5, write_capacity: 5
timestamps
field :custom_field, :string
end
With field
the valid types are those that HashModel offers in the form of {type}_attr
methods. For example:
field
only calls those methods. This is pure synthactic sugar, but we think it resembles a lot better the way we've become used to see ruby syntax, specially if you come from the Rails world.
timestamps, as any other methods available via HashModel continue to be ready for you to use. You can check more in the HasModel docs.
You can still work with hash-only tables. Just omit the range_key part in the call to table
.
You could go and create the table by calling TestModel.create_table
FAQs
Unknown package
We found that minidynamo 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.