@effected/github-actions 0.20.1 → 0.20.3
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.
- package/OidcTokenIssuer.js +2 -6
- package/internal/jwt.js +1 -6
- package/package.json +3 -3
package/OidcTokenIssuer.js
CHANGED
|
@@ -98,13 +98,9 @@ const REQUEST_URL = "ACTIONS_ID_TOKEN_REQUEST_URL";
|
|
|
98
98
|
* {@link OidcTokenIssuerShape.claims}; do not "fix" it here.
|
|
99
99
|
*/
|
|
100
100
|
const readClaims = (token) => Effect.gen(function* () {
|
|
101
|
-
const decoded = yield* Effect.fromResult(payloadOf(token)).pipe(Effect.mapError((failure) =>
|
|
101
|
+
const decoded = yield* Effect.fromResult(payloadOf(token)).pipe(Effect.mapError((failure) => new OidcTokenError({
|
|
102
102
|
reason: "malformedToken",
|
|
103
|
-
|
|
104
|
-
}) : new OidcTokenError({
|
|
105
|
-
reason: "malformedToken",
|
|
106
|
-
detail: failure.detail,
|
|
107
|
-
cause: failure.cause
|
|
103
|
+
...failure
|
|
108
104
|
})));
|
|
109
105
|
return yield* Schema.decodeUnknownEffect(OidcClaims)(decoded).pipe(Effect.mapError((cause) => new OidcTokenError({
|
|
110
106
|
reason: "missingClaims",
|
package/internal/jwt.js
CHANGED
|
@@ -11,13 +11,9 @@ import * as Base64Url from "effect/encoding/Base64Url";
|
|
|
11
11
|
const payloadOf = (token) => {
|
|
12
12
|
const segments = token.split(".");
|
|
13
13
|
const payload = segments[1];
|
|
14
|
-
if (segments.length !== 3 || payload === void 0 || payload === "") return Result.fail({
|
|
15
|
-
kind: "segments",
|
|
16
|
-
detail: `expected three segments, got ${segments.length}`
|
|
17
|
-
});
|
|
14
|
+
if (segments.length !== 3 || payload === void 0 || payload === "") return Result.fail({ detail: `expected three segments, got ${segments.length}` });
|
|
18
15
|
const json = Base64Url.decodeString(payload);
|
|
19
16
|
if (Result.isFailure(json)) return Result.fail({
|
|
20
|
-
kind: "payload",
|
|
21
17
|
detail: "the payload is not base64url JSON",
|
|
22
18
|
cause: json.failure
|
|
23
19
|
});
|
|
@@ -25,7 +21,6 @@ const payloadOf = (token) => {
|
|
|
25
21
|
return Result.succeed(JSON.parse(json.success));
|
|
26
22
|
} catch (cause) {
|
|
27
23
|
return Result.fail({
|
|
28
|
-
kind: "payload",
|
|
29
24
|
detail: "the payload is not base64url JSON",
|
|
30
25
|
cause
|
|
31
26
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/github-actions",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The GitHub Actions runtime: env, inputs, outputs, state, logging, cache, artifacts, blob storage, OIDC and the token bridge.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@azure/storage-blob": "^12.33.0",
|
|
42
|
-
"@effected/github": "^0.
|
|
43
|
-
"@effected/github-commands": "^0.2.
|
|
42
|
+
"@effected/github": "^0.17.0",
|
|
43
|
+
"@effected/github-commands": "^0.2.1",
|
|
44
44
|
"@effected/glob": "^0.10.0",
|
|
45
45
|
"@effected/markdown": "^0.15.1",
|
|
46
46
|
"@effected/npm": "^0.20.0",
|