
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
= Sinatra LinkedIn Provides helpers for accessing the LinkedIn API in Sinatra applications. Relies on the {LinkedIn gem}[https://github.com/pengwynn/linkedin] to do the heavy lifting.
Author:: Bob Nadler, Jr. (bnadler@cyrusinnovation.com)
== Notes / Use === Installation gem install sinatra-linkedin
or if using Bundler, add to your Gemfile: gem 'sinatra-linkedin'
then run bundle install
=== Quickstart Before using you'll need to acquire an API key from LinkedIn. Go to the {LinkedIn Developer Portal}[https://developer.linkedin.com/] to obtain your key.
Sinatra LinkedIn can be used in either "classic" or "modular" Sinatra apps. For "classic" apps, you only need to require the sinatra-linkedin module and set your API key and API secret. require 'sinatra' require 'sinatra/linkedin'
set :linkedin_api_key, 'your api key'
set :linkedin_api_secret, 'your api secret'
get '/public' do
if authorized?
"Welcome back!"
else
"Oops, you haven't logged in yet. Please <a href='/auth'>login</a>"
end
end
get '/private' do
authorize!
"Thanks for logging in!"
end
It works the same way with a "modular" app; the only difference is that you must register Sinatra LinkedIn explicitly. require 'sinatra/base' require 'sinatra/linkedin'
class MyApp < Sinatra::Base
register Sinatra::Linkedin
set :linkedin_api_key, 'your api key'
set :linkedin_api_secret, 'your api secret'
get '/public' do
if authorized?
"Welcome back!"
else
"Oops, you haven't logged in yet. Please <a href='/auth'>login</a>"
end
end
get '/private' do
authorize!
"Thanks for logging in!"
end
end
==== Routes Sinatra LinkedIn provides several routes to help you: /auth:: authorizes the user by setting up a request token and redirecting to the LinkedIn authorization page. Once the user has granted access (or denied it) they will be redirected to /auth/callback (see below).
/auth/callback:: stores the token and secret in the session, then redirects to the root URL.
/auth/logout:: deletes the token and secret from the session and redirects the user to the root URL.
==== Helper Methods Sinatra LinkedIn provides these helper methods: authorized?:: returns true if the user has authenticated with their LinkedIn credentials.
authorize!:: redirects the user to the /auth route unless they have already been authenticated.
client:: provides a handle to the +LinkedIn::Client+ class. Refer to the LinkedIn[https://github.com/pengwynn/linkedin] gem for usage information.
== Contributing === Issues / Roadmap Use GitHub issues[https://github.com/cyrusinnovation/sinatra-linkedin/issues] for reporting bug and feature requests.
=== Patches / Pull Requests
=== Project Layout /lib:: Main project source code.
/test:: All test source code and data samples.
Gemfile:: Dependency management with Bundler.
Rakefile:: Rake tasks for the project. Use "rake -T" to see a list of available tasks.
README.rdoc:: This file.
== License (The MIT License)
Copyright (c) 2012 Bob Nadler, Jr.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that sinatra-linkedin 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.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.