GitXplorerGitXplorer
l

gadgeteer

public
10 stars
4 forks
0 issues

Commits

List of commits on branch master.
Unverified
1e26d413ff255618c7acbd1cc5931ad86ee3a963

Use Rails.root instead of RAILS_ROOT

ddrogus committed 15 years ago
Unverified
bc70d1b59ed95b78fdc783bd0f8f0e008b591436

compatability with 1.9.1 fix

committed 15 years ago
Unverified
2ec0be01f4cb7ce34502835b099d5ce83c91685d

Regenerated gemspec for version 0.3.0

llackac committed 15 years ago
Unverified
78835a550e0bf199a7f50859b82f5e016e9de2c4

jquery.gadgeteer.js v0.3

llackac committed 15 years ago
Unverified
6f396c65c9f6107ea45e45386c134524f2073617

Version bump to 0.3.0

llackac committed 15 years ago
Unverified
2e76d62cd93b411e7cd02149762e328dc846c68c

adding missing jquery.form plugin (needed for form processing)

llackac committed 15 years ago

README

The README file for this repository.

Gadgeteer simplifies OpenSocial Gadget development by giving you helpers you can use in your Rails application to verify Signed Requests and access OpenSocial data.

= Requirements

Gadgeteer requires the {oauth gem}[http://github.com/pelle/oauth/tree/master] (0.2.7+).

Note: the current version of the oauth gem doesn't comply completely with the OAuth standard, and also doesn't work with Rails 2.3. You can use {lackac's fork}[http://github.com/lackac/oauth/tree/master], until the fixes are merged in.

= Usage

You can configure the secrets and public keys used by your application two ways.

For consumer secrets you can put your consumer key/secret pairs into config/oauth_secrets.yml:

key: secret

or you could setup those in your ApplicationController:

class ApplicationController < ActionController::Base

oauth_secrets['key'] = 'secret'

end

For public keys you can put the certificates into config/certs with .cert extension, or you could setup the public keys in your ApplicationController by creating a OpenSSL::PKey::RSA object and adding it to the public_keys hash:

class ApplicationController < ActionController::Base

public_keys['example.com'] = OpenSSL::PKey::RSA.new(OpenSSL::X509::Certificate.new(CERT).public_key)

end

You can use the verify_signature method as a before_filter in your controllers to make sure the signed requests are correct:

class SecretNotesController < ActionController::Base

before_filter :verify_signature

end

The correct secret or public key will be used for verification based on the current request. If the xoauth_signature_publickey parameter is set, the corresponding public key will be used. Otherwise the consumer secret connected to the key found in the oauth_consumer_key parameter will be used. The singature will be verified based on this key/secret pair and the singature method set in the parameters.

If there are OpenSocial related request parameters, you can access them with the open_social method:

def index @secret_notes = SecretNote.find_by_profile_id(open_social[:viewer_id]) end

Copyright (c) 2009 László Bácsi, released under the MIT license