cf-uaa-lib 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4f87c632e85e6c3c857f7ea381fc9c67492c312e
4
+ data.tar.gz: 3ef4b8256eca1d568603ba504028f9088c851a7f
5
+ SHA512:
6
+ metadata.gz: b5f7eda844de676aee6258b03b77be2e11ae3b3f10bfee72919be6c285e16e60f54d0cbac96680d44507ce66890ecfd11ef9cacef80cee1a0110b3c21fc91f6c
7
+ data.tar.gz: bc938108eaa5580279a3b54204f78f844ebe59264ce84a009df6d796875014ba9654cbb3a4ac1195b04aad1ce04252dbb1d33954c6983f3d8c3a74f7f4d049d7
@@ -240,6 +240,18 @@ class TokenIssuer
240
240
  :password => password, :scope => scope)
241
241
  end
242
242
 
243
+ # Gets an access token with the user credentials used for authentication
244
+ # via the owner password grant.
245
+ # See {http://tools.ietf.org/html/rfc6749#section-4.3}.
246
+ # @param credentials should be an object such as a hash that can be converted
247
+ # to a json representation of the credential name/value pairs corresponding to
248
+ # the keys retrieved by {#prompts}.
249
+ # @return [TokenInfo]
250
+ def owner_password_credentials_grant(credentials)
251
+ credentials[:grant_type] = 'password'
252
+ request_token(credentials)
253
+ end
254
+
243
255
  # Uses the instance client credentials to get a token with a client
244
256
  # credentials grant. See http://tools.ietf.org/html/rfc6749#section-4.4
245
257
  # @return [TokenInfo]
@@ -14,6 +14,6 @@
14
14
  # Cloud Foundry namespace
15
15
  module CF
16
16
  module UAA
17
- VERSION = "3.2.0"
17
+ VERSION = "3.2.1"
18
18
  end
19
19
  end
@@ -111,6 +111,28 @@ describe TokenIssuer do
111
111
 
112
112
  end
113
113
 
114
+ describe "#owner_password_credentials_grant" do
115
+ it "gets a token grant type password" do
116
+ subject.set_request_handler do |url, method, body, headers|
117
+ headers["content-type"].should =~ /application\/x-www-form-urlencoded/
118
+ headers["accept"].should =~ /application\/json/
119
+ url.should == "http://test.uaa.target/oauth/token"
120
+ method.should == :post
121
+ body.split('&').should =~ ["passcode=fake-passcode", "grant_type=password"]
122
+ reply = {:access_token => "test_access_token", :token_type => "BEARER",
123
+ :scope => "openid", :expires_in => 98765}
124
+ [200, Util.json(reply), {"content-type" => "application/json"}]
125
+ end
126
+ token = subject.owner_password_credentials_grant({passcode: "fake-passcode"})
127
+ token.should be_an_instance_of TokenInfo
128
+ token.info["access_token"].should == "test_access_token"
129
+ token.info["token_type"].should =~ /^bearer$/i
130
+ token.info["scope"].should == "openid"
131
+ token.info["expires_in"].should == 98765
132
+ end
133
+
134
+ end
135
+
114
136
  context "with implicit grant" do
115
137
 
116
138
  it "gets the prompts for credentials used to authenticate implicit grant" do
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf-uaa-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
5
- prerelease:
4
+ version: 3.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dave Syer
@@ -13,134 +12,118 @@ authors:
13
12
  autorequire:
14
13
  bindir: bin
15
14
  cert_chain: []
16
- date: 2015-03-20 00:00:00.000000000 Z
15
+ date: 2015-03-27 00:00:00.000000000 Z
17
16
  dependencies:
18
17
  - !ruby/object:Gem::Dependency
19
18
  name: multi_json
20
19
  requirement: !ruby/object:Gem::Requirement
21
- none: false
22
20
  requirements:
23
- - - ! '>='
21
+ - - ">="
24
22
  - !ruby/object:Gem::Version
25
23
  version: '0'
26
24
  type: :runtime
27
25
  prerelease: false
28
26
  version_requirements: !ruby/object:Gem::Requirement
29
- none: false
30
27
  requirements:
31
- - - ! '>='
28
+ - - ">="
32
29
  - !ruby/object:Gem::Version
33
30
  version: '0'
34
31
  - !ruby/object:Gem::Dependency
35
32
  name: bundler
36
33
  requirement: !ruby/object:Gem::Requirement
37
- none: false
38
34
  requirements:
39
- - - ! '>='
35
+ - - ">="
40
36
  - !ruby/object:Gem::Version
41
37
  version: '0'
42
38
  type: :development
43
39
  prerelease: false
44
40
  version_requirements: !ruby/object:Gem::Requirement
45
- none: false
46
41
  requirements:
47
- - - ! '>='
42
+ - - ">="
48
43
  - !ruby/object:Gem::Version
49
44
  version: '0'
50
45
  - !ruby/object:Gem::Dependency
51
46
  name: rake
52
47
  requirement: !ruby/object:Gem::Requirement
53
- none: false
54
48
  requirements:
55
- - - ~>
49
+ - - "~>"
56
50
  - !ruby/object:Gem::Version
57
51
  version: 10.3.2
