authlete 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MWQ5NzIxMWQ5MWRkMGRhNzFkZmYxYTZmZGUzMzEwOWQzN2Q3NTkwOA==
5
+ data.tar.gz: !binary |-
6
+ MDhlZWMzMzQ3MjJlNzlhZDY0Nzc4N2ZiYTViZGRhNzI2ZjM2MTM0Ng==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NmI4MDA4NDhkZWVkODk1ODMxZDMzNGM2YjVlODlkNDU2YTIzNWVmYWUyYzZm
10
+ ZTAwY2E1ZTA0YzAzZGM1NzQ1YzYzZTZiODcyMGYxYzM5MmJlMTgzYWJhMDVj
11
+ MWFlOWE4NDBlNDg1YmM5OGFmZjRlNDkzNzBiZjRlYjY5NzFmMWQ=
12
+ data.tar.gz: !binary |-
13
+ YjM2MWI4OTYyYWFjY2Y2OTI5MDU2OWQyNTAwYWVkYzVhMzdhZjkzZjRhYzhi
14
+ YzE1ZGQzZTJkMmZjYWU4MzQ0MDJkNmNmYzJhNjExNWIzNTJmY2NiZDY4Yzhh
15
+ OGUzNzZiMDgzY2I2MjEwZTNlMWE1ODcyZTEwNDBkZjU1ZDJhNmI=
@@ -44,17 +44,40 @@ module Authlete
44
44
 
45
45
  # Names of requested claim locales (string array). The values come
46
46
  # from 'claims_locales' request parameter of an authorization request.
47
- attr_accessor :claimsLocales
47
+ attr_accessor :claims_locales
48
+
49
+ # The SNS which the end-user used for social login.
50
+ # For example, 'FACEBOOK'.
51
+ attr_accessor :sns
52
+
53
+ # The access token issued at the token endpoint of the SNS.
54
+ attr_accessor :access_token
55
+
56
+ # The refresh token issued along with the access token.
57
+ attr_accessor :refresh_token
58
+
59
+ # The duration of the access token.
60
+ attr_accessor :expires_in
61
+
62
+ # The raw content of the response from the token endpoint of the SNS.
63
+ # Correct OAuth 2.0 implementations return 'application/json', but Facebook
64
+ # returns 'application/x-www-form-url-encoded'.
65
+ attr_accessor :raw_token_response
48
66
 
49
67
  # The constructor which takes a hash that represents a JSON request
50
68
  # to an authentication callback endpoint.
51
69
  def initialize(hash = {})
52
- @service_api_key = extract_value(hash, :serviceApiKey)
53
- @client_id = extract_value(hash, :clientId)
54
- @id = extract_value(hash, :id)
55
- @password = extract_value(hash, :password)
56
- @claims = extract_value(hash, :claims)
57
- @claimsLocales = extract_value(hash, :claimsLocales)
70
+ @service_api_key = extract_value(hash, :serviceApiKey)
71
+ @client_id = extract_value(hash, :clientId)
72
+ @id = extract_value(hash, :id)
73
+ @password = extract_value(hash, :password)
74
+ @claims = extract_value(hash, :claims)
75
+ @claims_locales = extract_value(hash, :claimsLocales)
76
+ @sns = extract_value(hash, :sns)
77
+ @access_token = extract_value(hash, :accessToken)
78
+ @refresh_token = extract_value(hash, :refreshToken)
79
+ @expires_in = extract_integer_value(hash, :expiresIn)
80
+ @raw_token_response = extract_value(hash, :rawTokenResponse)
58
81
  end
59
82
 
60
83
  # Parse a JSON string which represents a request to an authentication
@@ -31,6 +31,10 @@ module Authlete
31
31
  return (value == true || value == 'true')
32
32
  end
33
33
 
34
+ def extract_integer_value(hash, key)
35
+ extract_value(hash, key).to_i
36
+ end
37
+
34
38
  # Extract an access token (RFC 6750)
35
39
  def extract_access_token(request)
36
40
  header = request.env['HTTP_AUTHORIZATION']
@@ -1,3 +1,3 @@
1
1
  module Authlete
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authlete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
5
- prerelease:
4
+ version: 0.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Takahiko Kawasaki
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-11-23 00:00:00.000000000 Z
11
+ date: 2014-12-07 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rest-client
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -86,26 +79,25 @@ files:
86
79
  homepage: https://www.authlete.com/
87
80
  licenses:
88
81
  - Apache License, Version 2.0
82
+ metadata: {}
89
83
  post_install_message:
90
84
  rdoc_options: []
91
85
  require_paths:
92
86
  - lib
93
87
  required_ruby_version: !ruby/object:Gem::Requirement
94
- none: false
95
88
  requirements:
96
89
  - - ! '>='
97
90
  - !ruby/object:Gem::Version
98
91
  version: '0'
99
92
  required_rubygems_version: !ruby/object:Gem::Requirement
100
- none: false
101
93
  requirements:
102
94
  - - ! '>='
103
95
  - !ruby/object:Gem::Version
104
96
  version: '0'
105
97
  requirements: []
106
98
  rubyforge_project:
107
- rubygems_version: 1.8.28
99
+ rubygems_version: 2.4.5
108
100
  signing_key:
109
- specification_version: 3
101
+ specification_version: 4
110
102
  summary: A library for Authlete Web APIs
111
103
  test_files: []