@kronos-integration/service-authenticator 3.0.21 → 4.0.0
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": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@kronos-integration/endpoint": "^
|
|
33
|
-
"@kronos-integration/service": "^
|
|
32
|
+
"@kronos-integration/endpoint": "^11.0.0",
|
|
33
|
+
"@kronos-integration/service": "^14.0.0",
|
|
34
34
|
"jsonwebtoken": "^9.0.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"ava": "^6.4.1",
|
|
38
38
|
"c8": "^10.1.3",
|
|
39
39
|
"documentation": "^14.0.3",
|
|
40
|
-
"semantic-release": "^
|
|
40
|
+
"semantic-release": "^25.0.1"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
43
|
+
"node": ">=24.11.0"
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { promisify } from "node:util";
|
|
2
2
|
import jwt from "jsonwebtoken";
|
|
3
|
-
import ms from "ms";
|
|
4
3
|
import {
|
|
5
4
|
prepareAttributesDefinitions,
|
|
6
5
|
default_attribute,
|
|
7
6
|
public_key_attribute,
|
|
8
|
-
private_key_attribute
|
|
7
|
+
private_key_attribute,
|
|
8
|
+
object_attribute
|
|
9
9
|
} from "pacc";
|
|
10
10
|
import { Service } from "@kronos-integration/service";
|
|
11
11
|
|
|
@@ -36,24 +36,24 @@ export class ServiceAuthenticator extends Service {
|
|
|
36
36
|
return "provide authentication services";
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
static attributes =
|
|
40
|
-
|
|
39
|
+
static attributes = prepareAttributesDefinitions(
|
|
40
|
+
{
|
|
41
41
|
jwt: {
|
|
42
|
+
...object_attribute,
|
|
42
43
|
description: "jwt related",
|
|
43
44
|
attributes: {
|
|
44
45
|
private: {
|
|
45
46
|
...private_key_attribute,
|
|
46
47
|
description: "private key for token",
|
|
47
|
-
mandatory: true
|
|
48
|
-
type: "blob"
|
|
48
|
+
mandatory: true
|
|
49
49
|
},
|
|
50
50
|
public: {
|
|
51
51
|
...public_key_attribute,
|
|
52
52
|
description: "public key for token",
|
|
53
|
-
mandatory: true
|
|
54
|
-
type: "blob"
|
|
53
|
+
mandatory: true
|
|
55
54
|
},
|
|
56
55
|
claims: {
|
|
56
|
+
...object_attribute,
|
|
57
57
|
attributes: {
|
|
58
58
|
iss: default_attribute,
|
|
59
59
|
aud: default_attribute
|
|
@@ -168,7 +168,7 @@ export class ServiceAuthenticator extends Service {
|
|
|
168
168
|
};
|
|
169
169
|
return {
|
|
170
170
|
token_type: "Bearer",
|
|
171
|
-
expires_in:
|
|
171
|
+
expires_in: j.access_token.expiresIn,
|
|
172
172
|
access_token: jwt.sign(claims, j.private, j.access_token),
|
|
173
173
|
refresh_token: jwt.sign(refreshClaims, j.private, j.refresh_token)
|
|
174
174
|
};
|