58
52
  type: :development
59
53
  prerelease: false
60
54
  version_requirements: !ruby/object:Gem::Requirement
61
- none: false
62
55
  requirements:
63
- - - ~>
56
+ - - "~>"
64
57
  - !ruby/object:Gem::Version
65
58
  version: 10.3.2
66
59
  - !ruby/object:Gem::Dependency
67
60
  name: rspec
68
61
  requirement: !ruby/object:Gem::Requirement
69
- none: false
70
62
  requirements:
71
- - - ~>
63
+ - - "~>"
72
64
  - !ruby/object:Gem::Version
73
65
  version: 2.14.1
74
66
  type: :development
75
67
  prerelease: false
76
68
  version_requirements: !ruby/object:Gem::Requirement
77
- none: false
78
69
  requirements:
79
- - - ~>
70
+ - - "~>"
80
71
  - !ruby/object:Gem::Version
81
72
  version: 2.14.1
82
73
  - !ruby/object:Gem::Dependency
83
74
  name: simplecov
84
75
  requirement: !ruby/object:Gem::Requirement
85
- none: false
86
76
  requirements:
87
- - - ~>
77
+ - - "~>"
88
78
  - !ruby/object:Gem::Version
89
79
  version: 0.8.2
90
80
  type: :development
91
81
  prerelease: false
92
82
  version_requirements: !ruby/object:Gem::Requirement
93
- none: false
94
83
  requirements:
95
- - - ~>
84
+ - - "~>"
96
85
  - !ruby/object:Gem::Version
97
86
  version: 0.8.2
98
87
  - !ruby/object:Gem::Dependency
99
88
  name: simplecov-rcov
100
89
  requirement: !ruby/object:Gem::Requirement
101
- none: false
102
90
  requirements:
103
- - - ~>
91
+ - - "~>"
104
92
  - !ruby/object:Gem::Version
105
93
  version: 0.2.3
106
94
  type: :development
107
95
  prerelease: false
108
96
  version_requirements: !ruby/object:Gem::Requirement
109
- none: false
110
97
  requirements:
111
- - - ~>
98
+ - - "~>"
112
99
  - !ruby/object:Gem::Version
113
100
  version: 0.2.3
114
101
  - !ruby/object:Gem::Dependency
115
102
  name: ci_reporter
116
103
  requirement: !ruby/object:Gem::Requirement
117
- none: false
118
104
  requirements:
119
- - - ~>
105
+ - - "~>"
120
106
  - !ruby/object:Gem::Version
121
107
  version: 1.9.2
122
108
  type: :development
123
109
  prerelease: false
124
110
  version_requirements: !ruby/object:Gem::Requirement
125
- none: false
126
111
  requirements:
127
- - - ~>
112
+ - - "~>"
128
113
  - !ruby/object:Gem::Version
129
114
  version: 1.9.2
130
115
  - !ruby/object:Gem::Dependency
131
116
  name: json_pure
132
117
  requirement: !ruby/object:Gem::Requirement
133
- none: false
134
118
  requirements:
135
- - - ~>
119
+ - - "~>"
136
120
  - !ruby/object:Gem::Version
137
121
  version: 1.8.1
138
122
  type: :development
139
123
  prerelease: false
140
124
  version_requirements: !ruby/object:Gem::Requirement
141
- none: false
142
125
  requirements:
143
- - - ~>
126
+ - - "~>"
144
127
  - !ruby/object:Gem::Version
145
128
  version: 1.8.1
146
129
  description: Client library for interacting with the CloudFoundry User Account and
@@ -158,9 +141,9 @@ executables: []
158
141
  extensions: []
159
142
  extra_rdoc_files: []
160
143
  files:
161
- - .gitignore
162
- - .travis.yml
163
- - .yardopts
144
+ - ".gitignore"
145
+ - ".travis.yml"
146
+ - ".yardopts"
164
147
  - CHANGELOG.md
165
148
  - Gemfile
166
149
  - LICENSE.TXT
@@ -187,27 +170,26 @@ files:
187
170
  homepage: https://github.com/cloudfoundry/cf-uaa-lib
188
171
  licenses:
189
172
  - Apache 2.0
173
+ metadata: {}
190
174
  post_install_message:
191
175
  rdoc_options: []
192
176
  require_paths:
193
177
  - lib
194
178
  required_ruby_version: !ruby/object:Gem::Requirement
195
- none: false
196
179
  requirements:
197
- - - ! '>='
180
+ - - ">="
198
181
  - !ruby/object:Gem::Version
199
182
  version: '0'
200
183
  required_rubygems_version: !ruby/object:Gem::Requirement
201
- none: false
202
184
  requirements:
203
- - - ! '>='
185
+ - - ">="
204
186
  - !ruby/object:Gem::Version
205
187
  version: '0'
206
188
  requirements: []
207
189
  rubyforge_project: cf-uaa-lib
208
- rubygems_version: 1.8.23.2
190
+ rubygems_version: 2.2.2
209
191
  signing_key:
210
- specification_version: 3
192
+ specification_version: 4
211
193
  summary: Client library for CloudFoundry UAA
212
194
  test_files:
213
195
  - spec/http_spec.rb