openid_connect 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +11 -0
- data/VERSION +1 -0
- data/lib/openid_connect.rb +7 -0
- data/lib/rack/oauth2/server/authorize/extensions/id_token.rb +34 -0
- data/lib/rack/oauth2/server/authorize/extensions/id_token_and_token.rb +34 -0
- data/openid_connect.gemspec +17 -0
- data/spec/spec_helper.rb +2 -0
- metadata +106 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Rack
|
2
|
+
module OAuth2
|
3
|
+
module Server
|
4
|
+
class Authorize
|
5
|
+
module Extensions
|
6
|
+
class IdToken < Abstract::Handler
|
7
|
+
class << self
|
8
|
+
def response_type_for?(response_type)
|
9
|
+
response_type == 'id_token'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def call(env)
|
14
|
+
@request = Request.new env
|
15
|
+
@response = Response.new request
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
class Request < Authorize::Token::Request
|
20
|
+
def initialize(env)
|
21
|
+
super
|
22
|
+
@response_type = :id_token
|
23
|
+
attr_missing!
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class Response < Authorize::Token::Response
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Rack
|
2
|
+
module OAuth2
|
3
|
+
module Server
|
4
|
+
class Authorize
|
5
|
+
module Extensions
|
6
|
+
class IdTokenAndToken < Abstract::Handler
|
7
|
+
class << self
|
8
|
+
def response_type_for?(response_type)
|
9
|
+
response_type.split.sort == ['id_token', 'token']
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def call(env)
|
14
|
+
@request = Request.new env
|
15
|
+
@response = Response.new request
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
class Request < Authorize::Token::Request
|
20
|
+
def initialize(env)
|
21
|
+
super
|
22
|
+
@response_type = [:id_token, :token]
|
23
|
+
attr_missing!
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class Response < Authorize::Token::Response
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "openid_connect"
|
3
|
+
s.version = File.read("VERSION")
|
4
|
+
s.authors = ["nov matake"]
|
5
|
+
s.email = ["nov@matake.jp"]
|
6
|
+
s.homepage = "https://github.com/nov/openid_connect"
|
7
|
+
s.summary = %q{OpenID Connect Server & Client Library}
|
8
|
+
s.description = %q{OpenID Connect Server & Client Library}
|
9
|
+
s.files = `git ls-files`.split("\n")
|
10
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
11
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.add_runtime_dependency "rack-oauth2", ">= 0.9.0"
|
14
|
+
s.add_development_dependency "rake", ">= 0.8"
|
15
|
+
s.add_development_dependency "rcov", ">= 0.9"
|
16
|
+
s.add_development_dependency "rspec", ">= 2"
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: openid_connect
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- nov matake
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-08-11 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rack-oauth2
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.9.0
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rake
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0.8"
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rcov
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0.9"
|
46
|
+
type: :development
|
47
|
+
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rspec
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "2"
|
57
|
+
type: :development
|
58
|
+
version_requirements: *id004
|
59
|
+
description: OpenID Connect Server & Client Library
|
60
|
+
email:
|
61
|
+
- nov@matake.jp
|
62
|
+
executables: []
|
63
|
+
|
64
|
+
extensions: []
|
65
|
+
|
66
|
+
extra_rdoc_files: []
|
67
|
+
|
68
|
+
files:
|
69
|
+
- .gitignore
|
70
|
+
- Gemfile
|
71
|
+
- Rakefile
|
72
|
+
- VERSION
|
73
|
+
- lib/openid_connect.rb
|
74
|
+
- lib/rack/oauth2/server/authorize/extensions/id_token.rb
|
75
|
+
- lib/rack/oauth2/server/authorize/extensions/id_token_and_token.rb
|
76
|
+
- openid_connect.gemspec
|
77
|
+
- spec/spec_helper.rb
|
78
|
+
homepage: https://github.com/nov/openid_connect
|
79
|
+
licenses: []
|
80
|
+
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options: []
|
83
|
+
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: "0"
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: "0"
|
98
|
+
requirements: []
|
99
|
+
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 1.8.5
|
102
|
+
signing_key:
|
103
|
+
specification_version: 3
|
104
|
+
summary: OpenID Connect Server & Client Library
|
105
|
+
test_files:
|
106
|
+
- spec/spec_helper.rb
|