nexaas_id-client 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 514641b029e1c683b93818a9ac35ce4ad01969d80d51ce50ef97023e35d0dff9
4
- data.tar.gz: dd10b848d5d02a3c8b44c3f7b050839847ad20049f229cdb299cd0bcbc40570c
3
+ metadata.gz: 4a241d61c3db5c4ed07191195912ad41845ec8012c63bcbdfb567da3226cc695
4
+ data.tar.gz: 473051b5379a742509649f1d789789bd3067f43a56be7e9cb9af277b0d8dd9f9
5
5
  SHA512:
6
- metadata.gz: bd58dcbaa0e7a23d512252be729ca3335bf9b54ed3592e122d2a5257317600bd884c5bb499c4215a6af8d72ea38dc9a923e7d5b969dacb9aea9cd46c0d232ba7
7
- data.tar.gz: 81b0e19df9ff7ceda3a0f95c413358abdac532f5cc40234e7ae8238376d696f8decd6a28e54d2b7200bbf9cdb07306201da24b29ad3da3ea6bddcb7bb6989f9a
6
+ metadata.gz: 79c11aff9ab0ad6f0a6f2e4f2a9f4c73e55fd89a17e7545e0efd3694791b544d91c22d97b06f18e0d2f2e2b66a93bacba37a79de2872de50c6cc6cf996939fcd
7
+ data.tar.gz: 7a13671c82a2bcbeaf1de0dc4996bdeb16949d7bf0a44e433ad350f66c72b15f85f810b4166bd338dee90a620fe9de6bc00b0908866e6ed5da51bc9c7b609ed6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nexaas_id-client (0.7.0)
4
+ nexaas_id-client (0.7.2)
5
5
  multi_json (~> 1.11)
6
6
  oauth2 (~> 1.4.0)
7
7
  virtus (~> 1.0)
@@ -20,9 +20,9 @@ GEM
20
20
  coderay (1.1.1)
21
21
  coercible (1.0.0)
22
22
  descendants_tracker (~> 0.0.1)
23
- coveralls (0.8.21)
23
+ coveralls (0.8.22)
24
24
  json (>= 1.8, < 3)
25
- simplecov (~> 0.14.1)
25
+ simplecov (~> 0.16.1)
26
26
  term-ansicolor (~> 1.3)
27
27
  thor (~> 0.19.4)
28
28
  tins (~> 1.6)
@@ -31,7 +31,7 @@ GEM
31
31
  descendants_tracker (0.0.4)
32
32
  thread_safe (~> 0.3, >= 0.3.1)
33
33
  diff-lcs (1.3)
34
- docile (1.1.5)
34
+ docile (1.3.1)
35
35
  domain_name (0.5.20180417)
36
36
  unf (>= 0.0.5, < 1.0.0)
37
37
  dotenv (2.5.0)
@@ -46,14 +46,14 @@ GEM
46
46
  domain_name (~> 0.5)
47
47
  ice_nine (0.11.2)
48
48
  json (2.1.0)
49
- jwt (2.1.0)
49
+ jwt (1.5.6)
50
50
  method_source (0.8.2)
51
51
  multi_json (1.13.1)
52
52
  multi_xml (0.6.0)
53
53
  multipart-post (2.0.0)
54
- oauth2 (1.4.1)
55
- faraday (>= 0.8, < 0.16.0)
56
- jwt (>= 1.0, < 3.0)
54
+ oauth2 (1.4.0)
55
+ faraday (>= 0.8, < 0.13)
56
+ jwt (~> 1.0)
57
57
  multi_json (~> 1.3)
58
58
  multi_xml (~> 0.5)
59
59
  rack (>= 1.2, < 3)
@@ -82,17 +82,17 @@ GEM
82
82
  rspec-support (~> 3.6.0)
83
83
  rspec-support (3.6.0)
84
84
  safe_yaml (1.0.4)
85
- simplecov (0.14.1)
86
- docile (~> 1.1.0)
85
+ simplecov (0.16.1)
86
+ docile (~> 1.1)
87
87
  json (>= 1.8, < 3)
88
88
  simplecov-html (~> 0.10.0)
89
- simplecov-html (0.10.1)
89
+ simplecov-html (0.10.2)
90
90
  slop (3.6.0)
91
91
  term-ansicolor (1.6.0)
92
92
  tins (~> 1.0)
93
93
  thor (0.19.4)
94
94
  thread_safe (0.3.6)
95
- tins (1.15.0)
95
+ tins (1.17.0)
96
96
  unf (0.1.4)
97
97
  unf_ext
98
98
  unf_ext (0.0.7.5)
@@ -113,7 +113,7 @@ PLATFORMS
113
113
  DEPENDENCIES
114
114
  awesome_print (~> 1.8)
115
115
  bundler (~> 1.9)
116
- coveralls (~> 0.8)
116
+ coveralls (~> 0.8.22)
117
117
  dotenv (~> 2.5.0)
