rubysky 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubysky/client.rb +8 -0
- data/lib/rubysky/raw/client.rb +2 -3
- data/lib/rubysky/raw/did_doc.rb +1 -1
- data/lib/rubysky/version.rb +1 -1
- data/sig/rubysky.rbs +3 -0
- 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: c44c04b8d9e7b9719cf9a8be4d5b9ac1686ceafb5470da8cafc35dab72bc048a
|
4
|
+
data.tar.gz: 962796e252ca7c90ee9eb9c206f052f4f5c5f48d74f861f58ebbabd885127de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ce2eded0373f75effd5ef2d98734687c6e353e4b5a353239205bd34ca48d68479b5cb4ed48babedc0d39607b39c11450b191b7d01346b621db09e150b881a80
|
7
|
+
data.tar.gz: e4f77dac156e47b273bdf44a485dfab7764accecb3229920eee9802d46653df73d6e57d806540112e436d552007db430f4ebd2c04778019c29e426a65534e48d
|
data/lib/rubysky/client.rb
CHANGED
data/lib/rubysky/raw/client.rb
CHANGED
@@ -110,7 +110,7 @@ module RubySky
|
|
110
110
|
private
|
111
111
|
|
112
112
|
def valid_access_jwt?
|
113
|
-
jwt = JWT.decode(@access_jwt, nil, false, algorithm: "RS256")
|
113
|
+
jwt = JWT.decode(@session.access_jwt, nil, false, algorithm: "RS256")
|
114
114
|
payload = jwt[0]
|
115
115
|
payload["exp"] > Time.now.to_i + 10
|
116
116
|
end
|
@@ -120,9 +120,8 @@ module RubySky
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def refresh!(refresh_jwt: nil, pds: nil)
|
123
|
-
@refresh_jwt = refresh_jwt if refresh_jwt
|
124
123
|
@pds = pds if pds
|
125
|
-
res = send_post(pds: @pds, path: REFRESH_SESSION_PATH, auth: @refresh_jwt)
|
124
|
+
res = send_post(pds: @pds, path: REFRESH_SESSION_PATH, auth: refresh_jwt || @session.refresh_jwt)
|
126
125
|
ensure_success(res:, called_from: REFRESH_SESSION_PATH)
|
127
126
|
|
128
127
|
json = JSON.parse(res.body)
|
data/lib/rubysky/raw/did_doc.rb
CHANGED
data/lib/rubysky/version.rb
CHANGED
data/sig/rubysky.rbs
CHANGED
@@ -10,6 +10,8 @@ module RubySky
|
|
10
10
|
def initialize: (client: Raw::Client) -> void
|
11
11
|
def post: (text: String, images: Array[{data: IO, mime_type: String, ?alt: String}]) -> Post
|
12
12
|
def refresh_jwt: () -> String
|
13
|
+
def user_did: () -> Hash[String, untyped]
|
14
|
+
def handle: () -> String
|
13
15
|
|
14
16
|
attr_reader client: Raw::Client
|
15
17
|
end
|
@@ -61,6 +63,7 @@ module RubySky
|
|
61
63
|
def to_json: () -> String
|
62
64
|
|
63
65
|
attr_reader did: String
|
66
|
+
attr_reader did_doc: Hash[String, untyped]
|
64
67
|
@did_doc: Hash[String, untyped]
|
65
68
|
end
|
66
69
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kugayama Nana
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|