@mondaydotcomorg/monday-authorization 3.5.0 → 3.5.1-debug-getprofile-not-resolving-to-internal-9f5fe0f
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/authorization-service.d.ts.map +1 -1
- package/dist/authorization-service.js +29 -7
- package/dist/clients/graph-api.d.ts.map +1 -1
- package/dist/clients/graph-api.js +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -0
- package/dist/esm/authorization-service.d.ts.map +1 -1
- package/dist/esm/authorization-service.mjs +29 -7
- package/dist/esm/clients/graph-api.d.ts.map +1 -1
- package/dist/esm/clients/graph-api.mjs +2 -1
- package/dist/esm/constants.d.ts +3 -0
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.mjs +5 -1
- package/package.json +1 -1
- package/src/authorization-service.ts +33 -11
- package/src/clients/graph-api.ts +2 -1
- package/src/constants.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-service.d.ts","sourceRoot":"","sources":["../src/authorization-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EAAmB,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG7F,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,0BAA0B,EAC1B,YAAY,EACb,MAAM,kCAAkC,CAAC;AAe1C,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED,wBAAgB,sBAAsB,CAAC,wBAAwB,EAAE,kBAAkB,QAElF;AAMD,qBA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,CAAC,EAAE,OAAO,CAAA;KAAO,GAC1C,OAAO,CAAC,OAAO,CAAC;mBAkBE,6BAA6B;IAclD,OAAO,CAAC,MAAM,CAAC,gBAAgB;WAIlB,gBAAgB,CAC3B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,kBAAkB,CAAC;IAM9B,OAAO,CAAC,MAAM,CAAC,UAAU;WA4CZ,wBAAwB,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;mBA4CnB,oBAAoB;mBAUpB,oBAAoB;CAmF1C;AAED,wBAAgB,cAAc,CAC5B,MAAM,KAAA,EACN,sCAAsC,GAAE,MAAiD,QAY1F;AAED,wBAAsB,eAAe,kBAMpC;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAepG"}
|
|
@@ -96,15 +96,37 @@ class AuthorizationService {
|
|
|
96
96
|
authorizationInternalService.logger.error({ tag: 'authorization-service' }, 'AuthorizationService: igniteClient is not set, failing request');
|
|
97
97
|
throw new Error('AuthorizationService: igniteClient is not set, failing request');
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
const allowedApps = this.igniteClient.configuration.getObjectValue(ALLOWED_SDK_PLATFORM_PROFILES_KEY, []);
|
|
100
|
+
const inReleaseApps = this.igniteClient.configuration.getObjectValue(IN_RELEASE_SDK_PLATFORM_PROFILES_KEY, []);
|
|
101
|
+
const isInAllowedApps = allowedApps.includes(appName);
|
|
102
|
+
const isInReleaseApps = inReleaseApps.includes(appName);
|
|
103
|
+
const isFeatureFlagReleased = this.igniteClient.isReleased(PLATFORM_PROFILE_RELEASE_FF, { accountId, userId });
|
|
104
|
+
const debugInfo = {
|
|
105
|
+
appName,
|
|
106
|
+
allowedApps,
|
|
107
|
+
inReleaseApps,
|
|
108
|
+
isInAllowedApps,
|
|
109
|
+
isInReleaseApps,
|
|
110
|
+
isFeatureFlagReleased,
|
|
111
|
+
accountId,
|
|
112
|
+
userId,
|
|
113
|
+
};
|
|
114
|
+
console.log('[AuthorizationService.getProfile] Debug info:', debugInfo);
|
|
115
|
+
authorizationInternalService.logger.info({ tag: 'authorization-service', ...debugInfo }, 'AuthorizationService.getProfile debug info');
|
|
116
|
+
if (isInAllowedApps) {
|
|
117
|
+
const profile = attributionsService.getProfile();
|
|
118
|
+
console.log('[AuthorizationService.getProfile] Returning profile from ALLOWED_SDK_PLATFORM_PROFILES_KEY:', profile);
|
|
119
|
+
authorizationInternalService.logger.info({ tag: 'authorization-service', profile }, 'Returning profile from ALLOWED_SDK_PLATFORM_PROFILES_KEY');
|
|
120
|
+
return profile;
|
|
101
121
|
}
|
|
102
|
-
if (
|
|
103
|
-
.
|
|
104
|
-
.
|
|
105
|
-
|
|
106
|
-
return
|
|
122
|
+
if (isInReleaseApps && isFeatureFlagReleased) {
|
|
123
|
+
const profile = attributionsService.getProfile();
|
|
124
|
+
console.log('[AuthorizationService.getProfile] Returning profile from IN_RELEASE_SDK_PLATFORM_PROFILES_KEY:', profile);
|
|
125
|
+
authorizationInternalService.logger.info({ tag: 'authorization-service', profile }, 'Returning profile from IN_RELEASE_SDK_PLATFORM_PROFILES_KEY');
|
|
126
|
+
return profile;
|
|
107
127
|
}
|
|
128
|
+
console.log('[AuthorizationService.getProfile] Returning default PlatformProfile.APP');
|
|
129
|
+
authorizationInternalService.logger.info({ tag: 'authorization-service', profile: attributionsService.PlatformProfile.APP }, 'Returning default PlatformProfile.APP');
|
|
108
130
|
return attributionsService.PlatformProfile.APP;
|
|
109
131
|
}
|
|
110
132
|
static async canActionInScopeMultiple(accountId, userId, scopedActions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-api.d.ts","sourceRoot":"","sources":["../../src/clients/graph-api.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,0BAA0B,EAG3B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAEL,sBAAsB,EAMvB,MAAM,0BAA0B,CAAC;AAQlC;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;;IAezC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAyB/B;;OAEG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"graph-api.d.ts","sourceRoot":"","sources":["../../src/clients/graph-api.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,0BAA0B,EAG3B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAEL,sBAAsB,EAMvB,MAAM,0BAA0B,CAAC;AAQlC;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;;IAezC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAyB/B;;OAEG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAiCzG;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAiC1B;;OAEG;IACG,gBAAgB,CACpB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAMxC,OAAO,CAAC,MAAM,CAAC,iBAAiB;CAWjC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { RecursivePartial } from '@mondaydotcomorg/monday-fetch-api';
|
|
|
2
2
|
import { FetcherConfig } from '@mondaydotcomorg/trident-backend-api';
|
|
3
3
|
export declare const APP_NAME = "authorization";
|
|
4
4
|
export declare const GRAPH_APP_NAME = "authorization-graph";
|
|
5
|
+
export declare enum GraphApiProfile {
|
|
6
|
+
PERMISSION = "authorization-graph-permission"
|
|
7
|
+
}
|
|
5
8
|
export declare const ERROR_MESSAGES: {
|
|
6
9
|
readonly HTTP_CLIENT_NOT_INITIALIZED: "MondayAuthorization: HTTP client is not initialized";
|
|
7
10
|
readonly REQUEST_FAILED: (method: string, status: number, reason: string) => string;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AACxC,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,eAAO,MAAM,cAAc;;sCAEA,MAAM,UAAU,MAAM,UAAU,MAAM;CAEvD,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,aAAa,CAUjE,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AACxC,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,oBAAY,eAAe;IACzB,UAAU,mCAAmC;CAC9C;AAED,eAAO,MAAM,cAAc;;sCAEA,MAAM,UAAU,MAAM,UAAU,MAAM;CAEvD,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,aAAa,CAUjE,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -2,6 +2,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const APP_NAME = 'authorization';
|
|
4
4
|
const GRAPH_APP_NAME = 'authorization-graph';
|
|
5
|
+
exports.GraphApiProfile = void 0;
|
|
6
|
+
(function (GraphApiProfile) {
|
|
7
|
+
GraphApiProfile["PERMISSION"] = "authorization-graph-permission";
|
|
8
|
+
})(exports.GraphApiProfile || (exports.GraphApiProfile = {}));
|
|
5
9
|
const ERROR_MESSAGES = {
|
|
6
10
|
HTTP_CLIENT_NOT_INITIALIZED: 'MondayAuthorization: HTTP client is not initialized',
|
|
7
11
|
REQUEST_FAILED: (method, status, reason) => `MondayAuthorization: [${method}] request failed with status ${status} with reason: ${reason}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-service.d.ts","sourceRoot":"","sources":["../../src/authorization-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EAAmB,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG7F,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,0BAA0B,EAC1B,YAAY,EACb,MAAM,kCAAkC,CAAC;AAe1C,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED,wBAAgB,sBAAsB,CAAC,wBAAwB,EAAE,kBAAkB,QAElF;AAMD,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,KAAK,QAAQ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AC,OAAO,CAAC;mBAkBE,6BAA6B;IAclD,OAAO,CAAC,MAAM,CAAC,gBAAgB;WAIlB,gBAAgB,CAC3B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,kBAAkB,CAAC;IAM9B,OAAO,CAAC,MAAM,CAAC,UAAU;WA4CZ,wBAAwB,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;mBA4CnB,oBAAoB;mBAUpB,oBAAoB;CAmF1C;AAED,wBAAgB,cAAc,CAC5B,MAAM,KAAA,EACN,sCAAsC,GAAE,MAAiD,QAY1F;AAED,wBAAsB,eAAe,kBAMpC;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAepG"}
|
|
@@ -94,15 +94,37 @@ class AuthorizationService {
|
|
|
94
94
|
logger.error({ tag: 'authorization-service' }, 'AuthorizationService: igniteClient is not set, failing request');
|
|
95
95
|
throw new Error('AuthorizationService: igniteClient is not set, failing request');
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
const allowedApps = this.igniteClient.configuration.getObjectValue(ALLOWED_SDK_PLATFORM_PROFILES_KEY, []);
|
|
98
|
+
const inReleaseApps = this.igniteClient.configuration.getObjectValue(IN_RELEASE_SDK_PLATFORM_PROFILES_KEY, []);
|
|
99
|
+
const isInAllowedApps = allowedApps.includes(appName);
|
|
100
|
+
const isInReleaseApps = inReleaseApps.includes(appName);
|
|
101
|
+
const isFeatureFlagReleased = this.igniteClient.isReleased(PLATFORM_PROFILE_RELEASE_FF, { accountId, userId });
|
|
102
|
+
const debugInfo = {
|
|
103
|
+
appName,
|
|
104
|
+
allowedApps,
|
|
105
|
+
inReleaseApps,
|
|
106
|
+
isInAllowedApps,
|
|
107
|
+
isInReleaseApps,
|
|
108
|
+
isFeatureFlagReleased,
|
|
109
|
+
accountId,
|
|
110
|
+
userId,
|
|
111
|
+
};
|
|
112
|
+
console.log('[AuthorizationService.getProfile] Debug info:', debugInfo);
|
|
113
|
+
logger.info({ tag: 'authorization-service', ...debugInfo }, 'AuthorizationService.getProfile debug info');
|
|
114
|
+
if (isInAllowedApps) {
|
|
115
|
+
const profile = getProfile();
|
|
116
|
+
console.log('[AuthorizationService.getProfile] Returning profile from ALLOWED_SDK_PLATFORM_PROFILES_KEY:', profile);
|
|
117
|
+
logger.info({ tag: 'authorization-service', profile }, 'Returning profile from ALLOWED_SDK_PLATFORM_PROFILES_KEY');
|
|
118
|
+
return profile;
|
|
99
119
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
.
|
|
103
|
-
|
|
104
|
-
return
|
|
120
|
+
if (isInReleaseApps && isFeatureFlagReleased) {
|
|
121
|
+
const profile = getProfile();
|
|
122
|
+
console.log('[AuthorizationService.getProfile] Returning profile from IN_RELEASE_SDK_PLATFORM_PROFILES_KEY:', profile);
|
|
123
|
+
logger.info({ tag: 'authorization-service', profile }, 'Returning profile from IN_RELEASE_SDK_PLATFORM_PROFILES_KEY');
|
|
124
|
+
return profile;
|
|
105
125
|
}
|
|
126
|
+
console.log('[AuthorizationService.getProfile] Returning default PlatformProfile.APP');
|
|
127
|
+
logger.info({ tag: 'authorization-service', profile: PlatformProfile.APP }, 'Returning default PlatformProfile.APP');
|
|
106
128
|
return PlatformProfile.APP;
|
|
107
129
|
}
|
|
108
130
|
static async canActionInScopeMultiple(accountId, userId, scopedActions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-api.d.ts","sourceRoot":"","sources":["../../../src/clients/graph-api.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,0BAA0B,EAG3B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAEL,sBAAsB,EAMvB,MAAM,0BAA0B,CAAC;AAQlC;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;;IAezC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAyB/B;;OAEG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"graph-api.d.ts","sourceRoot":"","sources":["../../../src/clients/graph-api.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,0BAA0B,EAG3B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAEL,sBAAsB,EAMvB,MAAM,0BAA0B,CAAC;AAQlC;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;;IAezC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAyB/B;;OAEG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAiCzG;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAiC1B;;OAEG;IACG,gBAAgB,CACpB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAMxC,OAAO,CAAC,MAAM,CAAC,iBAAiB;CAWjC"}
|
|
@@ -4,7 +4,7 @@ import { PermitTechnicalReason } from '../types/scoped-actions-contracts.mjs';
|
|
|
4
4
|
import { AuthorizationInternalService } from '../authorization-internal-service.mjs';
|
|
5
5
|
import { getAttributionsFromApi } from '../attributions-service.mjs';
|
|
6
6
|
import { scopeToResource } from '../utils/authorization.utils.mjs';
|
|
7
|
-
import { GRAPH_APP_NAME } from '../constants.mjs';
|
|
7
|
+
import { GRAPH_APP_NAME, GraphApiProfile } from '../constants.mjs';
|
|
8
8
|
import { handleApiError } from '../utils/api-error-handler.mjs';
|
|
9
9
|
|
|
10
10
|
const CAN_ACTION_IN_SCOPE_GRAPH_PATH = '/permissions/is-allowed';
|
|
@@ -63,6 +63,7 @@ class GraphApi {
|
|
|
63
63
|
url: {
|
|
64
64
|
appName: GRAPH_APP_NAME,
|
|
65
65
|
path: CAN_ACTION_IN_SCOPE_GRAPH_PATH,
|
|
66
|
+
profile: GraphApiProfile.PERMISSION,
|
|
66
67
|
},
|
|
67
68
|
method: 'POST',
|
|
68
69
|
headers: {
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { RecursivePartial } from '@mondaydotcomorg/monday-fetch-api';
|
|
|
2
2
|
import { FetcherConfig } from '@mondaydotcomorg/trident-backend-api';
|
|
3
3
|
export declare const APP_NAME = "authorization";
|
|
4
4
|
export declare const GRAPH_APP_NAME = "authorization-graph";
|
|
5
|
+
export declare enum GraphApiProfile {
|
|
6
|
+
PERMISSION = "authorization-graph-permission"
|
|
7
|
+
}
|
|
5
8
|
export declare const ERROR_MESSAGES: {
|
|
6
9
|
readonly HTTP_CLIENT_NOT_INITIALIZED: "MondayAuthorization: HTTP client is not initialized";
|
|
7
10
|
readonly REQUEST_FAILED: (method: string, status: number, reason: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AACxC,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,eAAO,MAAM,cAAc;;sCAEA,MAAM,UAAU,MAAM,UAAU,MAAM;CAEvD,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,aAAa,CAUjE,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AACxC,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,oBAAY,eAAe;IACzB,UAAU,mCAAmC;CAC9C;AAED,eAAO,MAAM,cAAc;;sCAEA,MAAM,UAAU,MAAM,UAAU,MAAM;CAEvD,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,aAAa,CAUjE,CAAC"}
|
package/dist/esm/constants.mjs
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
const APP_NAME = 'authorization';
|
|
2
2
|
const GRAPH_APP_NAME = 'authorization-graph';
|
|
3
|
+
var GraphApiProfile;
|
|
4
|
+
(function (GraphApiProfile) {
|
|
5
|
+
GraphApiProfile["PERMISSION"] = "authorization-graph-permission";
|
|
6
|
+
})(GraphApiProfile || (GraphApiProfile = {}));
|
|
3
7
|
const ERROR_MESSAGES = {
|
|
4
8
|
HTTP_CLIENT_NOT_INITIALIZED: 'MondayAuthorization: HTTP client is not initialized',
|
|
5
9
|
REQUEST_FAILED: (method, status, reason) => `MondayAuthorization: [${method}] request failed with status ${status} with reason: ${reason}`,
|
|
@@ -16,4 +20,4 @@ const DEFAULT_FETCH_OPTIONS = {
|
|
|
16
20
|
},
|
|
17
21
|
};
|
|
18
22
|
|
|
19
|
-
export { APP_NAME, DEFAULT_FETCH_OPTIONS, ERROR_MESSAGES, GRAPH_APP_NAME };
|
|
23
|
+
export { APP_NAME, DEFAULT_FETCH_OPTIONS, ERROR_MESSAGES, GRAPH_APP_NAME, GraphApiProfile };
|
package/package.json
CHANGED
|
@@ -155,19 +155,41 @@ export class AuthorizationService {
|
|
|
155
155
|
logger.error({ tag: 'authorization-service' }, 'AuthorizationService: igniteClient is not set, failing request');
|
|
156
156
|
throw new Error('AuthorizationService: igniteClient is not set, failing request');
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
)
|
|
161
|
-
|
|
158
|
+
|
|
159
|
+
const allowedApps = this.igniteClient.configuration.getObjectValue<string[]>(ALLOWED_SDK_PLATFORM_PROFILES_KEY, []);
|
|
160
|
+
const inReleaseApps = this.igniteClient.configuration.getObjectValue<string[]>(IN_RELEASE_SDK_PLATFORM_PROFILES_KEY, []);
|
|
161
|
+
const isInAllowedApps = allowedApps.includes(appName);
|
|
162
|
+
const isInReleaseApps = inReleaseApps.includes(appName);
|
|
163
|
+
const isFeatureFlagReleased = this.igniteClient.isReleased(PLATFORM_PROFILE_RELEASE_FF, { accountId, userId });
|
|
164
|
+
|
|
165
|
+
const debugInfo = {
|
|
166
|
+
appName,
|
|
167
|
+
allowedApps,
|
|
168
|
+
inReleaseApps,
|
|
169
|
+
isInAllowedApps,
|
|
170
|
+
isInReleaseApps,
|
|
171
|
+
isFeatureFlagReleased,
|
|
172
|
+
accountId,
|
|
173
|
+
userId,
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
console.log('[AuthorizationService.getProfile] Debug info:', debugInfo);
|
|
177
|
+
logger.info({ tag: 'authorization-service', ...debugInfo }, 'AuthorizationService.getProfile debug info');
|
|
178
|
+
|
|
179
|
+
if (isInAllowedApps) {
|
|
180
|
+
const profile = getProfile();
|
|
181
|
+
console.log('[AuthorizationService.getProfile] Returning profile from ALLOWED_SDK_PLATFORM_PROFILES_KEY:', profile);
|
|
182
|
+
logger.info({ tag: 'authorization-service', profile }, 'Returning profile from ALLOWED_SDK_PLATFORM_PROFILES_KEY');
|
|
183
|
+
return profile;
|
|
162
184
|
}
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
) {
|
|
169
|
-
return getProfile();
|
|
185
|
+
if (isInReleaseApps && isFeatureFlagReleased) {
|
|
186
|
+
const profile = getProfile();
|
|
187
|
+
console.log('[AuthorizationService.getProfile] Returning profile from IN_RELEASE_SDK_PLATFORM_PROFILES_KEY:', profile);
|
|
188
|
+
logger.info({ tag: 'authorization-service', profile }, 'Returning profile from IN_RELEASE_SDK_PLATFORM_PROFILES_KEY');
|
|
189
|
+
return profile;
|
|
170
190
|
}
|
|
191
|
+
console.log('[AuthorizationService.getProfile] Returning default PlatformProfile.APP');
|
|
192
|
+
logger.info({ tag: 'authorization-service', profile: PlatformProfile.APP }, 'Returning default PlatformProfile.APP');
|
|
171
193
|
return PlatformProfile.APP;
|
|
172
194
|
}
|
|
173
195
|
|
package/src/clients/graph-api.ts
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
GraphPermissionReason,
|
|
19
19
|
} from '../types/graph-api.types';
|
|
20
20
|
import { scopeToResource } from '../utils/authorization.utils';
|
|
21
|
-
import { GRAPH_APP_NAME } from '../constants';
|
|
21
|
+
import { GRAPH_APP_NAME, GraphApiProfile } from '../constants';
|
|
22
22
|
import { handleApiError } from '../utils/api-error-handler';
|
|
23
23
|
|
|
24
24
|
const CAN_ACTION_IN_SCOPE_GRAPH_PATH = '/permissions/is-allowed';
|
|
@@ -85,6 +85,7 @@ export class GraphApi {
|
|
|
85
85
|
url: {
|
|
86
86
|
appName: GRAPH_APP_NAME,
|
|
87
87
|
path: CAN_ACTION_IN_SCOPE_GRAPH_PATH,
|
|
88
|
+
profile: GraphApiProfile.PERMISSION,
|
|
88
89
|
},
|
|
89
90
|
method: 'POST',
|
|
90
91
|
headers: {
|
package/src/constants.ts
CHANGED
|
@@ -4,6 +4,10 @@ import { FetcherConfig } from '@mondaydotcomorg/trident-backend-api';
|
|
|
4
4
|
export const APP_NAME = 'authorization';
|
|
5
5
|
export const GRAPH_APP_NAME = 'authorization-graph';
|
|
6
6
|
|
|
7
|
+
export enum GraphApiProfile {
|
|
8
|
+
PERMISSION = 'authorization-graph-permission',
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
export const ERROR_MESSAGES = {
|
|
8
12
|
HTTP_CLIENT_NOT_INITIALIZED: 'MondayAuthorization: HTTP client is not initialized',
|
|
9
13
|
REQUEST_FAILED: (method: string, status: number, reason: string) =>
|