omniauth-heroku 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ /pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
data/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # OmniAuth Heroku
2
+
3
+ OmniAuth strategy for authenticating to Heroku.
4
+
5
+ Heroku's support for OAuth is still private/experimental.
6
+
7
+
8
+ ## Basic Usage
9
+
10
+ use OmniAuth::Builder do
11
+ provider :heroku, ENV['HEROKU_KEY'], ENV['HEROKU_SECRET']
12
+ end
13
+
14
+
15
+ ## Meta
16
+
17
+ Released under the MIT license.
18
+
19
+ Created by Pedro Belo.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,38 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Heroku < OmniAuth::Strategies::OAuth2
6
+ BaseAuthUrl = ENV["HEROKU_AUTH_URL"] || "https://api.heroku.com"
7
+
8
+ option :client_options, {
9
+ :site => BaseAuthUrl,
10
+ :authorize_url => "#{BaseAuthUrl}/oauth/authorize",
11
+ :token_url => "#{BaseAuthUrl}/oauth/token"
12
+ }
13
+
14
+ def request_phase
15
+ super
16
+ end
17
+
18
+ uid { raw_info['id'] }
19
+
20
+ info do
21
+ {
22
+ 'email' => raw_info['email'],
23
+ 'api_key' => raw_info['api_key'],
24
+ 'token' => raw_info['api_key'], # compatibility
25
+ }
26
+ end
27
+
28
+ extra do
29
+ {:raw_info => raw_info}
30
+ end
31
+
32
+ def raw_info
33
+ access_token.options[:mode] = :query
34
+ @raw_info ||= access_token.get('/account').parsed
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1 @@
1
+ require 'omniauth/strategies/heroku'
@@ -0,0 +1,16 @@
1
+ Gem::Specification.new do |gem|
2
+ gem.authors = ["Pedro Belo"]
3
+ gem.email = ["pedro@heroku.com"]
4
+ gem.description = %q{OmniAuth strategy for Heroku.}
5
+ gem.summary = %q{OmniAuth strategy for Heroku.}
6
+ gem.homepage = "https://github.com/heroku/omniauth-heroku"
7
+
8
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
9
+ gem.files = `git ls-files`.split("\n")
10
+ gem.name = "omniauth-heroku"
11
+ gem.require_paths = ["lib"]
12
+ gem.version = "0.0.2"
13
+
14
+ gem.add_dependency 'omniauth', '~> 1.0'
15
+ gem.add_dependency 'omniauth-oauth2', '~> 1.0'
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-heroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &70343608605060 !ruby/object:Gem::Requirement
16
+ requirement: &70184199153060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70343608605060
24
+ version_requirements: *70184199153060
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: omniauth-oauth2
27
- requirement: &70343608604420 !ruby/object:Gem::Requirement
27
+ requirement: &70184199167040 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,14 +32,21 @@ dependencies:
32
32
  version: '1.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70343608604420
35
+ version_requirements: *70184199167040
36
36
  description: OmniAuth strategy for Heroku.
37
37
  email:
38
38
  - pedro@heroku.com
39
39
  executables: []
40
40
  extensions: []
41
41
  extra_rdoc_files: []
42
- files: []
42
+ files:
43
+ - .gitignore
44
+ - .rspec
45
+ - README.md
46
+ - Rakefile
47
+ - lib/omniauth-heroku.rb
48
+ - lib/omniauth/strategies/heroku.rb
49
+ - omniauth-heroku.gemspec
43
50
  homepage: https://github.com/heroku/omniauth-heroku
44
51
  licenses: []
45
52
  post_install_message: