mftsccs-node 0.0.81-dev → 0.0.83-dev
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
@@ -83,6 +83,16 @@ export declare class TokenStorage {
|
|
|
83
83
|
* @type {number}
|
|
84
84
|
*/
|
|
85
85
|
static EXPIRY_BUFFER_MS: number;
|
|
86
|
+
/**
|
|
87
|
+
* Fallback owning-user identity, populated from the claims of the
|
|
88
|
+
* client-credentials access token obtained via CLIENT_ID/CLIENT_SECRET.
|
|
89
|
+
* Used only when a caller does not pass an explicit userId.
|
|
90
|
+
* @static
|
|
91
|
+
*/
|
|
92
|
+
static DEFAULT_USER_ID: number;
|
|
93
|
+
static DEFAULT_USER_CONCEPT_ID: number;
|
|
94
|
+
static DEFAULT_ENTITY_ID: number;
|
|
95
|
+
static DEFAULT_SESSION_ID: number;
|
|
86
96
|
/**
|
|
87
97
|
* Gets authorization header object for HTTP requests.
|
|
88
98
|
* @returns {Record<string, string>} Headers object with Authorization header if token exists
|
|
@@ -122,4 +132,12 @@ export declare class TokenStorage {
|
|
|
122
132
|
* @param applicationName - Application name
|
|
123
133
|
*/
|
|
124
134
|
static setOAuthCredentials(clientId: string, clientSecret: string, applicationName: string): void;
|
|
135
|
+
/**
|
|
136
|
+
* Sets the fallback owning-user identity decoded from an access token's claims.
|
|
137
|
+
* @param userId - unique_name claim: the owning application's own user id
|
|
138
|
+
* @param userConceptId - upn claim: the owning user's concept id in the CCS graph
|
|
139
|
+
* @param entityId - EntityId claim
|
|
140
|
+
* @param sessionId - primarysid claim
|
|
141
|
+
*/
|
|
142
|
+
static setDefaultIdentity(userId: number, userConceptId: number, entityId: number, sessionId: number): void;
|
|
125
143
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ResolveUserId
|
|
3
|
+
* @description Resolves the owning-user concept id for a concept/connection creation call.
|
|
4
|
+
* Priority: explicitly passed userId > the default identity decoded from the
|
|
5
|
+
* client-credentials access token (TokenStorage.DEFAULT_USER_CONCEPT_ID) > the
|
|
6
|
+
* legacy system placeholder id (999).
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveUserId(passedUserId?: number): number;
|