
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
= ReCAPTCHA
Author:: Jason L Perry (http://ambethia.com)
Copyright:: Copyright (c) 2007 Jason L Perry
License:: MIT
RDOC:: http://ambethia.com/recaptcha/
Git:: http://github.com/ambethia/recaptcha/tree/master
Bugs:: http://ambethia.lighthouseapp.com/projects/11072-recaptcha/overview
This plugin adds helpers for the ReCAPTCHA API (http://recaptcha.net/). In your views you can use the +recaptcha_tags+ method to embed the needed javascript, and you can validate in your controllers with +verify_recaptcha+.
You'll want to add your public and private API keys in the environment variables RECAPTCHA_PUBLIC_KEY and RECAPTCHA_PRIVATE_KEY, respectively. You could also specify them in config/environment.rb if you are so inclined. Exceptions will be raised if you call these methods and the keys can't be found.
== +recaptcha_tags+
Some of the options available:
:ssl:: Uses secure http for captcha widget (default +false+) :noscript:: Include content (default +true+) :display:: Takes a hash containing the +theme+ and +tabindex+ options per the API. (default +nil+) :public_key:: Your public API key, takes precedence over the ENV variable (default +nil+). :error:: Override the error in +session[:recaptcha_error]+ (default +nil+).
== +verify_recaptcha+
This method returns +true+ or +false+ after processing the parameters from the ReCAPTCHA widget. Why isn't this a model validation? Because that violates MVC. Use can use it like this, or how ever you like. Passing in the ActiveRecord object is optional, if you do--and the captcha fails to verify--an error will be added to the object for you to use.
respond_to do |format| if verify_recaptcha(@post) && @post.save # ... else # ... end end
== TODO
FAQs
Unknown package
We found that mwhuss-recaptcha 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
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.