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.
A Flickr gallery which can be mounted as a Rails engine. Once mounted, you can view your own photosets and its photos. This is offered in its current state, but new features will be added as soon as possible (or you can contribute to this gem to make that happen yourself)
Add this line to your application's Gemfile:
gem "kuva"
And then execute:
$ bundle
Or install it yourself:
$ gem install kuva
To use Kuva you'll need to authorize the gem with Flickr. In order to do that, you'll need to apply for an API key and shared secret. When that's done, you'll need to supply those values to the Kuva initializer. Afterwards you need run the kuva:authorize
rake task, but first things first, so let's start at step one.
You can retrieve an API key and shared secret from Flickr by creating a new application. Just follow the instructions and once you've received the API key and shared secret, move on to step two.
Now that we've got an API key and shared secret, let's put them to use. Configuring Kuva is pretty easy. First run the following:
rails generate kuva:install
This will do several things for you as you will see in the generated output. It will among other things:
config/initializer/kuva.rb
.config/locales/kuva.en.yml
.app/assets/javascripts/kuva.js.coffee
and app/assets/stylesheets/kuva.css.sass
which will load the actual Kuva assets from the Rails engine. You're also able to adjust the default views.config/routes.rb
.As listed above, the kuva:install
generator will install an initializer called config/initializer/kuva.rb
in your Rails application. Use the previously acquired variables (from Flickr) to fill in the Kuva setup block in that file.
Hang on, we're almost there. Now move on to part three.
kuva:authorize
rake taskrake kuva:authorize
Something like the following will be shown to you:
Copy the URL below and follow the steps on Flickr to authorize Kuva:
https://api.flickr.com/services/oauth/authorize?oauth_token=OAUTH_TOKEN&perms=read
Once you've authorized Kuva, you'll receive a code (in the form of xxx-xxx-xxx) from Flickr. Copy and paste that code here and press <enter>:
Copy the URL (as requested) and paste it in your browser. Next copy the code (xxx-xxx-xxx) from Flickr, paste it in your shell and press enter. Once you've done that, you'll receive the access token and access secret from Flickr:
USERNAME, you've successfully authorized Kuva with Flickr. As you can see we've received your username. Besides that we've got the following access token 'ACCESS_TOKEN' and access secret 'ACCESS_SECRET'. Both the API key, shared secret and the previously mentioned variables should be saved for later use. They're all listed below. Place them in `config/initializers/kuva.rb` and you're good to go.
api_key: API_KEY
shared_secret: SHARED_SECRET
access_token: ACCESS_TOKEN
access_secret: ACCESS_SECRET
You're now done authorizing Kuva! Take note of the variables and save them, since you'll need them to use Kuva. Now let's move on to the configuration of Kuva.
As described in the previous part we've now got the required variables, so let's actually use them.
The rails generate kuva:install
will (among other things) install an initializer called config/initializer/kuva.rb
in your Rails application. You've already filled in your API key and shared secret in that file.
Before you can use Kuva in your Rails application you'll have to set the access token
and access secret
. So let's fill in the missing configuration options with the acquired variables.
Besides the API key
, shared secret
, access token
and access secret
you're able to set the cache expiration
of the Flickr API calls in the initializer as well.
Kuva will be mounted for you automatically. By default it will use the path /kuva
, but you can specify any path you would like Kuva to be available on.
So, if you would like to adjust it, go to your config/routes.rb
file and change the path in the following line of code to something of your liking:
mount Kuva::Engine => "/kuva"
That's it!
When you decide to contribute to this gem, the first thing you need to do (obviously) is follow the contributing rules.
The next thing is setting up your development environment. To do that, you'll need an API key and shared secret. When you've got them, you can use them in the .env
file. If you don't have one yet, start with the following:
mv .env.example .env
Now fill in the Flickr variables in the .env
file. This file will be used by RSpec (more specifically the spec_helper.rb
file) to make the Flickr API calls by setting the values as environment variables.
If you're like me, you'll want to adjust the default (basic) functionality (or at least the views). Good news, you can do that!
The kuva:install
generator (which you should've run by now) also installed a locale (called config/locales/en/kuva.yml
) which contains the labels for the Kuva views. When you would like to adjust them, you now know where to look.
Whenever you would like to adjust the default Kuva views, you can. Simply run the following command on the command line:
rails generate kuva:views
This will copy all the default views to your application. They'll be placed in the app/views/kuva
directory. Once that's done, you can edit them to your liking.
If you would like to see the Kuva Rails engine in action, you can checkout the following website: NewMediaFreak. I've (it's my personal website) adjusted the views a bit though.
You're very welcome to contribute to this gem. To do so, please follow these steps:
bundle install
git checkout -b my-new-feature
rspec
and make sure everything is covered with RSpecgit commit -am 'Added new feature'
git push origin my-new-feature
Kuva has some basic functionality, but it can always be improved. Some features that might be useful:
When you would like to contribute, but you're not sure what to add, pick something from the list above. If you start on one of them, please add a new issue (to claim a feature), so that we don't get multiple pull requests for the same functionality.
Copyright 2014 Kevin Tuhumury. Released under the MIT License.
FAQs
Unknown package
We found that kuva 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.