strongmind-platform-sdk 2.13.0 → 2.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 +4 -4
- data/Gemfile.lock +37 -32
- data/README.md +1 -1
- data/docs/identity_installation_in_rails.md +20 -7
- data/lib/generators/templates/omniauth_callbacks_controller.rb +3 -2
- data/lib/generators/templates/strong_mind_auto_login.html.erb +3 -1
- data/lib/generators/templates/strong_mind_auto_login.signed_in.html.erb +8 -3
- data/lib/generators/templates/strong_mind_auto_login_controller.rb +2 -0
- data/lib/platform_sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87d70927837c73835df85dd3ddee8f2d40cf061989154a81eccfff4b975180f8
|
4
|
+
data.tar.gz: e3ec2b74e8f71acbb39bc9f589a332ac88cf795a84c949d7187fd67c47b8c8e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb9b8528dd9893c93c37ca362e1042490a5a95b7ce8175525b72921bd30038af8effe31294392f5f5ff6b535737c1d77e6fa32ba343a3f074e19a6d9298d08ae
|
7
|
+
data.tar.gz: 356109449dfb2c4b22b6f3ed8ed369776b15a64b6998eb471ec9411a32ad1bd2e7569ecc18b69705778f8f5efcd051e043c0cd6448034d45f632f96bc67e2f6a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strongmind-platform-sdk (2.
|
4
|
+
strongmind-platform-sdk (2.14.0)
|
5
5
|
aws-sdk-secretsmanager (~> 1.66)
|
6
6
|
devise
|
7
7
|
faraday (~> 2.5, >= 2.5.2)
|
@@ -38,14 +38,14 @@ GEM
|
|
38
38
|
ast (2.4.2)
|
39
39
|
attr_required (1.0.1)
|
40
40
|
aws-eventstream (1.2.0)
|
41
|
-
aws-partitions (1.
|
42
|
-
aws-sdk-core (3.
|
41
|
+
aws-partitions (1.772.0)
|
42
|
+
aws-sdk-core (3.174.0)
|
43
43
|
aws-eventstream (~> 1, >= 1.0.2)
|
44
44
|
aws-partitions (~> 1, >= 1.651.0)
|
45
45
|
aws-sigv4 (~> 1.5)
|
46
46
|
jmespath (~> 1, >= 1.6.1)
|
47
|
-
aws-sdk-secretsmanager (1.
|
48
|
-
aws-sdk-core (~> 3, >= 3.
|
47
|
+
aws-sdk-secretsmanager (1.76.0)
|
48
|
+
aws-sdk-core (~> 3, >= 3.174.0)
|
49
49
|
aws-sigv4 (~> 1.1)
|
50
50
|
aws-sigv4 (1.5.2)
|
51
51
|
aws-eventstream (~> 1, >= 1.0.2)
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
activesupport (>= 5.0.0)
|
70
70
|
faker (2.23.0)
|
71
71
|
i18n (>= 1.8.11, < 2)
|
72
|
-
faraday (2.7.
|
72
|
+
faraday (2.7.5)
|
73
73
|
faraday-net_http (>= 2.0, < 3.1)
|
74
74
|
ruby2_keywords (>= 0.0.4)
|
75
75
|
faraday-follow_redirects (0.3.0)
|
@@ -77,7 +77,6 @@ GEM
|
|
77
77
|
faraday-net_http (3.0.2)
|
78
78
|
ffi (1.15.5)
|
79
79
|
hashie (5.0.0)
|
80
|
-
httpclient (2.8.3)
|
81
80
|
i18n (1.12.0)
|
82
81
|
concurrent-ruby (~> 1.0)
|
83
82
|
jmespath (1.6.2)
|
@@ -89,9 +88,9 @@ GEM
|
|
89
88
|
faraday (~> 2.0)
|
90
89
|
faraday-follow_redirects
|
91
90
|
jwt (1.5.6)
|
92
|
-
loofah (2.
|
91
|
+
loofah (2.21.3)
|
93
92
|
crass (~> 1.0.2)
|
94
|
-
nokogiri (>= 1.
|
93
|
+
nokogiri (>= 1.12.0)
|
95
94
|
mail (2.8.1)
|
96
95
|
mini_mime (>= 0.1.1)
|
97
96
|
net-imap
|
@@ -99,7 +98,7 @@ GEM
|
|
99
98
|
net-smtp
|
100
99
|
method_source (1.0.0)
|
101
100
|
mini_mime (1.1.2)
|
102
|
-
mini_portile2 (2.8.
|
101
|
+
mini_portile2 (2.8.2)
|
103
102
|
minitest (5.16.3)
|
104
103
|
net-imap (0.3.4)
|
105
104
|
date
|
@@ -110,12 +109,12 @@ GEM
|
|
110
109
|
timeout
|
111
110
|
net-smtp (0.3.3)
|
112
111
|
net-protocol
|
113
|
-
nokogiri (1.
|
114
|
-
mini_portile2 (~> 2.8.
|
112
|
+
nokogiri (1.15.2)
|
113
|
+
mini_portile2 (~> 2.8.2)
|
115
114
|
racc (~> 1.4)
|
116
|
-
nokogiri (1.
|
115
|
+
nokogiri (1.15.2-x86_64-darwin)
|
117
116
|
racc (~> 1.4)
|
118
|
-
nokogiri (1.
|
117
|
+
nokogiri (1.15.2-x86_64-linux)
|
119
118
|
racc (~> 1.4)
|
120
119
|
omniauth (2.1.1)
|
121
120
|
hashie (>= 3.4.6)
|
@@ -124,31 +123,34 @@ GEM
|
|
124
123
|
omniauth-rails_csrf_protection (1.0.1)
|
125
124
|
actionpack (>= 4.2)
|
126
125
|
omniauth (~> 2.0)
|
127
|
-
omniauth_openid_connect (0.
|
126
|
+
omniauth_openid_connect (0.7.1)
|
128
127
|
omniauth (>= 1.9, < 3)
|
129
|
-
openid_connect (~>
|
130
|
-
openid_connect (
|
128
|
+
openid_connect (~> 2.2)
|
129
|
+
openid_connect (2.2.0)
|
131
130
|
activemodel
|
132
131
|
attr_required (>= 1.0.0)
|
133
|
-
|
132
|
+
faraday (~> 2.0)
|
133
|
+
faraday-follow_redirects
|
134
|
+
json-jwt (>= 1.16)
|
134
135
|
net-smtp
|
135
|
-
rack-oauth2 (~>
|
136
|
-
swd (~>
|
136
|
+
rack-oauth2 (~> 2.2)
|
137
|
+
swd (~> 2.0)
|
137
138
|
tzinfo
|
138
139
|
validate_email
|
139
140
|
validate_url
|
140
|
-
webfinger (~>
|
141
|
+
webfinger (~> 2.0)
|
141
142
|
orm_adapter (0.5.0)
|
142
143
|
parallel (1.22.1)
|
143
144
|
parser (3.1.2.1)
|
144
145
|
ast (~> 2.4.1)
|
145
146
|
public_suffix (5.0.1)
|
146
147
|
racc (1.6.2)
|
147
|
-
rack (2.2.
|
148
|
-
rack-oauth2 (
|
148
|
+
rack (2.2.7)
|
149
|
+
rack-oauth2 (2.2.0)
|
149
150
|
activesupport
|
150
151
|
attr_required
|
151
|
-
|
152
|
+
faraday (~> 2.0)
|
153
|
+
faraday-follow_redirects
|
152
154
|
json-jwt (>= 1.11.0)
|
153
155
|
rack (>= 2.1.0)
|
154
156
|
rack-protection (3.0.6)
|
@@ -158,8 +160,9 @@ GEM
|
|
158
160
|
rails-dom-testing (2.0.3)
|
159
161
|
activesupport (>= 4.2.0)
|
160
162
|
nokogiri (>= 1.6)
|
161
|
-
rails-html-sanitizer (1.
|
162
|
-
loofah (~> 2.
|
163
|
+
rails-html-sanitizer (1.6.0)
|
164
|
+
loofah (~> 2.21)
|
165
|
+
nokogiri (~> 1.14)
|
163
166
|
railties (7.0.4)
|
164
167
|
actionpack (= 7.0.4)
|
165
168
|
activesupport (= 7.0.4)
|
@@ -204,11 +207,12 @@ GEM
|
|
204
207
|
strongmind-oneroster-client (2.0.3)
|
205
208
|
json (~> 2.1, >= 2.1.0)
|
206
209
|
typhoeus (~> 1.0, >= 1.0.1)
|
207
|
-
swd (
|
210
|
+
swd (2.0.2)
|
208
211
|
activesupport (>= 3)
|
209
212
|
attr_required (>= 0.0.5)
|
210
|
-
|
211
|
-
|
213
|
+
faraday (~> 2.0)
|
214
|
+
faraday-follow_redirects
|
215
|
+
thor (1.2.2)
|
212
216
|
timeout (0.3.2)
|
213
217
|
typhoeus (1.4.0)
|
214
218
|
ethon (>= 0.9.0)
|
@@ -224,10 +228,11 @@ GEM
|
|
224
228
|
public_suffix
|
225
229
|
warden (1.2.9)
|
226
230
|
rack (>= 2.0.9)
|
227
|
-
webfinger (1.2
|
231
|
+
webfinger (2.1.2)
|
228
232
|
activesupport
|
229
|
-
|
230
|
-
|
233
|
+
faraday (~> 2.0)
|
234
|
+
faraday-follow_redirects
|
235
|
+
zeitwerk (2.6.8)
|
231
236
|
|
232
237
|
PLATFORMS
|
233
238
|
ruby
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ First [configure your GitHub credentials](#configure-github-credentials)
|
|
11
11
|
Install the gem and add to the application's Gemfile by executing:
|
12
12
|
|
13
13
|
```
|
14
|
-
gem "strongmind-platform-sdk", "~> 2.
|
14
|
+
gem "strongmind-platform-sdk", "~> 2.13.1"
|
15
15
|
```
|
16
16
|
|
17
17
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
@@ -12,19 +12,32 @@
|
|
12
12
|
|
13
13
|
1. Run the generator: `rails g strong_mind_rails_identity:install`
|
14
14
|
|
15
|
-
1.
|
15
|
+
1. Remove the first devise line with the default devise plugins from `app/models/user.rb`. You should end up with the only devise line being the following:
|
16
|
+
```ruby
|
17
|
+
devise :omniauthable, omniauth_providers: [:strongmind]
|
18
|
+
```
|
16
19
|
|
17
20
|
1. Create a client in the Identity Server and add the following to the .env file:
|
18
21
|
```
|
19
22
|
IDENTITY_CLIENT_ID=
|
20
23
|
IDENTITY_CLIENT_SECRET=
|
21
24
|
```
|
25
|
+
1. For local development, run this to enable caching:
|
26
|
+
```
|
27
|
+
rails dev:cache
|
28
|
+
```
|
29
|
+
This will create a file `tmp/caching-dev.txt` that you can delete to disable caching.
|
30
|
+
1. If you want user sessions to persist across restarts of your server in dev, and you aren't using redis in dev, add this to `config/environments/development.rb` (instead of `:memory_store`):
|
31
|
+
```
|
32
|
+
config.cache_store = :file_store, "#{Rails.root}/tmp/cache/"
|
33
|
+
```
|
22
34
|
|
23
|
-
1.
|
35
|
+
1. Do you want all pages to require authentication?
|
36
|
+
- If yes, add this to `app/controllers/application_controller.rb` right under the class declaration:
|
37
|
+
```ruby
|
38
|
+
before_action :authenticate_user!
|
39
|
+
```
|
40
|
+
- If no, remove line 2 of `app/controllers/strong_mind_auto_login_controller.rb` and add the above line only to controllers that should require authentication.
|
41
|
+
1. Execute `bin/rails db:migrate RAILS_ENV=development`
|
24
42
|
|
25
|
-
1. Remove the first devise line with the default devise plugins from `app/models/user.rb`. You should end up with the only devise line being
|
26
|
-
```ruby
|
27
|
-
devise :omniauthable, omniauth_providers: [:strongmind]
|
28
|
-
```
|
29
|
-
|
30
43
|
1. Start the server: `rails s`
|
@@ -4,8 +4,9 @@ module Users
|
|
4
4
|
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
5
5
|
|
6
6
|
def strongmind
|
7
|
-
|
8
|
-
@user = User.from_omniauth(
|
7
|
+
auth = request.env['omniauth.auth']
|
8
|
+
@user = User.from_omniauth(auth)
|
9
|
+
session[:full_name] = "#{auth.extra.raw_info['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname']} #{auth.extra.raw_info['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname']}"
|
9
10
|
sign_in_and_redirect @user
|
10
11
|
end
|
11
12
|
|
@@ -1,3 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<%=
|
1
|
+
<div>
|
2
|
+
<div>
|
3
|
+
Hi <%= session[:full_name] %>!
|
4
|
+
</div>
|
5
|
+
<div>
|
6
|
+
<%= button_to 'Sign out', '/users/sign_out', style: 'display:inline' %>
|
7
|
+
</div>
|
8
|
+
</div>
|
data/lib/platform_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongmind-platform-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platform Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|