omniauth-cronofy 0.10.0 → 0.14.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 +5 -5
- data/CHANGELOG.md +10 -0
- data/README.md +19 -1
- data/lib/omniauth-cronofy/version.rb +1 -1
- data/lib/omniauth/strategies/cronofy.rb +19 -4
- data/lib/omniauth/strategies/cronofy_base.rb +3 -1
- data/lib/omniauth/strategies/cronofy_service_account.rb +5 -2
- data/omniauth-cronofy.gemspec +3 -2
- metadata +31 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9a45cf338505b370434de749e7a7f79765384ca1ada75fd4916c6d6e3487d1bf
|
4
|
+
data.tar.gz: f18971e46e2cb89a08a0fa765e62ecf0c14d031016e43d6cd83a55f23a8ee932
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bd27e6c335773d273a516c93789dcada4ef8905c427cf12c9c641235d00c2529eabbac6b1408f209dfaf0f6272a27885eb9d942f4f0b883eb9f9659320c81cf
|
7
|
+
data.tar.gz: 7c707b2992990998a1ab21266a8392843e2ed8dbf576d62a06349503769510353ddbbd9d829f26bf3ab762fbff8ec83211bcb7006a31221104832675ab630d67
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
## [0.14.0]
|
2
|
+
|
3
|
+
* Add support for new data centers: 'au', 'ca', 'sg', and 'uk'
|
4
|
+
|
5
|
+
## [0.13.1]
|
6
|
+
|
7
|
+
* Loosen dependencies for OmniAuth 2.x
|
8
|
+
|
9
|
+
[0.13.1]: https://github.com/cronofy/omniauth-cronofy/releases/tag/v0.13.1
|
10
|
+
[0.14.0]: https://github.com/cronofy/omniauth-cronofy/releases/tag/v0.14.0
|
data/README.md
CHANGED
@@ -43,11 +43,26 @@ Then to auth with Cronofy you would navigate to `/auth/cronofy`.
|
|
43
43
|
|
44
44
|
#### Explicit Linking
|
45
45
|
|
46
|
-
Cronofy supports [explicit linking of calendar accounts](https://
|
46
|
+
Cronofy supports [explicit linking of calendar accounts](https://docs.cronofy.com/developers/api-alpha/explicit-linking/) by passing a `link_token` to the auth flow. This strategy supports that token be passed as a query string parameter to the auth redirect.
|
47
47
|
|
48
48
|
```
|
49
49
|
/auth/cronofy?link_token=hga672376....
|
50
50
|
```
|
51
|
+
#### Avoid Linking
|
52
|
+
|
53
|
+
Cronofy supports [to avoid profiles to be linked](https://docs.cronofy.com/developers/api/authorization/request-authorization/#avoid_linking) by passing an `avoid_linking` param with `true` value to the auth flow.
|
54
|
+
|
55
|
+
```
|
56
|
+
/auth/cronofy?avoid_linking=true
|
57
|
+
```
|
58
|
+
|
59
|
+
#### Provider Name
|
60
|
+
|
61
|
+
Cronofy allows the [pre-selection of a calendar provider](https://docs.cronofy.com/developers/api/authorization/request-authorization/#provider_name) in the auth flow using the `provider_name` param with one of the documented values.
|
62
|
+
|
63
|
+
```
|
64
|
+
/auth/cronofy?provider_name=office365
|
65
|
+
```
|
51
66
|
|
52
67
|
### Configuration
|
53
68
|
|
@@ -123,6 +138,7 @@ Configurable options
|
|
123
138
|
:provider => "cronofy_service_account",
|
124
139
|
:uid => "ser_382374827234",
|
125
140
|
:info => {
|
141
|
+
:common_name => "company.com",
|
126
142
|
:domain => "company.com"
|
127
143
|
},
|
128
144
|
:credentials => {
|
@@ -141,6 +157,8 @@ Configurable options
|
|
141
157
|
}
|
142
158
|
```
|
143
159
|
|
160
|
+
The `info` element may contain different elements, `domain` and/or `email` depending on the calendar service being integrated with. `common_name` is always returned.
|
161
|
+
|
144
162
|
## Contributing
|
145
163
|
|
146
164
|
1. Fork it ( https://github.com/[my-github-username]/omniauth-cronofy/fork )
|
@@ -1,6 +1,12 @@
|
|
1
1
|
module OmniAuth
|
2
2
|
module Strategies
|
3
3
|
class Cronofy < CronofyBase
|
4
|
+
WHITELISTED_AUTHORIZE_PARAMS = %w{
|
5
|
+
avoid_linking
|
6
|
+
link_token
|
7
|
+
provider_name
|
8
|
+
}
|
9
|
+
|
4
10
|
option :name, "cronofy"
|
5
11
|
|
6
12
|
uid { raw_info['account_id'] }
|
@@ -28,11 +34,20 @@ module OmniAuth
|
|
28
34
|
end
|
29
35
|
|
30
36
|
def request_phase
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
37
|
+
session_params = session['omniauth.params']
|
38
|
+
params = {}
|
39
|
+
|
40
|
+
WHITELISTED_AUTHORIZE_PARAMS.each do |param|
|
41
|
+
next unless session_params[param]
|
42
|
+
params[param] = session_params[param]
|
35
43
|
end
|
44
|
+
|
45
|
+
if options[:authorize_params]
|
46
|
+
options[:authorize_params].merge!(params)
|
47
|
+
else
|
48
|
+
options[:authorize_params] = params
|
49
|
+
end
|
50
|
+
|
36
51
|
super
|
37
52
|
end
|
38
53
|
end
|
@@ -15,9 +15,12 @@ module OmniAuth
|
|
15
15
|
uid { raw_info['sub'] }
|
16
16
|
|
17
17
|
info do
|
18
|
-
{
|
19
|
-
:
|
18
|
+
data = {
|
19
|
+
:common_name => raw_info['cronofy.service_account.domain'] || raw_info['cronofy.service_account.email']
|
20
20
|
}
|
21
|
+
data[:domain] = raw_info['cronofy.service_account.domain'] if raw_info['cronofy.service_account.domain']
|
22
|
+
data[:email] = raw_info['cronofy.service_account.email'] if raw_info['cronofy.service_account.email']
|
23
|
+
data
|
21
24
|
end
|
22
25
|
|
23
26
|
def callback_url
|
data/omniauth-cronofy.gemspec
CHANGED
@@ -19,8 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "omniauth", "
|
22
|
+
spec.add_dependency "omniauth", "> 1.2", "< 3"
|
23
23
|
spec.add_dependency "omniauth-oauth2", "~> 1.3"
|
24
|
-
spec.add_development_dependency "bundler", "
|
24
|
+
spec.add_development_dependency "bundler", "> 1.8"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "> 3"
|
26
27
|
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-cronofy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Bird
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.2'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">"
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '1.2'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: omniauth-oauth2
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,14 +48,14 @@ dependencies:
|
|
42
48
|
name: bundler
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
|
-
- - "
|
51
|
+
- - ">"
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '1.8'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
|
-
- - "
|
58
|
+
- - ">"
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '1.8'
|
55
61
|
- !ruby/object:Gem::Dependency
|
@@ -66,6 +72,20 @@ dependencies:
|
|
66
72
|
- - "~>"
|
67
73
|
- !ruby/object:Gem::Version
|
68
74
|
version: '10.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rspec
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '3'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '3'
|
69
89
|
description: OmniAuth strategy for authenticating with Cronofy
|
70
90
|
email:
|
71
91
|
- support@cronofy.com
|
@@ -77,6 +97,7 @@ files:
|
|
77
97
|
- ".gitignore"
|
78
98
|
- ".rspec"
|
79
99
|
- ".travis.yml"
|
100
|
+
- CHANGELOG.md
|
80
101
|
- CODE_OF_CONDUCT.md
|
81
102
|
- Gemfile
|
82
103
|
- LICENSE.txt
|
@@ -95,7 +116,7 @@ homepage: https://github.com/cronofy/omniauth-cronofy
|
|
95
116
|
licenses:
|
96
117
|
- MIT
|
97
118
|
metadata: {}
|
98
|
-
post_install_message:
|
119
|
+
post_install_message:
|
99
120
|
rdoc_options: []
|
100
121
|
require_paths:
|
101
122
|
- lib
|
@@ -110,9 +131,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
131
|
- !ruby/object:Gem::Version
|
111
132
|
version: '0'
|
112
133
|
requirements: []
|
113
|
-
|
114
|
-
|
115
|
-
signing_key:
|
134
|
+
rubygems_version: 3.2.16
|
135
|
+
signing_key:
|
116
136
|
specification_version: 4
|
117
137
|
summary: OmniAuth strategy for authenticating with Cronofy
|
118
138
|
test_files: []
|