artsy-auth 0.1.8 → 0.2.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/README.md +10 -3
- data/app/views/artsy_auth/sessions/new.erb +20 -0
- data/config/routes.rb +1 -0
- data/lib/artsy-auth.rb +1 -0
- data/lib/artsy-auth/authenticated.rb +1 -1
- data/lib/artsy-auth/session_controller.rb +2 -0
- data/lib/artsy-auth/version.rb +1 -1
- metadata +70 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3ba60006edb2e37220a6ba341de9ac26e26e3b4bcec129775a7f08552d40627a
|
4
|
+
data.tar.gz: da6c9ececb084317e0a8745a128e1c0a24ef3c680fb79b3b086c8c1830ff6d5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb51d56f276740c9268942c544452e2d82f5b07781a1e471a49ae05df13366fe3095c9e6fc926bf196e1287c249af9e89f6fd27f5b86199f4d7db766a393807c
|
7
|
+
data.tar.gz: cab76d066dddfd593a6670bdc56921d744c97173728e156304bbd5f209534b055eb24791c0dfeee6f19372b5ecc738d5785674906e9926461039b5c317649ddb
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Artsy Authentication [](https://circleci.com/gh/artsy/artsy-auth/tree/master)
|
2
2
|
|
3
3
|
Ruby Gem for adding Artsy's omniauth based authentication to your app.
|
4
4
|
|
@@ -17,7 +17,7 @@ Add `artsy_auth.rb` under `config/initializers`. We need to configure `ArtsyAuth
|
|
17
17
|
`callback_url` defines after a successful omniauth handshake, where should we get redirected to.
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
# config/
|
20
|
+
# config/initializers/artsy_auth.rb
|
21
21
|
ArtsyAuth.configure do |config|
|
22
22
|
config.artsy_api_url = 'https://stagingapi.artsy.net' # required
|
23
23
|
config.callback_url = '/admin' # optional
|
@@ -34,7 +34,7 @@ mount ArtsyAuth::Engine => '/'
|
|
34
34
|
|
35
35
|
In order to force authentication, you need to include 'ArtsyAuth::Authenticated' in your controller, you also need to add (override) `authorized_artsy_token?` method there which gets a token and in your app you need to define how do you authorize that token, for example:
|
36
36
|
```ruby
|
37
|
-
class ApplicationController <
|
37
|
+
class ApplicationController < ActionController::Base
|
38
38
|
# Prevent CSRF attacks by raising an exception.
|
39
39
|
protect_from_forgery with: :exception
|
40
40
|
|
@@ -51,6 +51,13 @@ class ApplicationController < ArtsyAuth::ApplicationController
|
|
51
51
|
end
|
52
52
|
```
|
53
53
|
|
54
|
+
# Decoding the JWT
|
55
|
+
|
56
|
+
The JWT is signed using a different secret from the client secret for OAuth. For Artsy engineers: get it from the `internal_secret` on your corresponding `ClientApplication` model.
|
57
|
+
|
58
|
+
The JWT contains user information that you can get from an API call to get the `me` user account, you can work around not having the secret by making a request for that against the API.
|
59
|
+
|
60
|
+
|
54
61
|
# Update From Version < 0.1.7
|
55
62
|
In previous versions you would change your `ApplicationController` to inherit from `ArtsyAuth::ApplicationController`, with versions > `0.1.7` you need to `include ArtsyAuth::Authenticated` like the example above.
|
56
63
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Artsy Auth</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<p id="placeholder" style="visibility: hidden; text-align: center;">Authenticating...</p>
|
9
|
+
<div style="display: none;">
|
10
|
+
<%= button_to 'Log in via Artsy', '/auth/artsy', form: { id: 'artsy-auth-login-form' } %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<script>
|
14
|
+
document.getElementById("artsy-auth-login-form").submit();
|
15
|
+
setTimeout(function() {
|
16
|
+
document.getElementById("placeholder").style.visibility = "visible";
|
17
|
+
}, 1000);
|
18
|
+
</script>
|
19
|
+
</body>
|
20
|
+
</html>
|
data/config/routes.rb
CHANGED
data/lib/artsy-auth.rb
CHANGED
data/lib/artsy-auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artsy-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artsy
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth-artsy
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.4.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.4.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: omniauth-oauth2
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -25,19 +39,19 @@ dependencies:
|
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: omniauth-
|
42
|
+
name: omniauth-rails_csrf_protection
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
47
|
+
version: 1.0.0
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
54
|
+
version: 1.0.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rails
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,7 +67,21 @@ dependencies:
|
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: 4.2.0
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: capybara
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: guard-rubocop
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
58
86
|
requirements:
|
59
87
|
- - ">="
|
@@ -80,6 +108,20 @@ dependencies:
|
|
80
108
|
- - ">="
|
81
109
|
- !ruby/object:Gem::Version
|
82
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
83
125
|
- !ruby/object:Gem::Dependency
|
84
126
|
name: rspec-rails
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,7 +151,21 @@ dependencies:
|
|
109
151
|
- !ruby/object:Gem::Version
|
110
152
|
version: '0'
|
111
153
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
154
|
+
name: selenium-webdriver
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: webdrivers
|
113
169
|
requirement: !ruby/object:Gem::Requirement
|
114
170
|
requirements:
|
115
171
|
- - ">="
|
@@ -131,6 +187,7 @@ extra_rdoc_files: []
|
|
131
187
|
files:
|
132
188
|
- README.md
|
133
189
|
- Rakefile
|
190
|
+
- app/views/artsy_auth/sessions/new.erb
|
134
191
|
- config/initializers/omniauth.rb
|
135
192
|
- config/routes.rb
|
136
193
|
- lib/artsy-auth.rb
|
@@ -139,10 +196,10 @@ files:
|
|
139
196
|
- lib/artsy-auth/engine.rb
|
140
197
|
- lib/artsy-auth/session_controller.rb
|
141
198
|
- lib/artsy-auth/version.rb
|
142
|
-
homepage:
|
199
|
+
homepage: https://www.artsy.net
|
143
200
|
licenses: []
|
144
201
|
metadata: {}
|
145
|
-
post_install_message:
|
202
|
+
post_install_message:
|
146
203
|
rdoc_options: []
|
147
204
|
require_paths:
|
148
205
|
- lib
|
@@ -157,10 +214,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
214
|
- !ruby/object:Gem::Version
|
158
215
|
version: '0'
|
159
216
|
requirements: []
|
160
|
-
|
161
|
-
|
162
|
-
signing_key:
|
217
|
+
rubygems_version: 3.2.23
|
218
|
+
signing_key:
|
163
219
|
specification_version: 4
|
164
|
-
summary: ArtsyAuth is a
|
220
|
+
summary: ArtsyAuth is a Rails engine that adds Artsy authentication with authorization
|
165
221
|
to your app.
|
166
222
|
test_files: []
|