omniauth-azure-oauth2 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9c73b1998879a637805a6e9bb99e474877b44f1
4
- data.tar.gz: e6f364fd018413ca5ed2fb58cb26f63e946ccd9c
3
+ metadata.gz: 0d4337c65a6a6f8c0a8830e0f26f877ce6bc27aa
4
+ data.tar.gz: 6ef8a62f0d742488d59347e33007930e58be9596
5
5
  SHA512:
6
- metadata.gz: 1ae29a25456cbae45d709dbd5d3fd125afcb6ff19d6169e0ea8a8d27a931e7221d4f40b271edd230fbdfb6988222c84dac9980553f805f9ef34c3e4ba9f23159
7
- data.tar.gz: f9b8ddaa179edf69138b303afc33582b7809563f52c11e6c6c7814cb6e6ab515659541c6dbc85c51fa7a589812c3a56b7bd0175a92d3abf3303c75c05f2e08b3
6
+ metadata.gz: ae389db21019987a9e98bee124606723cab7a0032cc6815b4fdba1f436b9f79ae5890a16c3b89af24c7999cd2194b6ea4c7da5806c84e1abddc835800c31bb2d
7
+ data.tar.gz: b5bb25ee85b3b9ebaaca7627f8d2d4996d02bb9c3b94e25bb72bb0b99cafd3cd8ebeae8acaf08e023b7633965ef1f72ba3b9ee40985a5eabe8d240f92f5b6862
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # VERSION 0.0.4
2
+ * fix for JWT scoping, thanks @tobsher
3
+
1
4
  # VERSION 0.0.3
2
5
  * added common endpoint and removed mandatory requirement for tenant-id
3
6
  * upgraded jwt
data/README.md CHANGED
@@ -139,3 +139,7 @@ end
139
139
  4. Commit your changes and tests (`git commit -am 'Added some feature'`)
140
140
  5. Push to the branch (`git push origin my-new-feature`)
141
141
  6. Create new Pull Request
142
+
143
+ ## Misc
144
+ Run tests `bundle exec rake`
145
+ Push to rubygems `bundle exec rake release`.
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module AzureOauth2
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -53,9 +53,9 @@ module OmniAuth
53
53
 
54
54
  def raw_info
55
55
  # it's all here in JWT http://msdn.microsoft.com/en-us/library/azure/dn195587.aspx
56
- @raw_info ||= JWT.decode(access_token.token, nil, false).first
56
+ @raw_info ||= ::JWT.decode(access_token.token, nil, false).first
57
57
  end
58
58
 
59
59
  end
60
60
  end
61
- end
61
+ end
@@ -1,6 +1,12 @@
1
1
  require 'spec_helper'
2
2
  require 'omniauth-azure-oauth2'
3
3
 
4
+ module OmniAuth
5
+ module Strategies
6
+ module JWT; end
7
+ end
8
+ end
9
+
4
10
  describe OmniAuth::Strategies::AzureOauth2 do
5
11
  let(:request) { double('Request', :params => {}, :cookies => {}, :env => {}) }
6
12
  let(:app) {
@@ -125,7 +131,7 @@ describe OmniAuth::Strategies::AzureOauth2 do
125
131
  end
126
132
 
127
133
  end
128
-
134
+
129
135
  describe 'dynamic common configuration' do
130
136
  let(:provider_klass) {
131
137
  Class.new {
@@ -156,4 +162,28 @@ describe OmniAuth::Strategies::AzureOauth2 do
156
162
  end
157
163
  end
158
164
  end
159
- end
165
+
166
+ describe "raw_info" do
167
+ subject do
168
+ OmniAuth::Strategies::AzureOauth2.new(app, {client_id: 'id', client_secret: 'secret'})
169
+ end
170
+
171
+ let(:token) do
172
+ JWT.encode({"some" => "payload"}, "secret")
173
+ end
174
+
175
+ let(:access_token) do
176
+ double(:token => token)
177
+ end
178
+
179
+ before :each do
180
+ allow(subject).to receive(:access_token) { access_token }
181
+ end
182
+
183
+ it "does not clash if JWT strategy is used" do
184
+ expect do
185
+ subject.info
186
+ end.to_not raise_error
187
+ end
188
+ end
189
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-azure-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Nadig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth