kauth-sdk-node 2.0.13-alpha.2 → 2.0.13-alpha.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/dist/authenticator/authenticator.js +3 -0
- package/dist/authenticator/base.d.ts +1 -1
- package/dist/authenticator/base.js +7 -2
- package/dist/authenticator/google.js +14 -0
- package/dist/authenticator/index.js +1 -0
- package/dist/authenticator/manager.js +6 -0
- package/dist/authenticator/miniprogram.js +8 -0
- package/dist/authenticator/mozi.js +14 -0
- package/dist/authenticator/provider.d.ts +2 -2
- package/dist/authenticator/provider.js +22 -12
- package/dist/authorizer/index.js +1 -0
- package/dist/authorizer/permission.js +3 -5
- package/dist/common/constant/http.js +2 -1
- package/dist/common/http/kauth.js +2 -0
- package/dist/common/http/kflow.js +1 -0
- package/dist/common/http/request/kauth.d.ts +0 -1
- package/dist/common/http/request/kflow.d.ts +1 -1
- package/dist/common/http/response/kauth.js +1 -1
- package/dist/common/http/tool/marmot.d.ts +0 -1
- package/dist/common/http/tool/marmot.js +17 -1
- package/dist/index.js +7 -2
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@ const mozi_1 = require("./mozi");
|
|
|
5
5
|
const google_1 = require("./google");
|
|
6
6
|
const miniprogram_1 = require("./miniprogram");
|
|
7
7
|
class GoogleAuthenticator {
|
|
8
|
+
kauthApi;
|
|
8
9
|
constructor(kauthApi) {
|
|
9
10
|
this.kauthApi = kauthApi;
|
|
10
11
|
}
|
|
@@ -33,6 +34,7 @@ class GoogleAuthenticator {
|
|
|
33
34
|
}
|
|
34
35
|
exports.GoogleAuthenticator = GoogleAuthenticator;
|
|
35
36
|
class MoziAuthenticator {
|
|
37
|
+
kauthApi;
|
|
36
38
|
constructor(kauthApi) {
|
|
37
39
|
this.kauthApi = kauthApi;
|
|
38
40
|
}
|
|
@@ -61,6 +63,7 @@ class MoziAuthenticator {
|
|
|
61
63
|
}
|
|
62
64
|
exports.MoziAuthenticator = MoziAuthenticator;
|
|
63
65
|
class MiniprogramAuthenticator {
|
|
66
|
+
kauthApi;
|
|
64
67
|
constructor(kauthApi) {
|
|
65
68
|
this.kauthApi = kauthApi;
|
|
66
69
|
}
|
|
@@ -10,7 +10,7 @@ export declare enum PreAuthorizationAllowedErrorCode {
|
|
|
10
10
|
TokenNotExisted = "tokenNotExisted",
|
|
11
11
|
TokenUsedUp = "tokenUsedUp"
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export type PreAuthorizationAllowed = ({
|
|
14
14
|
allowed: true;
|
|
15
15
|
} & {
|
|
16
16
|
id: number;
|
|
@@ -6,7 +6,7 @@ var UserAccountType;
|
|
|
6
6
|
UserAccountType["Mozi"] = "mozi";
|
|
7
7
|
UserAccountType["Google"] = "google";
|
|
8
8
|
UserAccountType["Miniprogram"] = "miniprogram";
|
|
9
|
-
})(UserAccountType
|
|
9
|
+
})(UserAccountType || (exports.UserAccountType = UserAccountType = {}));
|
|
10
10
|
var PreAuthorizationAllowedErrorCode;
|
|
11
11
|
(function (PreAuthorizationAllowedErrorCode) {
|
|
12
12
|
PreAuthorizationAllowedErrorCode["UserNotFound"] = "userNotFound";
|
|
@@ -14,7 +14,12 @@ var PreAuthorizationAllowedErrorCode;
|
|
|
14
14
|
PreAuthorizationAllowedErrorCode["TokenExpired"] = "tokenExpired";
|
|
15
15
|
PreAuthorizationAllowedErrorCode["TokenNotExisted"] = "tokenNotExisted";
|
|
16
16
|
PreAuthorizationAllowedErrorCode["TokenUsedUp"] = "tokenUsedUp";
|
|
17
|
-
})(PreAuthorizationAllowedErrorCode
|
|
17
|
+
})(PreAuthorizationAllowedErrorCode || (exports.PreAuthorizationAllowedErrorCode = PreAuthorizationAllowedErrorCode = {}));
|
|
18
18
|
class PrimaryPrincipal {
|
|
19
|
+
id;
|
|
20
|
+
name;
|
|
21
|
+
email;
|
|
22
|
+
avatar;
|
|
23
|
+
status;
|
|
19
24
|
}
|
|
20
25
|
exports.PrimaryPrincipal = PrimaryPrincipal;
|
|
@@ -2,11 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GoogleAuthenticationInformation = exports.GoogleCredential = exports.GooglePrincipal = void 0;
|
|
4
4
|
class GooglePrincipal {
|
|
5
|
+
sub;
|
|
6
|
+
name;
|
|
7
|
+
givenName;
|
|
8
|
+
familyName;
|
|
9
|
+
picture;
|
|
10
|
+
email;
|
|
11
|
+
emailVerified;
|
|
12
|
+
locale;
|
|
5
13
|
}
|
|
6
14
|
exports.GooglePrincipal = GooglePrincipal;
|
|
7
15
|
class GoogleCredential {
|
|
16
|
+
accessToken;
|
|
17
|
+
expiresIn;
|
|
18
|
+
refreshToken;
|
|
8
19
|
}
|
|
9
20
|
exports.GoogleCredential = GoogleCredential;
|
|
10
21
|
class GoogleAuthenticationInformation {
|
|
22
|
+
primaryPrincipal;
|
|
23
|
+
principal;
|
|
24
|
+
credential;
|
|
11
25
|
}
|
|
12
26
|
exports.GoogleAuthenticationInformation = GoogleAuthenticationInformation;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsonWebTokenAuthenticationProvider = exports.JsonWebTokenSubjectProvider = exports.UserAccountType = exports.PrimaryPrincipal = exports.MiniprogramAuthenticator = exports.MoziAuthenticator = exports.GoogleAuthenticator = void 0;
|
|
3
4
|
var authenticator_1 = require("./authenticator");
|
|
4
5
|
Object.defineProperty(exports, "GoogleAuthenticator", { enumerable: true, get: function () { return authenticator_1.GoogleAuthenticator; } });
|
|
5
6
|
Object.defineProperty(exports, "MoziAuthenticator", { enumerable: true, get: function () { return authenticator_1.MoziAuthenticator; } });
|
|
@@ -14,6 +14,9 @@ var ProviderType;
|
|
|
14
14
|
ProviderType["Miniprogram"] = "miniprogram";
|
|
15
15
|
})(ProviderType || (ProviderType = {}));
|
|
16
16
|
class DelegatedAuthenticationInfoManager {
|
|
17
|
+
googleAuthenticationInfoManager;
|
|
18
|
+
moziAuthenticationInfoManager;
|
|
19
|
+
miniprogramAuthenticationInfoManager;
|
|
17
20
|
constructor(kauthApi) {
|
|
18
21
|
this.googleAuthenticationInfoManager = new GoogleAuthenticationInfoManger(kauthApi);
|
|
19
22
|
this.moziAuthenticationInfoManager = new MoziAuthenticationInfoManager(kauthApi);
|
|
@@ -46,6 +49,7 @@ class DelegatedAuthenticationInfoManager {
|
|
|
46
49
|
}
|
|
47
50
|
exports.DelegatedAuthenticationInfoManager = DelegatedAuthenticationInfoManager;
|
|
48
51
|
class GoogleAuthenticationInfoManger {
|
|
52
|
+
kauthApi;
|
|
49
53
|
constructor(kauthApi) {
|
|
50
54
|
this.kauthApi = kauthApi;
|
|
51
55
|
}
|
|
@@ -87,6 +91,7 @@ class GoogleAuthenticationInfoManger {
|
|
|
87
91
|
}
|
|
88
92
|
exports.GoogleAuthenticationInfoManger = GoogleAuthenticationInfoManger;
|
|
89
93
|
class MoziAuthenticationInfoManager {
|
|
94
|
+
kauthApi;
|
|
90
95
|
constructor(kauthApi) {
|
|
91
96
|
this.kauthApi = kauthApi;
|
|
92
97
|
}
|
|
@@ -127,6 +132,7 @@ class MoziAuthenticationInfoManager {
|
|
|
127
132
|
}
|
|
128
133
|
exports.MoziAuthenticationInfoManager = MoziAuthenticationInfoManager;
|
|
129
134
|
class MiniprogramAuthenticationInfoManager {
|
|
135
|
+
kauthApi;
|
|
130
136
|
constructor(kauthApi) {
|
|
131
137
|
this.kauthApi = kauthApi;
|
|
132
138
|
}
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MiniprogramAuthenticationInformation = exports.MiniprogramCredential = exports.MiniprogramPrincipal = void 0;
|
|
4
4
|
class MiniprogramPrincipal {
|
|
5
|
+
trustLoginId;
|
|
6
|
+
customerId;
|
|
7
|
+
email;
|
|
8
|
+
nickName;
|
|
5
9
|
}
|
|
6
10
|
exports.MiniprogramPrincipal = MiniprogramPrincipal;
|
|
7
11
|
class MiniprogramCredential {
|
|
12
|
+
accessToken;
|
|
8
13
|
}
|
|
9
14
|
exports.MiniprogramCredential = MiniprogramCredential;
|
|
10
15
|
class MiniprogramAuthenticationInformation {
|
|
16
|
+
primaryPrincipal;
|
|
17
|
+
principal;
|
|
18
|
+
credential;
|
|
11
19
|
}
|
|
12
20
|
exports.MiniprogramAuthenticationInformation = MiniprogramAuthenticationInformation;
|
|
@@ -2,11 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MoziAuthenticationInformation = exports.MoziCredential = exports.MoziPrincipal = void 0;
|
|
4
4
|
class MoziPrincipal {
|
|
5
|
+
account;
|
|
6
|
+
employeeCode;
|
|
7
|
+
lastName;
|
|
8
|
+
namespace;
|
|
9
|
+
nickNameCn;
|
|
10
|
+
openid;
|
|
11
|
+
realmId;
|
|
12
|
+
realmName;
|
|
5
13
|
}
|
|
6
14
|
exports.MoziPrincipal = MoziPrincipal;
|
|
7
15
|
class MoziCredential {
|
|
16
|
+
accessToken;
|
|
17
|
+
expiresIn;
|
|
18
|
+
refreshToken;
|
|
8
19
|
}
|
|
9
20
|
exports.MoziCredential = MoziCredential;
|
|
10
21
|
class MoziAuthenticationInformation {
|
|
22
|
+
primaryPrincipal;
|
|
23
|
+
principal;
|
|
24
|
+
credential;
|
|
11
25
|
}
|
|
12
26
|
exports.MoziAuthenticationInformation = MoziAuthenticationInformation;
|
|
@@ -8,7 +8,7 @@ export interface SubjectProvider {
|
|
|
8
8
|
export interface AuthenticationProvider {
|
|
9
9
|
verify(token: string): Promise<AuthenticationInformation>;
|
|
10
10
|
refresh(token: string): string;
|
|
11
|
-
authenticate(authenticationInformation: AuthenticationInformation): string;
|
|
11
|
+
authenticate(authenticationInformation: AuthenticationInformation, dynamicDuration?: number): string;
|
|
12
12
|
}
|
|
13
13
|
export declare class JsonWebTokenSubjectProvider implements SubjectProvider {
|
|
14
14
|
private secret;
|
|
@@ -24,5 +24,5 @@ export declare class JsonWebTokenAuthenticationProvider implements Authenticatio
|
|
|
24
24
|
constructor(kauthApi: KauthApi, kauthConfig: KauthConfig);
|
|
25
25
|
verify(token: string): Promise<AuthenticationInformation>;
|
|
26
26
|
refresh(token: string): string;
|
|
27
|
-
authenticate(authenticationInformation: AuthenticationInformation): string;
|
|
27
|
+
authenticate(authenticationInformation: AuthenticationInformation, dynamicDuration?: number): string;
|
|
28
28
|
}
|
|
@@ -9,7 +9,10 @@ const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
|
9
9
|
const manager_1 = require("./manager");
|
|
10
10
|
const Exp = 'exp';
|
|
11
11
|
const Sub = 'sub';
|
|
12
|
+
const Iat = 'iat';
|
|
12
13
|
class JsonWebTokenSubjectProvider {
|
|
14
|
+
secret;
|
|
15
|
+
duration;
|
|
13
16
|
constructor(kauthConfig) {
|
|
14
17
|
this.secret = kauthConfig.jwtSecret;
|
|
15
18
|
this.duration = kauthConfig.jwtDuration;
|
|
@@ -24,11 +27,12 @@ class JsonWebTokenSubjectProvider {
|
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
29
|
refresh(token) {
|
|
27
|
-
const { iat, ...claims } = jsonwebtoken_1.default.decode(token);
|
|
28
|
-
// jwt life duration
|
|
29
|
-
const duration =
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const { [Iat]: iat, [Exp]: exp, ...claims } = jsonwebtoken_1.default.decode(token);
|
|
31
|
+
// jwt life duration from claims
|
|
32
|
+
const duration = exp && iat ? exp - iat : this.duration;
|
|
33
|
+
const elapsed = Math.floor(Date.now() / 1000) - iat;
|
|
34
|
+
if (elapsed > duration / 2 && elapsed < duration) {
|
|
35
|
+
const exp = (0, dayjs_1.default)().add(duration, 'second').unix();
|
|
32
36
|
claims[Exp] = exp;
|
|
33
37
|
return jsonwebtoken_1.default.sign(claims, this.secret);
|
|
34
38
|
}
|
|
@@ -37,6 +41,9 @@ class JsonWebTokenSubjectProvider {
|
|
|
37
41
|
}
|
|
38
42
|
exports.JsonWebTokenSubjectProvider = JsonWebTokenSubjectProvider;
|
|
39
43
|
class JsonWebTokenAuthenticationProvider {
|
|
44
|
+
authenticationInfoManager;
|
|
45
|
+
secret;
|
|
46
|
+
duration;
|
|
40
47
|
constructor(kauthApi, kauthConfig) {
|
|
41
48
|
this.authenticationInfoManager = new manager_1.DelegatedAuthenticationInfoManager(kauthApi);
|
|
42
49
|
this.secret = kauthConfig.jwtSecret;
|
|
@@ -53,18 +60,21 @@ class JsonWebTokenAuthenticationProvider {
|
|
|
53
60
|
}
|
|
54
61
|
}
|
|
55
62
|
refresh(token) {
|
|
56
|
-
const { iat, ...claims } = jsonwebtoken_1.default.decode(token);
|
|
57
|
-
// jwt life duration
|
|
58
|
-
const duration =
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
const { [Iat]: iat, [Exp]: exp, ...claims } = jsonwebtoken_1.default.decode(token);
|
|
64
|
+
// jwt life duration from claims
|
|
65
|
+
const duration = exp && iat ? exp - iat : this.duration;
|
|
66
|
+
const elapsed = Math.floor(Date.now() / 1000) - iat;
|
|
67
|
+
if (elapsed > duration / 2 && elapsed < duration) {
|
|
68
|
+
const exp = (0, dayjs_1.default)().add(duration, 'second').unix();
|
|
61
69
|
claims[Exp] = exp;
|
|
62
70
|
return jsonwebtoken_1.default.sign(claims, this.secret);
|
|
63
71
|
}
|
|
64
72
|
return null;
|
|
65
73
|
}
|
|
66
|
-
authenticate(authenticationInformation) {
|
|
67
|
-
const exp = dayjs_1.default
|
|
74
|
+
authenticate(authenticationInformation, dynamicDuration) {
|
|
75
|
+
const exp = (0, dayjs_1.default)()
|
|
76
|
+
.add(dynamicDuration || this.duration, 'second')
|
|
77
|
+
.unix();
|
|
68
78
|
const claims = {};
|
|
69
79
|
claims[Exp] = exp;
|
|
70
80
|
if (!this.authenticationInfoManager.append(authenticationInformation, claims)) {
|
package/dist/authorizer/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermissionCore = void 0;
|
|
3
4
|
var permission_1 = require("./permission");
|
|
4
5
|
Object.defineProperty(exports, "PermissionCore", { enumerable: true, get: function () { return permission_1.PermissionCore; } });
|
|
@@ -5,11 +5,9 @@ const WildcardToken = '*';
|
|
|
5
5
|
const PartDividerToken = ':';
|
|
6
6
|
const SubpartDividerToken = ',';
|
|
7
7
|
class PermissionCore {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.parts = [];
|
|
12
|
-
}
|
|
8
|
+
// permission can:operation:a,b will be transformed to a certain structure,
|
|
9
|
+
// like [ { can: true }, { operation: true }, { a: true, b:true } ]
|
|
10
|
+
parts = [];
|
|
13
11
|
// A user's permission is stored by a string in the database.
|
|
14
12
|
//
|
|
15
13
|
// We should convert it to a certain structure, to make it comparable
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProcessUri = exports.CommitPreAuthorizationUri = exports.ProcessPreAuthorizationUri = exports.RefreshPreAuthorizationUri = exports.GetPreAuthorizationUri = exports.CreatePreAuthorizationUri = exports.BindRoleWithUsersUri = exports.BindRoleByPermissionsUri = exports.BindUsersByRoleNameAndExtendValueUri = exports.BindUserByRolesAndExtendValueUri = exports.BindUserByRoleNamesAndExtendValueUri = exports.BindUserByRolesUri = exports.UnbindRoleByPermissionUri = exports.BindRoleByPermissionUri = exports.CreatePermissionUri = exports.ListPermissionsByExtendValueUri = exports.ListPermissionsByUserIdUri = exports.ListPermissionsUri = exports.UpdateRolesWithPermissionsUri = exports.CreateRolesByUsersAndPermissionsUri = exports.UnbindUserByRoleUri = exports.BindUserByRoleUri = exports.CreateRoleUri = exports.ListRolesByNamesAndExtendValueUri = exports.ListRolesByUserIdUri = exports.ListRolesByExtendValueUri = exports.ListRolesUri = exports.GetRoleWithUsersUri = exports.ListUsersByPermissionNameAndExtendValueUri = exports.ListUsersByPermissionIdUri = exports.ListUsersByRoleNameAndExtendValueUri = exports.ListUsersByRoleIdUri = exports.ListUsersWithUserAccountsAndRolesByRoleExtendValueUri = exports.ListUsersWithUserAccountsAndRolesUri = exports.ListUsersUri = exports.SearchUsersWithUserAccountsAndRolesUri = exports.GetUserByIdUri = exports.UnbindUri = exports.MiniprogramAuthenticationInformationUri = exports.MiniprogramBindUri = exports.MiniprogramAuthenticateUri = exports.MiniprogramAuthorizeUri = exports.GoogleAuthenticationInformationUri = exports.GoogleBindUri = exports.GoogleAuthenticateUri = exports.GoogleAuthorizeUri = exports.MoziAuthenticationInformationUri = exports.MoziBindUri = exports.MoziAuthenticateUri = exports.MoziAuthorizeUri = void 0;
|
|
4
|
+
exports.CompleteGraphServiceTaskUri = exports.GetGraphStateMachineSnapshotUri = exports.StartGraphProcessUri = exports.GetProcinstUserUri = exports.InstanceUri = exports.ServiceTaskUri = void 0;
|
|
4
5
|
// kauth
|
|
5
6
|
exports.MoziAuthorizeUri = '/api/authenticator/mozi/authorizeUrl';
|
|
6
7
|
exports.MoziAuthenticateUri = '/api/authenticator/mozi/authenticate';
|
|
@@ -9,6 +9,8 @@ const http_1 = require("../constant/http");
|
|
|
9
9
|
const lru_cache_1 = __importDefault(require("lru-cache"));
|
|
10
10
|
let cache;
|
|
11
11
|
class KauthApi {
|
|
12
|
+
marmotUtil;
|
|
13
|
+
cache;
|
|
12
14
|
constructor({ kauthOrigin, marmotTenantId, marmotAccessKeyId, marmotAccessKeySecret, kauthServiceName, kauthServicePort, authCookieName, lruMaxAge = 2 * 1000, lruMax = 100, }) {
|
|
13
15
|
this.marmotUtil = new marmot_1.MarmotUtil(kauthOrigin, marmotTenantId, marmotAccessKeyId, marmotAccessKeySecret, kauthServiceName, kauthServicePort, authCookieName);
|
|
14
16
|
if (cache) {
|
|
@@ -4,6 +4,7 @@ exports.KflowApi = void 0;
|
|
|
4
4
|
const marmot_1 = require("./tool/marmot");
|
|
5
5
|
const http_1 = require("../constant/http");
|
|
6
6
|
class KflowApi {
|
|
7
|
+
marmotUtil;
|
|
7
8
|
constructor({ kflowOrigin, marmotTenantId, marmotAccessKeyId, marmotAccessKeySecret, kflowServiceName, kflowServicePort, }) {
|
|
8
9
|
this.marmotUtil = new marmot_1.MarmotUtil(kflowOrigin, marmotTenantId, marmotAccessKeyId, marmotAccessKeySecret, kflowServiceName, kflowServicePort);
|
|
9
10
|
}
|
|
@@ -23,7 +23,7 @@ export interface KflowCompleteTaskServiceRequest extends MarmotOptions {
|
|
|
23
23
|
candidateGroup?: string;
|
|
24
24
|
map: Object;
|
|
25
25
|
}
|
|
26
|
-
export
|
|
26
|
+
export type ProcinstUserActionType = 'startProcessInstance' | 'nextApprovers' | 'completeTaskService';
|
|
27
27
|
export interface KflowGetProcinstUserRequest extends MarmotOptions {
|
|
28
28
|
action: ProcinstUserActionType;
|
|
29
29
|
instanceId?: string;
|
|
@@ -5,4 +5,4 @@ var KauthPrincipalStatus;
|
|
|
5
5
|
(function (KauthPrincipalStatus) {
|
|
6
6
|
KauthPrincipalStatus[KauthPrincipalStatus["Normal"] = 0] = "Normal";
|
|
7
7
|
KauthPrincipalStatus[KauthPrincipalStatus["Locked"] = 1] = "Locked";
|
|
8
|
-
})(KauthPrincipalStatus
|
|
8
|
+
})(KauthPrincipalStatus || (exports.KauthPrincipalStatus = KauthPrincipalStatus = {}));
|
|
@@ -18,6 +18,22 @@ var BasicStatus;
|
|
|
18
18
|
BasicStatus[BasicStatus["InternalServerError"] = 10500] = "InternalServerError";
|
|
19
19
|
})(BasicStatus || (BasicStatus = {}));
|
|
20
20
|
class MarmotUtil {
|
|
21
|
+
// 基础字段
|
|
22
|
+
origin;
|
|
23
|
+
tenantId;
|
|
24
|
+
accessKeyId;
|
|
25
|
+
accessKeySecret;
|
|
26
|
+
serviceName;
|
|
27
|
+
servicePort;
|
|
28
|
+
proxyMatched;
|
|
29
|
+
// 上下文字段
|
|
30
|
+
userId;
|
|
31
|
+
traceId;
|
|
32
|
+
spanId;
|
|
33
|
+
// 测试环境专用,链路追踪
|
|
34
|
+
traceConsumers;
|
|
35
|
+
// cookie name
|
|
36
|
+
authCookieName;
|
|
21
37
|
constructor(origin, tenantId, accessKeyId, accessKeySecret, serviceName, servicePort, authCookieName) {
|
|
22
38
|
this.origin = origin.replace(/\/+$/, '');
|
|
23
39
|
this.tenantId = tenantId;
|
|
@@ -129,7 +145,7 @@ class MarmotUtil {
|
|
|
129
145
|
if (json.status !== BasicStatus.OK) {
|
|
130
146
|
throw new Error(json.message);
|
|
131
147
|
}
|
|
132
|
-
return camelcase_keys_1.default(json.body, {
|
|
148
|
+
return (0, camelcase_keys_1.default)(json.body, {
|
|
133
149
|
deep: true,
|
|
134
150
|
});
|
|
135
151
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.PermissionConverter = exports.MiniprogramCredential = exports.MiniprogramPrincipal = exports.MiniprogramAuthenticationInformation = exports.GoogleCredential = exports.GooglePrincipal = exports.GoogleAuthenticationInformation = exports.MoziCredential = exports.MoziPrincipal = exports.MoziAuthenticationInformation = exports.PermissionCore = exports.UserAccountType = exports.JsonWebTokenAuthenticationProvider = exports.JsonWebTokenSubjectProvider = exports.PrimaryPrincipal = exports.MiniprogramAuthenticator = exports.MoziAuthenticator = exports.GoogleAuthenticator = exports.KflowApi = exports.KauthApi = void 0;
|
|
13
18
|
var kauth_1 = require("./common/http/kauth");
|
|
14
19
|
Object.defineProperty(exports, "KauthApi", { enumerable: true, get: function () { return kauth_1.KauthApi; } });
|
|
15
20
|
var kflow_1 = require("./common/http/kflow");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kauth-sdk-node",
|
|
3
|
-
"version": "2.0.13-alpha.
|
|
3
|
+
"version": "2.0.13-alpha.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"prettier": "^2.2.1",
|
|
49
49
|
"sinon": "^9.0.2",
|
|
50
50
|
"ts-node": "^8.10.2",
|
|
51
|
-
"typescript": "^
|
|
51
|
+
"typescript": "^5.8.3"
|
|
52
52
|
},
|
|
53
53
|
"nyc": {
|
|
54
54
|
"include": [
|