118
118
  faraday-cookie_jar (~> 0.0.6)
119
119
  json (~> 2.1)
@@ -122,7 +122,7 @@ DEPENDENCIES
122
122
  rake (~> 12.0)
123
123
  rdoc (~> 6.0)
124
124
  rspec (~> 3.6)
125
- simplecov (~> 0.14)
125
+ simplecov (~> 0.16)
126
126
  vcr (~> 2.4)
127
127
  webmock (~> 3.4)
128
128
 
@@ -1,3 +1,5 @@
1
+ require 'addressable/uri'
2
+
1
3
  # A wrapper to Nexaas ID's widget API
2
4
  #
3
5
  # [API]
@@ -21,8 +23,23 @@ class NexaasID::Resources::Widget < NexaasID::Resources::Base
21
23
  # Documentation:
22
24
  #
23
25
  # @return [String] user's navbar URL
24
- def navbar_url
25
- %(#{configuration.url}/api/v1/widgets/navbar?access_token=#{api.token})
26
+ def navbar_url(redirect_uri = nil)
27
+ access_token = api.token
28
+ querystring =
29
+ if access_token
30
+ { access_token: access_token }
31
+ elsif redirect_uri
32
+ {
33
+ client_id: configuration.application_token,
34
+ redirect_uri: redirect_uri
35
+ }
36
+ else
37
+ nil
38
+ end
39
+ uri = Addressable::URI.parse(configuration.url)
40
+ uri.path = '/api/v1/widgets/navbar'
41
+ uri.query_values = querystring
42
+ uri.to_s
26
43
  end
27
44
 
28
45
  # Retrieves the user's widget URL
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module NexaasID
3
- VERSION = "0.7.1".freeze
3
+ VERSION = "0.7.2".freeze
4
4
  end
@@ -35,8 +35,8 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'webmock', '~> 3.4'
36
36
  spec.add_development_dependency "pry-byebug", "~> 3.4"
37
37
  spec.add_development_dependency "awesome_print", "~> 1.8"
38
- spec.add_development_dependency "simplecov", "~> 0.14"
39
- spec.add_development_dependency "coveralls", "~> 0.8"
38
+ spec.add_development_dependency "simplecov", "~> 0.16"
39
+ spec.add_development_dependency "coveralls", "~> 0.8.22"
40
40
  spec.add_development_dependency "json", "~> 2.1"
41
41
  spec.add_development_dependency "faraday-cookie_jar", "~> 0.0.6"
42
42
  spec.add_development_dependency "dotenv", "~> 2.5.0"
@@ -10,7 +10,7 @@ describe NexaasID::Resources::Widget do
10
10
  let(:configuration) { default_configuration }
11
11
  let(:resource) { client.widget }
12
12
 
13
- describe "#navbar_url" do
13
+ describe '#navbar_url' do
14
14
  subject { resource.navbar_url }
15
15
  let(:regexp) { %r(#{Regexp.quote(configuration.url)}/api/v1/widgets/navbar\?access_token=(.+?)$) }
16
16
 
@@ -22,7 +22,7 @@ describe NexaasID::Resources::Widget do
22
22
  end
23
23
  end
24
24
 
25
- describe "widget_url" do
25
+ describe '#widget_url' do
26
26
  subject { resource.widget_url }
27
27
  let(:regexp) { %r(#{Regexp.quote(configuration.url)}/api/v1/widgets/user.js\?access_token=(.+?)&callback=initWidget$) }
28
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexaas_id-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Tassinari de Oliveira
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-10-31 00:00:00.000000000 Z
14
+ date: 2018-11-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: multi_json
@@ -173,28 +173,28 @@ dependencies:
173
173
  requirements:
174
174
  - - "~>"
175
175
  - !ruby/object:Gem::Version
176
- version: '0.14'
176
+ version: '0.16'
177
177
  type: :development
178
178
  prerelease: false
179
179
  version_requirements: !ruby/object:Gem::Requirement
180
180
  requirements:
181
181
  - - "~>"
182
182
  - !ruby/object:Gem::Version
183
- version: '0.14'
183
+ version: '0.16'
184
184
  - !ruby/object:Gem::Dependency
185
185
  name: coveralls
186
186
  requirement: !ruby/object:Gem::Requirement
187
187
  requirements:
188
188
  - - "~>"
189
189
  - !ruby/object:Gem::Version
190
- version: '0.8'
190
+ version: 0.8.22
191
191
  type: :development
192
192
  prerelease: false
193
193
  version_requirements: !ruby/object:Gem::Requirement
194
194
  requirements:
195
195
  - - "~>"
196
196
  - !ruby/object:Gem::Version
197
- version: '0.8'
197
+ version: 0.8.22
198
198
  - !ruby/object:Gem::Dependency
199
199
  name: json
200
200
  requirement: !ruby/object:Gem::Requirement