
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
An rails plugin that provides a fake framework to stub 3-party redirect page such as payment or oauth login.
Add this line to your application's Gemfile:
gem 'fakesite', group: :development
And then execute:
bundle
Add fakesite route in your config/route.rb
mount Fakesite::Engine => "/fakesite" if Rails.env.development?
Inherit Fakesite::Base
class and implement methods:
class TestFakesite < Fakesite::Base
# specify what the parameters will return to your site
def parameters
{:test_key1 => :value1, :test_key2 => :value2}
end
# overwrite where to return, default using return_url in external_uri query string if exsit
def return_url
external_params["custom_url"]
end
# overwrite the parameters that will pass to return_url. default is params, you can do something here
# def return_parameters
# params
# end
# implement the rule to stub external page by redirect url
def self.match(external_uri)
external_uri.host == "test.com"
end
# after register event
# def self.after_register
# end
end
You can use following properties and methods in instance of Fakesite::Base class:
The options that you registered.
The original uri of external third-party.
The parameters of external_uri in query string.
The post parameters in the fakesite page.
current_user
instance from devise if exists.
You can register your fakesites when rails initialize.
if Rails.env.development?
Fakesite.register :test, TestFakesite
# You can also pass some options if needs, and using by options in your class
# Fakesite.register :test, TestFakesite, {:your => :option}
end
You can put the registration in config/initializers/fakesite.rb
The gem is available as open source under the terms of the MIT License.
The project's website is located at https://github.com/emn178/fakesite
Author: emn178@gmail.com
FAQs
Unknown package
We found that fakesite 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 new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.