Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Provides a more HTTPish API around the ruby-openid library.
Install the gem and add to the application's Gemfile by executing:
$ bundle add rack-openid2
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install rack-openid2
You trigger an OpenID request similar to HTTP authentication. From your app, return a "401 Unauthorized" and a "WWW-Authenticate" header with the identifier you would like to validate.
On competition, the OpenID response is automatically verified and assigned to env["rack.openid.response"]
.
MyApp = lambda do |env|
if resp = env["rack.openid.response"]
case resp.status
when :success
...
when :failure
...
else
[401, {"WWW-Authenticate" => 'OpenID identifier="http://example.com/"'}, []]
end
end
end
use Rack::OpenID
run MyApp
# Session needs to be before Rack::OpenID
use Rack::Session::Cookie
require 'rack/openid'
use Rack::OpenID
get '/login' do
erb :login
end
post '/login' do
if resp = request.env["rack.openid.response"]
if resp.status == :success
"Welcome: #{resp.display_identifier}"
else
"Error: #{resp.status}"
end
else
headers 'WWW-Authenticate' => Rack::OpenID.build_header(
:identifier => params["openid_identifier"]
)
throw :halt, [401, 'got openid?']
end
end
enable :inline_templates
__END__
@@ login
<form action="/login" method="post">
<p>
<label for="openid_identifier">OpenID:</label>
<input id="openid_identifier" name="openid_identifier" type="text" />
</p>
<p>
<input name="commit" type="submit" value="Sign in" />
</p>
</form>
Primary Namespace | Rack::OpenID |
---|---|
gem name | ruby-openid2 |
code triage | |
documentation | on Github.com, on rubydoc.info |
expert support | |
... 💖 | 💻 🌏 |
Current maintainer(s):
Special thanks to:
rack-openid
rack-openid
and contributors to original rack-openid
:
Made with contributors-img.
Everyone interacting in this project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
This Library adheres to Semantic Versioning 2.0.0. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, a new version should be immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new major versions.
To get a better understanding of how SemVer is intended to work over a project's lifetime, read this article from the creator of SemVer:
As a result of this policy, you can (and should) specify a dependency on these libraries using the Pessimistic Version Constraint with two digits of precision.
For example:
spec.add_dependency("rack-openid2", "~> 2.0")
See CHANGELOG.md for list of releases.
The gem is available as open source under the terms of the MIT License .
See LICENSE.txt for the official Copyright Notice.
You made it to the bottom of the page!
FAQs
Unknown package
We found that rack-openid2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.