@kronos-integration/service-authenticator 4.1.7 → 4.1.8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/service-authenticator",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"lint:docs": "documentation lint ./src**/*.mjs"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@kronos-integration/endpoint": "^11.0.
|
|
34
|
-
"@kronos-integration/service": "^15.2.
|
|
33
|
+
"@kronos-integration/endpoint": "^11.0.7",
|
|
34
|
+
"@kronos-integration/service": "^15.2.3",
|
|
35
35
|
"jsonwebtoken": "^9.0.3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
@@ -2,11 +2,11 @@ import { promisify } from "node:util";
|
|
|
2
2
|
import jwt from "jsonwebtoken";
|
|
3
3
|
import {
|
|
4
4
|
prepareAttributesDefinitions,
|
|
5
|
-
default_attribute,
|
|
6
5
|
public_key_attribute,
|
|
7
6
|
private_key_attribute,
|
|
8
7
|
object_attribute,
|
|
9
|
-
duration_ms_attribute
|
|
8
|
+
duration_ms_attribute,
|
|
9
|
+
string_attribute
|
|
10
10
|
} from "pacc";
|
|
11
11
|
import { Service } from "@kronos-integration/service";
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ export const verifyJWT = promisify(jwt.verify);
|
|
|
20
20
|
* @property {number} expires_in seconds the access token is valid
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
const algorithm = { ...
|
|
23
|
+
const algorithm = { ...string_attribute, default: "RS256" };
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
@@ -58,8 +58,8 @@ export class ServiceAuthenticator extends Service {
|
|
|
58
58
|
claims: {
|
|
59
59
|
...object_attribute,
|
|
60
60
|
attributes: {
|
|
61
|
-
iss:
|
|
62
|
-
aud:
|
|
61
|
+
iss: string_attribute,
|
|
62
|
+
aud: string_attribute
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
access_token: {
|
|
@@ -96,8 +96,7 @@ export class ServiceAuthenticator extends Service {
|
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
get autostart()
|
|
100
|
-
{
|
|
99
|
+
get autostart() {
|
|
101
100
|
return true;
|
|
102
101
|
}
|
|
103
102
|
|
|
@@ -185,9 +184,9 @@ export class ServiceAuthenticator extends Service {
|
|
|
185
184
|
} else {
|
|
186
185
|
throw new Error("Not authorized");
|
|
187
186
|
}
|
|
188
|
-
} catch (
|
|
189
|
-
this.error(
|
|
190
|
-
throw new Error("Authentication failed");
|
|
187
|
+
} catch (cause) {
|
|
188
|
+
this.error(cause);
|
|
189
|
+
throw new Error("Authentication failed", { cause });
|
|
191
190
|
}
|
|
192
191
|
}
|
|
193
192
|
}
|