
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
RedisCaptcha is a captcha engine base on Redis for Rails 3.2. It provides simple captcha that can be read by human.
locked_times
and locked_time
to avoid someone who want to attack.expired_time
.I haven't tried lower version yet.
1. Add RedisCaptcha to your gemfile
gem 'redis_captcha'
2. Generate initializer
rails g redis_captcha:install
It'll generate config/initializers/redis_captcha.rb
, and you can configure all options here.
3. Mount RedisCaptcha::Engine in your router.rb
mount RedisCaptcha::Engine => '/captcha', :as => :captcha
4. Add before_filter to your controller
class PostsController < ApplicationController
before_filter :generate_captcha_key, :only => [:new, :edit]
......
end
4. Add module to your model
class Post < ActiveRecord::Base
include RedisCaptcha::Model
end
if you set config.active_record.whitelist_attributes = true
in config/application.rb
, remember to add attr_accessible to your model:
attr_accessible :captcha, :captcha_key
to your model.
5. Use RedisCaptcha in your view
<%= image_tag(captcha_path(:timestamp => Time.now.to_i), :alt => "captcha") %>
<%= f.text_field :captcha %>
<%= f.hidden_field :captcha_key, :value => session[:captcha_key] %>
6. Use RedisCaptcha in your controller
# Initialize a post
@post = Post.new(:title => "test")
# valid with captcha
@post.valid?
# save with captcha
@post.save
# valid without captcha
@post.valid_without_captcha?
# save without captcha
@post.save_without_captcha
Enjoy it!
0.8.0
First Version
This project rocks and uses MIT-LICENSE.
FAQs
Unknown package
We found that redis_captcha 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.