stbaldricks 4.4.1 → 4.4.2

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
  SHA256:
3
- metadata.gz: a5126746d2d611c95999adb4a1a75fe31c6e42e17fdab79645c7c9b9a8ac134c
4
- data.tar.gz: ce086a2142ef315cbef28061e3016c315b94cfbddc0925fc88fd2e231706859f
3
+ metadata.gz: 88e42571a9d14e3c093bc52c4757d2d823132804356c05205db863f09a65fbfb
4
+ data.tar.gz: c67c34e5a0bbdff8e82bf8e37214c1fbc65e98238866137782f122d941b221d2
5
5
  SHA512:
6
- metadata.gz: bc0919d82fcf1e63acbfd7fafeaec9240eb8863dc0a4d863c25b6ac02f051d5da229574811c99bc893171d408863c0a6b1959e32a202b70f979ab0fba61e0a3e
7
- data.tar.gz: d4be75043ebb203503d05dc73bfb610d82a4286ecfef2988f735683e25e1e5fb0aa0cfb2d01910b3a68c35d0d6664cda8ad3cb08c43d689cc1863220125caf30
6
+ metadata.gz: 070e7c78e8b9c337e9a816a4c3a9e6c2914d8780162087a08b06d452019bdc252488cb6e777d6f02d49f44ba35ca4ad8b8108ba955f0c67cbcde83eb6dddb66d
7
+ data.tar.gz: a6c10017859910e0418a0f52e6df710aec6e37972f7c782c526cc559c5d0c844a1210612303f8e4d185b864e41d9fe5b54e97d7d748e07fff4d95e945964e69a
@@ -0,0 +1,37 @@
1
+ require 'stbaldricks/endpoints/user'
2
+
3
+ module SBF
4
+ module Client
5
+ module Facebook
6
+ class UserEndpoint < SBF::Client::UserEndpoint
7
+ # Logs in a user, using a Facebook Oauth authorization code & redirect uri.
8
+ # Configures the client library to use user credentials for subsequent requests.
9
+ # Returns the SBF access token for the user that should be held onto to configure the client library in
10
+ # future requests that are outside of this scope.
11
+ #
12
+ # @param authorization_code [string]
13
+ # @param redirect_uri [string]
14
+ # @return [string]
15
+ def login!(authorization_code, redirect_uri)
16
+ response = SBF::Client::Api::Request.post_request(
17
+ "/#{SBF::Client::Api::VERSION}/security/facebook/login",
18
+ authorization_code: authorization_code,
19
+ redirect_uri: redirect_uri
20
+ )
21
+ parsed_response = JSON.parse(response.body).symbolize!
22
+
23
+ if ok?(response)
24
+ SBF::Client::Configuration.user_token = parsed_response[:token]
25
+ data = parsed_response.merge(user: target_class.new(parsed_response[:user]))
26
+ SBF::Client::LOG.info { "SBF::Client - Facebook User Login with Identifier: #{parsed_response[:user][:identifier]}" }
27
+ else
28
+ SBF::Client::Configuration.user_token = nil
29
+ error = SBF::Client::ErrorEntity.new(parsed_response)
30
+ end
31
+
32
+ SBF::Client::Api::Response.new(http_code: response.code, data: data, error: error)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -67,13 +67,11 @@ module SBF
67
67
  password: password
68
68
  )
69
69
 
70
- if ok?(response)
71
- SBF::Client::Configuration.user_token = nil
72
- else
73
- SBF::Client::Configuration.user_token = nil
70
+ unless ok?(response)
74
71
  parsed_response = JSON.parse(response.body).symbolize!
75
72
  error = SBF::Client::ErrorEntity.new(parsed_response)
76
73
  end
74
+ SBF::Client::Configuration.user_token = nil
77
75
 
78
76
  SBF::Client::LOG.info { "SB::Client - Change Password for user with profile_id: #{profile_id}" }
79
77
  SBF::Client::Api::Response.new(http_code: response.code, data: nil, error: error)
@@ -0,0 +1,12 @@
1
+ require 'stbaldricks/entities/user'
2
+ require 'stbaldricks/endpoints/facebook/user'
3
+
4
+ module SBF
5
+ module Client
6
+ module Facebook
7
+ class User < SBF::Client::User
8
+ endpoint SBF::Client::Facebook::UserEndpoint
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module SBF
2
2
  module Client
3
- VERSION = '4.4.1'
3
+ VERSION = '4.4.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stbaldricks
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.1
4
+ version: 4.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-09 00:00:00.000000000 Z
11
+ date: 2018-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -85,6 +85,7 @@ files:
85
85
  - lib/stbaldricks/endpoints/contact.rb
86
86
  - lib/stbaldricks/endpoints/event.rb
87
87
  - lib/stbaldricks/endpoints/event_application.rb
88
+ - lib/stbaldricks/endpoints/facebook/user.rb
88
89
  - lib/stbaldricks/endpoints/fund.rb
89
90
  - lib/stbaldricks/endpoints/kid.rb
90
91
  - lib/stbaldricks/endpoints/kid_honor.rb
@@ -138,6 +139,7 @@ files:
138
139
  - lib/stbaldricks/entities/event_donation_summary.rb
139
140
  - lib/stbaldricks/entities/event_participant_summary.rb
140
141
  - lib/stbaldricks/entities/event_supporter.rb
142
+ - lib/stbaldricks/entities/facebook/user.rb
141
143
  - lib/stbaldricks/entities/fund.rb
142
144
  - lib/stbaldricks/entities/fundraiser.rb
143
145
  - lib/stbaldricks/entities/grant.rb
@@ -221,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
223
  version: '0'
222
224
  requirements: []
223
225
  rubyforge_project:
224
- rubygems_version: 2.7.3
226
+ rubygems_version: 2.7.4
225
227
  signing_key:
226
228
  specification_version: 4
227
229
  summary: St. Baldrick's Foundation Ruby Client Library