omniauth-drchrono-oauth2 1.1.0 → 1.2.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b62c977ba1571c2f878f0d50c56fcb59e727e70
|
4
|
+
data.tar.gz: d66b8d32a744334828269b7a334be822b95785a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4096d42c7fc3e0e66cb8726d2dadf1036e2b1bbac119d1a60df53f9083875cbb73306063de10418ee30ad8644b10545f44782be9728aced9de3a3363c5d69166
|
7
|
+
data.tar.gz: c9acc00d9934b4a9362eada0d8c66d8aa32b9ce211ff109500a54ce6c50397e6bcc52fed6c591a4fa62aeb0835e1fcc47bc847431cc0bf470067da04147a4c61
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# OmniAuth DrChrono OAuth2 Strategy
|
2
2
|
|
3
3
|
[](https://travis-ci.org/bartimaeus/omniauth-drchrono-oauth2)
|
4
|
+
[](https://badge.fury.io/rb/omniauth-drchrono-oauth2)
|
4
5
|
|
5
6
|
A DrChrono OAuth2 strategy for OmniAuth.
|
6
7
|
|
@@ -30,7 +31,7 @@ This is an example that you might put into a Rails initializer at `config/initia
|
|
30
31
|
|
31
32
|
```ruby
|
32
33
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
33
|
-
provider :drchrono, ENV['DRCHRONO_CLIENT_ID'], ENV['DRCHRONO_CLIENT_SECRET'], :scope => '
|
34
|
+
provider :drchrono, ENV['DRCHRONO_CLIENT_ID'], ENV['DRCHRONO_CLIENT_SECRET'], :scope => 'patients:read settings:read user:read'
|
34
35
|
end
|
35
36
|
```
|
36
37
|
|
@@ -44,7 +45,7 @@ For more details, read the DrChrono documentation: https://www.drchrono.com/api/
|
|
44
45
|
You can configure the scope option:
|
45
46
|
|
46
47
|
```ruby
|
47
|
-
provider :drchrono, ENV['DRCHRONO_CLIENT_ID'], ENV['DRCHRONO_CLIENT_SECRET'], :scope => 'user:read'
|
48
|
+
provider :drchrono, ENV['DRCHRONO_CLIENT_ID'], ENV['DRCHRONO_CLIENT_SECRET'], :scope => 'settings:read user:read'
|
48
49
|
```
|
49
50
|
|
50
51
|
## Contributing
|
@@ -11,7 +11,7 @@ module OmniAuth
|
|
11
11
|
:token_url => 'https://drchrono.com/o/token/'
|
12
12
|
}
|
13
13
|
|
14
|
-
option :scope, 'user:read'
|
14
|
+
option :scope, 'settings:read user:read'
|
15
15
|
|
16
16
|
uid do
|
17
17
|
raw_info['id']
|
@@ -59,15 +59,15 @@ module OmniAuth
|
|
59
59
|
private
|
60
60
|
|
61
61
|
def profile_endpoint
|
62
|
-
'
|
62
|
+
'users/current'
|
63
63
|
end
|
64
64
|
|
65
65
|
def doctors_endpoint
|
66
|
-
"
|
66
|
+
"doctors/#{raw_info['doctor']}"
|
67
67
|
end
|
68
68
|
|
69
69
|
def offices_endpoint
|
70
|
-
'
|
70
|
+
'offices'
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
@@ -43,9 +43,9 @@ describe OmniAuth::Strategies::DrChrono do
|
|
43
43
|
|
44
44
|
let(:parsed_response) { Hash['doctor' => 14234, 'id' => 43456, 'is_doctor' => true, 'is_staff' => false, 'practice_group' => 8765544, 'username' => 'drchrono'] }
|
45
45
|
|
46
|
-
let(:doctors_endpoint) { "
|
47
|
-
let(:offices_endpoint) { '
|
48
|
-
let(:profile_endpoint) { '
|
46
|
+
let(:doctors_endpoint) { "doctors/14234" }
|
47
|
+
let(:offices_endpoint) { 'offices' }
|
48
|
+
let(:profile_endpoint) { 'users/current' }
|
49
49
|
|
50
50
|
let(:doctors_response) { instance_double OAuth2::Response, parsed: parsed_response }
|
51
51
|
let(:offices_response) { instance_double OAuth2::Response, parsed: parsed_response }
|
@@ -115,7 +115,7 @@ describe OmniAuth::Strategies::DrChrono do
|
|
115
115
|
end
|
116
116
|
|
117
117
|
it 'sets default scope' do
|
118
|
-
expect(subject.authorize_params['scope']).to eq('user:read')
|
118
|
+
expect(subject.authorize_params['scope']).to eq('settings:read user:read')
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|