
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.