omniauth-teamsnap 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -0
- data/lib/omniauth-teamsnap/version.rb +1 -1
- data/lib/omniauth/strategies/teamsnap.rb +11 -7
- data/omniauth-teamsnap.gemspec +2 -3
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 540222c492e87a75c182d19da9c20381ed6e3e42
|
4
|
+
data.tar.gz: 897951250e344e8e184fe662bfdb45fb9424d490
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6aa2b1c59e2531735ce8d96ef18021bcd2d9deff98b8e4eea70ce8544e2e838a53c7848756646269f869c05dfceb4576e45257e6632544947e89e7718f361ca
|
7
|
+
data.tar.gz: 668000b20b4c305d9410a3e7876971ef1d4b8b0b90348b54bef6d01da47b9131ae1141e6ed04a356c77fd27f3496071ba5a3ee29d69105f3cad0d5fada3ea4c3
|
data/README.md
CHANGED
@@ -18,3 +18,21 @@ TeamSnap API v3 lets you set scopes to provide granular access to different type
|
|
18
18
|
provider :teamsnap, ENV['TEAMSNAP_KEY'], ENV['TEAMSNAP_SECRET'], scope: "read write"
|
19
19
|
end
|
20
20
|
|
21
|
+
## Authentication Hash
|
22
|
+
An example auth hash available in `request.env['omniauth.auth']`:
|
23
|
+
|
24
|
+
```
|
25
|
+
{
|
26
|
+
:provider => "teamsnap",
|
27
|
+
:uid => "123456",
|
28
|
+
:info => {
|
29
|
+
:email => "player@example.com",
|
30
|
+
:first_name => "John",
|
31
|
+
:last_name => "Player",
|
32
|
+
},
|
33
|
+
:credentials => {
|
34
|
+
:token => "a1b2c3d4...", # The OAuth 2.0 access token
|
35
|
+
},
|
36
|
+
:extra = {}
|
37
|
+
}
|
38
|
+
```
|
@@ -12,13 +12,13 @@ module OmniAuth
|
|
12
12
|
:token_method => :post
|
13
13
|
}
|
14
14
|
|
15
|
-
uid {
|
15
|
+
uid { parse_datum("id") }
|
16
16
|
|
17
17
|
info do
|
18
18
|
{
|
19
|
-
:email =>
|
20
|
-
:first_name =>
|
21
|
-
:last_name =>
|
19
|
+
:email => parse_datum("email"),
|
20
|
+
:first_name => parse_datum("first_name"),
|
21
|
+
:last_name => parse_datum("last_name")
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
@@ -32,12 +32,16 @@ module OmniAuth
|
|
32
32
|
req.url "https://api.teamsnap.com/v3/me"
|
33
33
|
req.headers["Authorization"] = "Bearer #{access_token.token}"
|
34
34
|
end
|
35
|
-
|
36
|
-
collection_json = deserializer.deserialize
|
35
|
+
collection_json = JSON.parse(response.body)
|
37
36
|
|
38
|
-
@raw_info = collection_json
|
37
|
+
@raw_info = collection_json["collection"]["items"].first.fetch("data")
|
39
38
|
end
|
40
39
|
|
40
|
+
private
|
41
|
+
|
42
|
+
def parse_datum(property)
|
43
|
+
raw_info.find { |d| d["name"] == property }.fetch("value")
|
44
|
+
end
|
41
45
|
end
|
42
46
|
end
|
43
47
|
end
|
data/omniauth-teamsnap.gemspec
CHANGED
@@ -18,9 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_dependency "omniauth", "~> 1.2"
|
21
|
-
spec.add_dependency "omniauth-oauth2", "~> 1.
|
22
|
-
spec.add_dependency "faraday", "~> 0.9"
|
23
|
-
spec.add_dependency "conglomerate", "~> 0.15"
|
21
|
+
spec.add_dependency "omniauth-oauth2", "~> 1.3.1"
|
22
|
+
spec.add_dependency "faraday", "~> 0.9.2"
|
24
23
|
spec.add_development_dependency "rspec", "~> 2.7"
|
25
24
|
spec.add_development_dependency "rack-test"
|
26
25
|
spec.add_development_dependency "simplecov"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-teamsnap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -30,42 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.3.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.3.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: faraday
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0.9'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: conglomerate
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0.15'
|
47
|
+
version: 0.9.2
|
62
48
|
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
54
|
+
version: 0.9.2
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rspec
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
147
|
version: '0'
|
162
148
|
requirements: []
|
163
149
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
150
|
+
rubygems_version: 2.4.5
|
165
151
|
signing_key:
|
166
152
|
specification_version: 4
|
167
153
|
summary: Official OmniAuth strategy for TeamSnap
|