omniauth-atproto 0.1.3 → 0.1.4
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/README.md +1 -1
- data/lib/omniauth/strategies/atproto.rb +11 -12
- data/lib/omniauth-atproto/version.rb +1 -1
- metadata +5 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f160f72bb32ee424debc508de26eb57909a0099dd843514c4787f925ab49339
|
|
4
|
+
data.tar.gz: e17bf34036b05597a16b25aec8003fce7422fe511ae3c82074144b5546f8cc16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c88cd60ddba8dcb55801fc80ef932ccdfea21fdcb6bc4f9e646f6bf5cd1185608bd497a6ce9a55547c3a03fd7920191c482a89a795b0ba3b5ef0fbb813ebbd64
|
|
7
|
+
data.tar.gz: ff8baae3478d2ad51e8291252a0d08a5552631ff692416ffc40b26fa0d65e4b2bc73b8861aa8fc2d0e89094076b5eb24ce56a38538ab7d69dd06a386f18aac64
|
data/README.md
CHANGED
|
@@ -78,7 +78,7 @@ rails atproto:generate_metadata
|
|
|
78
78
|
```
|
|
79
79
|
The values from the metadata endpoint should correspond to those you gave as option for the strategy (that's why a generator would be very handy).
|
|
80
80
|
|
|
81
|
-
All subsequent request made with the token should use the same private_key (with dpop,
|
|
81
|
+
All subsequent request made with the token should use the same private_key (with dpop), you might want to use https://github.com/lasercatspro/atproto-ruby.
|
|
82
82
|
|
|
83
83
|
The pds is going to request your app at oauth/client-metadata.json. For developement you will have to use some kind of proxy, like ngrok (there is a "development mode" in the spec but I didnt try it)
|
|
84
84
|
|
|
@@ -21,29 +21,28 @@ module OmniAuth
|
|
|
21
21
|
|
|
22
22
|
def self.setup
|
|
23
23
|
lambda do |env|
|
|
24
|
-
session = env[
|
|
24
|
+
session = env["rack.session"]
|
|
25
25
|
|
|
26
|
-
if env[
|
|
26
|
+
if env["rack.request.form_hash"] && handle = env["rack.request.form_hash"]["handle"]
|
|
27
27
|
resolver = DIDKit::Resolver.new
|
|
28
28
|
did = resolver.resolve_handle(handle)
|
|
29
29
|
|
|
30
30
|
unless did
|
|
31
31
|
env['omniauth.strategy'].fail!(:unknown_handle,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
OmniAuth::Error.new(
|
|
33
|
+
'Handle parameter did not resolve to a did'
|
|
34
|
+
))
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
endpoint = resolver.resolve_did(did).pds_endpoint
|
|
38
38
|
auth_server = get_authorization_server(endpoint)
|
|
39
|
-
session[
|
|
39
|
+
session["authorization_info"] = authorization_info = get_authorization_data(auth_server)
|
|
40
40
|
end
|
|
41
|
-
|
|
42
|
-
if authorization_info ||= session.delete(
|
|
43
|
-
env['omniauth.strategy'].options[
|
|
44
|
-
env['omniauth.strategy'].options[
|
|
45
|
-
|
|
46
|
-
env['omniauth.strategy'].options['client_options']['token_url'] = authorization_info['token_endpoint']
|
|
41
|
+
|
|
42
|
+
if authorization_info ||= session.delete("authorization_info")
|
|
43
|
+
env['omniauth.strategy'].options["client_options"]["site"] = authorization_info["issuer"]
|
|
44
|
+
env['omniauth.strategy'].options["client_options"]["authorize_url"] = authorization_info['authorization_endpoint']
|
|
45
|
+
env['omniauth.strategy'].options["client_options"]["token_url"] = authorization_info['token_endpoint']
|
|
47
46
|
end
|
|
48
47
|
end
|
|
49
48
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-atproto
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- frabr
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: atproto_client
|
|
@@ -56,14 +55,14 @@ dependencies:
|
|
|
56
55
|
name: jwt
|
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
|
58
57
|
requirements:
|
|
59
|
-
- - "
|
|
58
|
+
- - ">="
|
|
60
59
|
- !ruby/object:Gem::Version
|
|
61
60
|
version: '2.7'
|
|
62
61
|
type: :runtime
|
|
63
62
|
prerelease: false
|
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
64
|
requirements:
|
|
66
|
-
- - "
|
|
65
|
+
- - ">="
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
67
|
version: '2.7'
|
|
69
68
|
- !ruby/object:Gem::Dependency
|
|
@@ -143,7 +142,6 @@ metadata:
|
|
|
143
142
|
homepage_uri: https://github.com/lasercats/omniauth-atproto
|
|
144
143
|
source_code_uri: https://github.com/lasercats/omniauth-atproto
|
|
145
144
|
changelog_uri: https://github.com/lasercats/omniauth-atproto/blob/master/CHANGELOG.md
|
|
146
|
-
post_install_message:
|
|
147
145
|
rdoc_options: []
|
|
148
146
|
require_paths:
|
|
149
147
|
- lib
|
|
@@ -158,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
158
156
|
- !ruby/object:Gem::Version
|
|
159
157
|
version: '0'
|
|
160
158
|
requirements: []
|
|
161
|
-
rubygems_version: 3.
|
|
162
|
-
signing_key:
|
|
159
|
+
rubygems_version: 3.7.2
|
|
163
160
|
specification_version: 4
|
|
164
161
|
summary: OmniAuth strategy for AtProto
|
|
165
162
|
test_files: []
|