@mondaydotcomorg/monday-authorization 3.3.0-feature-bashanye-navigate-can-action-in-scope-to-graph-961c081 → 3.3.0-feature-bashanye-navigate-can-action-in-scope-to-graph-06ad41c
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 +8 -17
- package/dist/clients/graph-api.client.d.ts.map +1 -1
- package/dist/clients/graph-api.client.js +1 -3
- package/dist/clients/platform-api.client.d.ts.map +1 -1
- package/dist/clients/platform-api.client.js +2 -1
- package/dist/esm/authorization-service.d.ts.map +1 -1
- package/dist/esm/authorization-service.mjs +8 -17
- package/dist/esm/clients/graph-api.client.d.ts.map +1 -1
- package/dist/esm/clients/graph-api.client.mjs +2 -4
- package/dist/esm/clients/platform-api.client.d.ts.map +1 -1
- package/dist/esm/clients/platform-api.client.mjs +2 -1
- package/dist/esm/prometheus-service.d.ts +2 -3
- package/dist/esm/prometheus-service.d.ts.map +1 -1
- package/dist/esm/prometheus-service.mjs +7 -25
- package/dist/prometheus-service.d.ts +2 -3
- package/dist/prometheus-service.d.ts.map +1 -1
- package/dist/prometheus-service.js +6 -25
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-service.d.ts","sourceRoot":"","sources":["../src/authorization-service.ts"],"names":[],"mappings":"
|
|
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;AAE7F,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,MAAM,CAAC,WAAW,CAAC,MAAC;IACpB,MAAM,CAAC,sCAAsC,CAAC,EAAE,MAAM,CAAC;IACvD,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IAEnC;;;OAGG;WACU,YAAY,CACvB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EAAE,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC;WAEhB,YAAY,CACvB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,2BAA2B,EAAE,mBAAmB,EAAE,GACjD,OAAO,CAAC,iBAAiB,CAAC;IAY7B;;;OAGG;WACU,wBAAwB,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;QAAE,eAAe,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;WAsBZ,wBAAwB,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;mBAyDnB,oBAAoB;mBAUpB,oBAAoB;CAoF1C;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"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
3
|
const perf_hooks = require('perf_hooks');
|
|
4
|
-
const path = require('path');
|
|
5
4
|
const tridentBackendApi = require('@mondaydotcomorg/trident-backend-api');
|
|
6
5
|
const mondayFetchApi = require('@mondaydotcomorg/monday-fetch-api');
|
|
7
6
|
const igniteSdk = require('@mondaydotcomorg/ignite-sdk');
|
|
@@ -94,33 +93,31 @@ class AuthorizationService {
|
|
|
94
93
|
const internalAuthToken = authorizationInternalService.AuthorizationInternalService.generateInternalAuthToken(accountId, userId);
|
|
95
94
|
const startTime = perf_hooks.performance.now();
|
|
96
95
|
let scopedActionResponseObjects;
|
|
97
|
-
let
|
|
96
|
+
let apiType;
|
|
98
97
|
if (shouldNavigateToGraph) {
|
|
99
98
|
try {
|
|
100
99
|
scopedActionResponseObjects = await clients_graphApi_client.GraphApiClient.checkPermissions(internalAuthToken, scopedActions);
|
|
101
|
-
|
|
100
|
+
apiType = 'graph';
|
|
102
101
|
}
|
|
103
102
|
catch (error) {
|
|
104
|
-
|
|
103
|
+
const status = error instanceof mondayFetchApi.HttpFetcherError ? error.status : undefined;
|
|
105
104
|
authorizationInternalService.logger.warn({
|
|
106
105
|
tag: 'authorization-service',
|
|
107
106
|
error: error instanceof Error ? error.message : String(error),
|
|
108
107
|
accountId,
|
|
109
108
|
userId,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
usedGraphApi = false;
|
|
109
|
+
status,
|
|
110
|
+
}, 'Graph API authorization failed');
|
|
111
|
+
throw error;
|
|
114
112
|
}
|
|
115
113
|
}
|
|
116
114
|
else {
|
|
117
115
|
const profile = this.getProfile(accountId, userId);
|
|
118
116
|
scopedActionResponseObjects = await clients_platformApi_client.PlatformApiClient.checkPermissions(profile, internalAuthToken, userId, scopedActions);
|
|
119
|
-
|
|
117
|
+
apiType = 'platform';
|
|
120
118
|
}
|
|
121
119
|
const endTime = perf_hooks.performance.now();
|
|
122
120
|
const time = endTime - startTime;
|
|
123
|
-
const apiType = usedGraphApi ? 'graph' : 'platform';
|
|
124
121
|
// Record metrics for each authorization check
|
|
125
122
|
for (const obj of scopedActionResponseObjects) {
|
|
126
123
|
const { action, scope } = obj.scopedAction;
|
|
@@ -128,7 +125,7 @@ class AuthorizationService {
|
|
|
128
125
|
const isAuthorized = obj.permit.can;
|
|
129
126
|
prometheusService.sendAuthorizationCheckResponseTimeMetric(resourceType, action, isAuthorized, 200, time, apiType);
|
|
130
127
|
if (obj.permit.can) {
|
|
131
|
-
prometheusService.incrementAuthorizationSuccess(resourceType, action);
|
|
128
|
+
prometheusService.incrementAuthorizationSuccess(resourceType, action, apiType);
|
|
132
129
|
}
|
|
133
130
|
}
|
|
134
131
|
return scopedActionResponseObjects;
|
|
@@ -210,15 +207,9 @@ function setRedisClient(client, grantedFeatureRedisExpirationInSeconds = GRANTED
|
|
|
210
207
|
AuthorizationService.grantedFeatureRedisExpirationInSeconds = GRANTED_FEATURE_CACHE_EXPIRATION_SECONDS;
|
|
211
208
|
}
|
|
212
209
|
}
|
|
213
|
-
function getPackageRoot() {
|
|
214
|
-
return path.join(__dirname, '..');
|
|
215
|
-
}
|
|
216
210
|
async function setIgniteClient() {
|
|
217
|
-
const packageRoot = getPackageRoot();
|
|
218
|
-
const localOverridesPath = path.join(packageRoot, 'ignite-local-overrides.json');
|
|
219
211
|
const igniteClient = await igniteSdk.getIgniteClient({
|
|
220
212
|
namespace: ['authorization-sdk'],
|
|
221
|
-
localOverridesPath,
|
|
222
213
|
});
|
|
223
214
|
AuthorizationService.igniteClient = igniteClient;
|
|
224
215
|
authorizationInternalService.AuthorizationInternalService.setIgniteClient(igniteClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-api.client.d.ts","sourceRoot":"","sources":["../../src/clients/graph-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,0BAA0B,EAG3B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EAIvB,MAAM,0BAA0B,CAAC;AAMlC;;GAEG;AACH,qBAAa,cAAc;IACzB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,iBAAiB;IAyBzE;;OAEG;WACU,gBAAgB,CAC3B,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"graph-api.client.d.ts","sourceRoot":"","sources":["../../src/clients/graph-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,0BAA0B,EAG3B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EAIvB,MAAM,0BAA0B,CAAC;AAMlC;;GAEG;AACH,qBAAa,cAAc;IACzB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,iBAAiB;IAyBzE;;OAEG;WACU,gBAAgB,CAC3B,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAyClC;;OAEG;IACH,MAAM,CAAC,WAAW,CAChB,aAAa,EAAE,YAAY,EAAE,EAC7B,aAAa,EAAE,sBAAsB,GACpC,0BAA0B,EAAE;IAsC/B;;OAEG;WACU,gBAAgB,CAC3B,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;CAIzC"}
|
|
@@ -62,14 +62,12 @@ class GraphApiClient {
|
|
|
62
62
|
timeout: authorizationInternalService.AuthorizationInternalService.getRequestTimeout(),
|
|
63
63
|
retryPolicy: authorizationInternalService.AuthorizationInternalService.getRetriesPolicy(),
|
|
64
64
|
});
|
|
65
|
-
prometheusService.setGraphAvailability(true);
|
|
66
65
|
return response;
|
|
67
66
|
}
|
|
68
67
|
catch (err) {
|
|
69
|
-
prometheusService.setGraphAvailability(false);
|
|
70
68
|
if (err instanceof mondayFetchApi.HttpFetcherError) {
|
|
71
69
|
authorizationInternalService.AuthorizationInternalService.throwOnHttpError(err.status, 'canActionInScopeMultiple');
|
|
72
|
-
prometheusService.incrementAuthorizationError(utils_authorization_utils.scopeToResource(scopedActions[0].scope).resourceType, scopedActions[0].action, err.status);
|
|
70
|
+
prometheusService.incrementAuthorizationError(utils_authorization_utils.scopeToResource(scopedActions[0].scope).resourceType, scopedActions[0].action, err.status, 'graph');
|
|
73
71
|
}
|
|
74
72
|
throw err;
|
|
75
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-api.client.d.ts","sourceRoot":"","sources":["../../src/clients/platform-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE7F,OAAO,EAA0B,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAOlF,KAAK,2BAA2B,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,UAAU,0BAA0B;IAClC,MAAM,EAAE,0BAA0B,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,2BAA2B,EAAE;IAOxF;;OAEG;WACU,gBAAgB,CAC3B,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,2BAA2B,EAAE,GAClD,OAAO,CAAC,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-api.client.d.ts","sourceRoot":"","sources":["../../src/clients/platform-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE7F,OAAO,EAA0B,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAOlF,KAAK,2BAA2B,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,UAAU,0BAA0B;IAClC,MAAM,EAAE,0BAA0B,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,2BAA2B,EAAE;IAOxF;;OAEG;WACU,gBAAgB,CAC3B,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,2BAA2B,EAAE,GAClD,OAAO,CAAC,0BAA0B,CAAC;IAqCtC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,0BAA0B,GAAG,0BAA0B,EAAE;IAkBtF;;OAEG;WACU,gBAAgB,CAC3B,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;CAKzC"}
|
|
@@ -50,7 +50,8 @@ class PlatformApiClient {
|
|
|
50
50
|
catch (err) {
|
|
51
51
|
if (err instanceof mondayFetchApi.HttpFetcherError) {
|
|
52
52
|
authorizationInternalService.AuthorizationInternalService.throwOnHttpError(err.status, 'canActionInScopeMultiple');
|
|
53
|
-
|
|
53
|
+
const { resourceType } = utils_authorization_utils.scopeToResource(utils_authorization_utils.toCamelCase(scopedActionsPayload[0].scope));
|
|
54
|
+
prometheusService.incrementAuthorizationError(resourceType, scopedActionsPayload[0].action, err.status, 'platform');
|
|
54
55
|
}
|
|
55
56
|
throw err;
|
|
56
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-service.d.ts","sourceRoot":"","sources":["../../src/authorization-service.ts"],"names":[],"mappings":"
|
|
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;AAE7F,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,MAAM,CAAC,WAAW,CAAC,MAAC;IACpB,MAAM,CAAC,sCAAsC,CAAC,EAAE,MAAM,CAAC;IACvD,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IAEnC;;;OAGG;WACU,YAAY,CACvB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EAAE,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC;WAEhB,YAAY,CACvB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,2BAA2B,EAAE,mBAAmB,EAAE,GACjD,OAAO,CAAC,iBAAiB,CAAC;IAY7B;;;OAGG;WACU,wBAAwB,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;QAAE,eAAe,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;WAsBZ,wBAAwB,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;mBAyDnB,oBAAoB;mBAUpB,oBAAoB;CAoF1C;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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { performance } from 'perf_hooks';
|
|
2
|
-
import { join } from 'path';
|
|
3
2
|
import { Api } from '@mondaydotcomorg/trident-backend-api';
|
|
4
3
|
import { HttpFetcherError } from '@mondaydotcomorg/monday-fetch-api';
|
|
5
4
|
import { getIgniteClient } from '@mondaydotcomorg/ignite-sdk';
|
|
@@ -92,33 +91,31 @@ class AuthorizationService {
|
|
|
92
91
|
const internalAuthToken = AuthorizationInternalService.generateInternalAuthToken(accountId, userId);
|
|
93
92
|
const startTime = performance.now();
|
|
94
93
|
let scopedActionResponseObjects;
|
|
95
|
-
let
|
|
94
|
+
let apiType;
|
|
96
95
|
if (shouldNavigateToGraph) {
|
|
97
96
|
try {
|
|
98
97
|
scopedActionResponseObjects = await GraphApiClient.checkPermissions(internalAuthToken, scopedActions);
|
|
99
|
-
|
|
98
|
+
apiType = 'graph';
|
|
100
99
|
}
|
|
101
100
|
catch (error) {
|
|
102
|
-
|
|
101
|
+
const status = error instanceof HttpFetcherError ? error.status : undefined;
|
|
103
102
|
logger.warn({
|
|
104
103
|
tag: 'authorization-service',
|
|
105
104
|
error: error instanceof Error ? error.message : String(error),
|
|
106
105
|
accountId,
|
|
107
106
|
userId,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
usedGraphApi = false;
|
|
107
|
+
status,
|
|
108
|
+
}, 'Graph API authorization failed');
|
|
109
|
+
throw error;
|
|
112
110
|
}
|
|
113
111
|
}
|
|
114
112
|
else {
|
|
115
113
|
const profile = this.getProfile(accountId, userId);
|
|
116
114
|
scopedActionResponseObjects = await PlatformApiClient.checkPermissions(profile, internalAuthToken, userId, scopedActions);
|
|
117
|
-
|
|
115
|
+
apiType = 'platform';
|
|
118
116
|
}
|
|
119
117
|
const endTime = performance.now();
|
|
120
118
|
const time = endTime - startTime;
|
|
121
|
-
const apiType = usedGraphApi ? 'graph' : 'platform';
|
|
122
119
|
// Record metrics for each authorization check
|
|
123
120
|
for (const obj of scopedActionResponseObjects) {
|
|
124
121
|
const { action, scope } = obj.scopedAction;
|
|
@@ -126,7 +123,7 @@ class AuthorizationService {
|
|
|
126
123
|
const isAuthorized = obj.permit.can;
|
|
127
124
|
sendAuthorizationCheckResponseTimeMetric(resourceType, action, isAuthorized, 200, time, apiType);
|
|
128
125
|
if (obj.permit.can) {
|
|
129
|
-
incrementAuthorizationSuccess(resourceType, action);
|
|
126
|
+
incrementAuthorizationSuccess(resourceType, action, apiType);
|
|
130
127
|
}
|
|
131
128
|
}
|
|
132
129
|
return scopedActionResponseObjects;
|
|
@@ -208,15 +205,9 @@ function setRedisClient(client, grantedFeatureRedisExpirationInSeconds = GRANTED
|
|
|
208
205
|
AuthorizationService.grantedFeatureRedisExpirationInSeconds = GRANTED_FEATURE_CACHE_EXPIRATION_SECONDS;
|
|
209
206
|
}
|
|
210
207
|
}
|
|
211
|
-
function getPackageRoot() {
|
|
212
|
-
return join(__dirname, '..');
|
|
213
|
-
}
|
|
214
208
|
async function setIgniteClient() {
|
|
215
|
-
const packageRoot = getPackageRoot();
|
|
216
|
-
const localOverridesPath = join(packageRoot, 'ignite-local-overrides.json');
|
|
217
209
|
const igniteClient = await getIgniteClient({
|
|
218
210
|
namespace: ['authorization-sdk'],
|
|
219
|
-
localOverridesPath,
|
|
220
211
|
});
|
|
221
212
|
AuthorizationService.igniteClient = igniteClient;
|
|
222
213
|
AuthorizationInternalService.setIgniteClient(igniteClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-api.client.d.ts","sourceRoot":"","sources":["../../../src/clients/graph-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,0BAA0B,EAG3B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EAIvB,MAAM,0BAA0B,CAAC;AAMlC;;GAEG;AACH,qBAAa,cAAc;IACzB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,iBAAiB;IAyBzE;;OAEG;WACU,gBAAgB,CAC3B,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"graph-api.client.d.ts","sourceRoot":"","sources":["../../../src/clients/graph-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,0BAA0B,EAG3B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EAIvB,MAAM,0BAA0B,CAAC;AAMlC;;GAEG;AACH,qBAAa,cAAc;IACzB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,iBAAiB;IAyBzE;;OAEG;WACU,gBAAgB,CAC3B,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAyClC;;OAEG;IACH,MAAM,CAAC,WAAW,CAChB,aAAa,EAAE,YAAY,EAAE,EAC7B,aAAa,EAAE,sBAAsB,GACpC,0BAA0B,EAAE;IAsC/B;;OAEG;WACU,gBAAgB,CAC3B,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;CAIzC"}
|
|
@@ -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 {
|
|
7
|
+
import { incrementAuthorizationError } from '../prometheus-service.mjs';
|
|
8
8
|
|
|
9
9
|
const CAN_ACTION_IN_SCOPE_GRAPH_PATH = '/permissions/is-allowed';
|
|
10
10
|
/**
|
|
@@ -60,14 +60,12 @@ class GraphApiClient {
|
|
|
60
60
|
timeout: AuthorizationInternalService.getRequestTimeout(),
|
|
61
61
|
retryPolicy: AuthorizationInternalService.getRetriesPolicy(),
|
|
62
62
|
});
|
|
63
|
-
setGraphAvailability(true);
|
|
64
63
|
return response;
|
|
65
64
|
}
|
|
66
65
|
catch (err) {
|
|
67
|
-
setGraphAvailability(false);
|
|
68
66
|
if (err instanceof HttpFetcherError) {
|
|
69
67
|
AuthorizationInternalService.throwOnHttpError(err.status, 'canActionInScopeMultiple');
|
|
70
|
-
incrementAuthorizationError(scopeToResource(scopedActions[0].scope).resourceType, scopedActions[0].action, err.status);
|
|
68
|
+
incrementAuthorizationError(scopeToResource(scopedActions[0].scope).resourceType, scopedActions[0].action, err.status, 'graph');
|
|
71
69
|
}
|
|
72
70
|
throw err;
|
|
73
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-api.client.d.ts","sourceRoot":"","sources":["../../../src/clients/platform-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE7F,OAAO,EAA0B,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAOlF,KAAK,2BAA2B,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,UAAU,0BAA0B;IAClC,MAAM,EAAE,0BAA0B,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,2BAA2B,EAAE;IAOxF;;OAEG;WACU,gBAAgB,CAC3B,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,2BAA2B,EAAE,GAClD,OAAO,CAAC,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-api.client.d.ts","sourceRoot":"","sources":["../../../src/clients/platform-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE7F,OAAO,EAA0B,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAOlF,KAAK,2BAA2B,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,UAAU,0BAA0B;IAClC,MAAM,EAAE,0BAA0B,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,2BAA2B,EAAE;IAOxF;;OAEG;WACU,gBAAgB,CAC3B,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,2BAA2B,EAAE,GAClD,OAAO,CAAC,0BAA0B,CAAC;IAqCtC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,0BAA0B,GAAG,0BAA0B,EAAE;IAkBtF;;OAEG;WACU,gBAAgB,CAC3B,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;CAKzC"}
|
|
@@ -48,7 +48,8 @@ class PlatformApiClient {
|
|
|
48
48
|
catch (err) {
|
|
49
49
|
if (err instanceof HttpFetcherError) {
|
|
50
50
|
AuthorizationInternalService.throwOnHttpError(err.status, 'canActionInScopeMultiple');
|
|
51
|
-
|
|
51
|
+
const { resourceType } = scopeToResource(toCamelCase(scopedActionsPayload[0].scope));
|
|
52
|
+
incrementAuthorizationError(resourceType, scopedActionsPayload[0].action, err.status, 'platform');
|
|
52
53
|
}
|
|
53
54
|
throw err;
|
|
54
55
|
}
|
|
@@ -7,7 +7,6 @@ export declare const METRICS: {
|
|
|
7
7
|
export declare function setPrometheus(customPrometheus: any): void;
|
|
8
8
|
export declare function getMetricsManager(): any;
|
|
9
9
|
export declare function sendAuthorizationCheckResponseTimeMetric(resourceType: string, action: Action, isAuthorized: boolean, responseStatus: number, time: number, apiType?: 'platform' | 'graph'): void;
|
|
10
|
-
export declare function incrementAuthorizationSuccess(resourceType: string, action: Action): void;
|
|
11
|
-
export declare function incrementAuthorizationError(resourceType: string, action: Action, statusCode: number): void;
|
|
12
|
-
export declare function setGraphAvailability(isAvailable: boolean): void;
|
|
10
|
+
export declare function incrementAuthorizationSuccess(resourceType: string, action: Action, apiType: 'platform' | 'graph'): void;
|
|
11
|
+
export declare function incrementAuthorizationError(resourceType: string, action: Action, statusCode: number, apiType: 'platform' | 'graph'): void;
|
|
13
12
|
//# sourceMappingURL=prometheus-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus-service.d.ts","sourceRoot":"","sources":["../../src/prometheus-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"prometheus-service.d.ts","sourceRoot":"","sources":["../../src/prometheus-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAOzC,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAQF,wBAAgB,aAAa,CAAC,gBAAgB,KAAA,QAqB7C;AAED,wBAAgB,iBAAiB,QAEhC;AAED,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,UAAU,GAAG,OAAoB,QAW3C;AAcD,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,QAQhH;AAED,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,UAAU,GAAG,OAAO,QAS9B"}
|
|
@@ -2,7 +2,6 @@ let prometheus = null;
|
|
|
2
2
|
let authorizationCheckResponseTimeMetric = null;
|
|
3
3
|
let authorizationSuccessMetric = null;
|
|
4
4
|
let authorizationErrorMetric = null;
|
|
5
|
-
let graphAvailabilityMetric = null;
|
|
6
5
|
const METRICS = {
|
|
7
6
|
AUTHORIZATION_CHECK: 'authorization_check',
|
|
8
7
|
AUTHORIZATION_CHECKS_PER_REQUEST: 'authorization_checks_per_request',
|
|
@@ -19,7 +18,6 @@ function setPrometheus(customPrometheus) {
|
|
|
19
18
|
authorizationCheckResponseTimeMetric = null;
|
|
20
19
|
authorizationSuccessMetric = null;
|
|
21
20
|
authorizationErrorMetric = null;
|
|
22
|
-
graphAvailabilityMetric = null;
|
|
23
21
|
return;
|
|
24
22
|
}
|
|
25
23
|
const { METRICS_TYPES } = prometheus;
|
|
@@ -46,43 +44,28 @@ function sendAuthorizationCheckResponseTimeMetric(resourceType, action, isAuthor
|
|
|
46
44
|
}
|
|
47
45
|
const authorizationSuccessMetricConfig = {
|
|
48
46
|
name: 'authorization_success_total',
|
|
49
|
-
labels: ['resourceType', 'action'],
|
|
47
|
+
labels: ['resourceType', 'action', 'apiType'],
|
|
50
48
|
description: 'Total number of successful authorization checks',
|
|
51
49
|
};
|
|
52
50
|
const authorizationErrorMetricConfig = {
|
|
53
51
|
name: 'authorization_error_total',
|
|
54
|
-
labels: ['resourceType', 'action', 'statusCode'],
|
|
52
|
+
labels: ['resourceType', 'action', 'statusCode', 'apiType'],
|
|
55
53
|
description: 'Total number of authorization errors',
|
|
56
54
|
};
|
|
57
|
-
|
|
58
|
-
name: 'graph_api_availability',
|
|
59
|
-
labels: ['available'],
|
|
60
|
-
description: 'Graph API availability status',
|
|
61
|
-
};
|
|
62
|
-
function incrementAuthorizationSuccess(resourceType, action) {
|
|
55
|
+
function incrementAuthorizationSuccess(resourceType, action, apiType) {
|
|
63
56
|
try {
|
|
64
57
|
if (authorizationSuccessMetric) {
|
|
65
|
-
authorizationSuccessMetric.labels(resourceType, action).inc();
|
|
58
|
+
authorizationSuccessMetric.labels(resourceType, action, apiType).inc();
|
|
66
59
|
}
|
|
67
60
|
}
|
|
68
61
|
catch (e) {
|
|
69
62
|
// ignore
|
|
70
63
|
}
|
|
71
64
|
}
|
|
72
|
-
function incrementAuthorizationError(resourceType, action, statusCode) {
|
|
65
|
+
function incrementAuthorizationError(resourceType, action, statusCode, apiType) {
|
|
73
66
|
try {
|
|
74
67
|
if (authorizationErrorMetric) {
|
|
75
|
-
authorizationErrorMetric.labels(resourceType, action, statusCode).inc();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (e) {
|
|
79
|
-
// ignore
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function setGraphAvailability(isAvailable) {
|
|
83
|
-
try {
|
|
84
|
-
if (graphAvailabilityMetric) {
|
|
85
|
-
graphAvailabilityMetric.labels(isAvailable ? 'true' : 'false').set(isAvailable ? 1 : 0);
|
|
68
|
+
authorizationErrorMetric.labels(resourceType, action, statusCode, apiType).inc();
|
|
86
69
|
}
|
|
87
70
|
}
|
|
88
71
|
catch (e) {
|
|
@@ -99,8 +82,7 @@ function initializeAdditionalMetrics() {
|
|
|
99
82
|
if (metricsManager) {
|
|
100
83
|
authorizationSuccessMetric = metricsManager.addMetric(METRICS_TYPES.COUNTER, authorizationSuccessMetricConfig.name, authorizationSuccessMetricConfig.labels, authorizationSuccessMetricConfig.description);
|
|
101
84
|
authorizationErrorMetric = metricsManager.addMetric(METRICS_TYPES.COUNTER, authorizationErrorMetricConfig.name, authorizationErrorMetricConfig.labels, authorizationErrorMetricConfig.description);
|
|
102
|
-
graphAvailabilityMetric = metricsManager.addMetric(METRICS_TYPES.GAUGE, graphAvailabilityMetricConfig.name, graphAvailabilityMetricConfig.labels, graphAvailabilityMetricConfig.description);
|
|
103
85
|
}
|
|
104
86
|
}
|
|
105
87
|
|
|
106
|
-
export { METRICS, getMetricsManager, incrementAuthorizationError, incrementAuthorizationSuccess, sendAuthorizationCheckResponseTimeMetric,
|
|
88
|
+
export { METRICS, getMetricsManager, incrementAuthorizationError, incrementAuthorizationSuccess, sendAuthorizationCheckResponseTimeMetric, setPrometheus };
|
|
@@ -7,7 +7,6 @@ export declare const METRICS: {
|
|
|
7
7
|
export declare function setPrometheus(customPrometheus: any): void;
|
|
8
8
|
export declare function getMetricsManager(): any;
|
|
9
9
|
export declare function sendAuthorizationCheckResponseTimeMetric(resourceType: string, action: Action, isAuthorized: boolean, responseStatus: number, time: number, apiType?: 'platform' | 'graph'): void;
|
|
10
|
-
export declare function incrementAuthorizationSuccess(resourceType: string, action: Action): void;
|
|
11
|
-
export declare function incrementAuthorizationError(resourceType: string, action: Action, statusCode: number): void;
|
|
12
|
-
export declare function setGraphAvailability(isAvailable: boolean): void;
|
|
10
|
+
export declare function incrementAuthorizationSuccess(resourceType: string, action: Action, apiType: 'platform' | 'graph'): void;
|
|
11
|
+
export declare function incrementAuthorizationError(resourceType: string, action: Action, statusCode: number, apiType: 'platform' | 'graph'): void;
|
|
13
12
|
//# sourceMappingURL=prometheus-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus-service.d.ts","sourceRoot":"","sources":["../src/prometheus-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"prometheus-service.d.ts","sourceRoot":"","sources":["../src/prometheus-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAOzC,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAQF,wBAAgB,aAAa,CAAC,gBAAgB,KAAA,QAqB7C;AAED,wBAAgB,iBAAiB,QAEhC;AAED,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,UAAU,GAAG,OAAoB,QAW3C;AAcD,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,QAQhH;AAED,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,UAAU,GAAG,OAAO,QAS9B"}
|
|
@@ -4,7 +4,6 @@ let prometheus = null;
|
|
|
4
4
|
let authorizationCheckResponseTimeMetric = null;
|
|
5
5
|
let authorizationSuccessMetric = null;
|
|
6
6
|
let authorizationErrorMetric = null;
|
|
7
|
-
let graphAvailabilityMetric = null;
|
|
8
7
|
const METRICS = {
|
|
9
8
|
AUTHORIZATION_CHECK: 'authorization_check',
|
|
10
9
|
AUTHORIZATION_CHECKS_PER_REQUEST: 'authorization_checks_per_request',
|
|
@@ -21,7 +20,6 @@ function setPrometheus(customPrometheus) {
|
|
|
21
20
|
authorizationCheckResponseTimeMetric = null;
|
|
22
21
|
authorizationSuccessMetric = null;
|
|
23
22
|
authorizationErrorMetric = null;
|
|
24
|
-
graphAvailabilityMetric = null;
|
|
25
23
|
return;
|
|
26
24
|
}
|
|
27
25
|
const { METRICS_TYPES } = prometheus;
|
|
@@ -48,43 +46,28 @@ function sendAuthorizationCheckResponseTimeMetric(resourceType, action, isAuthor
|
|
|
48
46
|
}
|
|
49
47
|
const authorizationSuccessMetricConfig = {
|
|
50
48
|
name: 'authorization_success_total',
|
|
51
|
-
labels: ['resourceType', 'action'],
|
|
49
|
+
labels: ['resourceType', 'action', 'apiType'],
|
|
52
50
|
description: 'Total number of successful authorization checks',
|
|
53
51
|
};
|
|
54
52
|
const authorizationErrorMetricConfig = {
|
|
55
53
|
name: 'authorization_error_total',
|
|
56
|
-
labels: ['resourceType', 'action', 'statusCode'],
|
|
54
|
+
labels: ['resourceType', 'action', 'statusCode', 'apiType'],
|
|
57
55
|
description: 'Total number of authorization errors',
|
|
58
56
|
};
|
|
59
|
-
|
|
60
|
-
name: 'graph_api_availability',
|
|
61
|
-
labels: ['available'],
|
|
62
|
-
description: 'Graph API availability status',
|
|
63
|
-
};
|
|
64
|
-
function incrementAuthorizationSuccess(resourceType, action) {
|
|
57
|
+
function incrementAuthorizationSuccess(resourceType, action, apiType) {
|
|
65
58
|
try {
|
|
66
59
|
if (authorizationSuccessMetric) {
|
|
67
|
-
authorizationSuccessMetric.labels(resourceType, action).inc();
|
|
60
|
+
authorizationSuccessMetric.labels(resourceType, action, apiType).inc();
|
|
68
61
|
}
|
|
69
62
|
}
|
|
70
63
|
catch (e) {
|
|
71
64
|
// ignore
|
|
72
65
|
}
|
|
73
66
|
}
|
|
74
|
-
function incrementAuthorizationError(resourceType, action, statusCode) {
|
|
67
|
+
function incrementAuthorizationError(resourceType, action, statusCode, apiType) {
|
|
75
68
|
try {
|
|
76
69
|
if (authorizationErrorMetric) {
|
|
77
|
-
authorizationErrorMetric.labels(resourceType, action, statusCode).inc();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
// ignore
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function setGraphAvailability(isAvailable) {
|
|
85
|
-
try {
|
|
86
|
-
if (graphAvailabilityMetric) {
|
|
87
|
-
graphAvailabilityMetric.labels(isAvailable ? 'true' : 'false').set(isAvailable ? 1 : 0);
|
|
70
|
+
authorizationErrorMetric.labels(resourceType, action, statusCode, apiType).inc();
|
|
88
71
|
}
|
|
89
72
|
}
|
|
90
73
|
catch (e) {
|
|
@@ -101,7 +84,6 @@ function initializeAdditionalMetrics() {
|
|
|
101
84
|
if (metricsManager) {
|
|
102
85
|
authorizationSuccessMetric = metricsManager.addMetric(METRICS_TYPES.COUNTER, authorizationSuccessMetricConfig.name, authorizationSuccessMetricConfig.labels, authorizationSuccessMetricConfig.description);
|
|
103
86
|
authorizationErrorMetric = metricsManager.addMetric(METRICS_TYPES.COUNTER, authorizationErrorMetricConfig.name, authorizationErrorMetricConfig.labels, authorizationErrorMetricConfig.description);
|
|
104
|
-
graphAvailabilityMetric = metricsManager.addMetric(METRICS_TYPES.GAUGE, graphAvailabilityMetricConfig.name, graphAvailabilityMetricConfig.labels, graphAvailabilityMetricConfig.description);
|
|
105
87
|
}
|
|
106
88
|
}
|
|
107
89
|
|
|
@@ -110,5 +92,4 @@ exports.getMetricsManager = getMetricsManager;
|
|
|
110
92
|
exports.incrementAuthorizationError = incrementAuthorizationError;
|
|
111
93
|
exports.incrementAuthorizationSuccess = incrementAuthorizationSuccess;
|
|
112
94
|
exports.sendAuthorizationCheckResponseTimeMetric = sendAuthorizationCheckResponseTimeMetric;
|
|
113
|
-
exports.setGraphAvailability = setGraphAvailability;
|
|
114
95
|
exports.setPrometheus = setPrometheus;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mondaydotcomorg/monday-authorization",
|
|
3
|
-
"version": "3.3.0-feature-bashanye-navigate-can-action-in-scope-to-graph-
|
|
3
|
+
"version": "3.3.0-feature-bashanye-navigate-can-action-in-scope-to-graph-06ad41c",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "BSD-3-Clause",
|