We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d591d28 commit 0c4a744Copy full SHA for 0c4a744
github_api.cr
@@ -32,9 +32,17 @@ end
32
struct InstallationToken < Token
33
include JSON::Serializable
34
getter token : String
35
+ property! installation_id : InstallationId
36
37
def initialize(@token : String)
38
end
39
+
40
+ def to_s
41
+ if (installation_id = @installation_id)
42
+ Log.info { "Using token for ##{installation_id}" }
43
+ end
44
+ super
45
46
47
48
struct OAuthToken < Token
@@ -70,7 +78,9 @@ class GitHubAppAuth
70
78
headers: {Authorization: jwt}
71
79
)
72
80
resp.raise_for_status
73
- InstallationToken.from_json(resp.body)
81
+ tok = InstallationToken.from_json(resp.body)
82
+ tok.installation_id = installation_id
83
+ tok
74
84
75
85
76
86
TOKEN_EXPIRATION = 55.minutes
0 commit comments