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.
has-imgix-attachment
Advanced tools
has-imgix-attachment allows you to easier work with the imgix API through model defined attributes for easier retrieval.
Add this line to your application's Gemfile:
gem 'has-imgix-attachment'
And then execute:
$ bundle
To add imgix to your model, you simply need to call the has-imgix-attachment
method on your model.
class Post < ActiveRecord::Base
has_imgix_attachment :photo,
:subdomain => "imgix-subdomain",
:default => "default.png",
:prefix => "photos",
:styles => {
:thumbnail => {
:h => 90,
:w => 110,
:fit => "crop"
},
:large => {
:h => 480,
:w => 640,
:fit => "crop"
}
}
end
The has-imgix-attachment
method will take accept a name, and a list of options. The first value is the name and of the field that we'll create (which can also be referenced with imgix_attachment
). Below is a list of valid options that can follow the name.
subdomain
- Subdomain defined within your imgix accountdefault
- Name of the image to be used as a default image (must appear in the bucket with all other images)prefix
- If your bucket has folders, supply the folder name herefilename_field
- Override the default column name for the image filename. Default: filenamefile_size_field
- Override the default column name for the image file size. Default: file_sizecontent_type_field
- Override the default column name for the image content type. Default: content_typestyles
- Hash that defines all the variations of the image you'd like to be able to refer toNOTE: Examples of the model configurations can be found in the spec/support/models.rb
file.
The gem comes with a view helper imgix_tag
which is just an extension of the image_tag
.
<%= imgix_tag(@post.photo, "large") %>
will generate the same thing as, just a less verbose shortcut
<%= imgix_tag(@post.imgix_attachment, "large") %>
imgix_tag will accept all the same additional options that image_tag supports
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)
git push origin my-new-feature
)See LICENSE.txt.
FAQs
Unknown package
We found that has-imgix-attachment 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.