@mondaydotcomorg/monday-authorization 1.1.9-featurebelkaauthz-sdk-update.2209 → 1.1.9-featurebelkaauthz-sdk-update.2210
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.
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.AuthorizationAttributesService = void 0;
|
|
13
13
|
const monday_fetch_1 = require("@mondaydotcomorg/monday-fetch");
|
|
14
14
|
const authorization_internal_service_1 = require("./authorization-internal-service");
|
|
15
|
+
const authorization_service_1 = require("lib/authorization-service");
|
|
15
16
|
class AuthorizationAttributesService {
|
|
16
17
|
/**
|
|
17
18
|
* Upsert resource attributes synchronously, performing http call to the authorization MS to assign the given attributes to the given resource.
|
|
@@ -26,7 +27,11 @@ class AuthorizationAttributesService {
|
|
|
26
27
|
const internalAuthToken = authorization_internal_service_1.AuthorizationInternalService.generateInternalAuthToken(accountId, userId);
|
|
27
28
|
const response = yield (0, monday_fetch_1.fetch)(this.getResourceAttributesUrl(accountId), {
|
|
28
29
|
method: 'POST',
|
|
29
|
-
headers: {
|
|
30
|
+
headers: {
|
|
31
|
+
Authorization: internalAuthToken,
|
|
32
|
+
'Content-Type': 'application/json',
|
|
33
|
+
'x-internal-controller-caller-app-name': (0, authorization_service_1.getCurrentAppName)(),
|
|
34
|
+
},
|
|
30
35
|
timeout: authorization_internal_service_1.AuthorizationInternalService.getRequestTimeout(),
|
|
31
36
|
body: JSON.stringify({ resourceAttributeAssignments }),
|
|
32
37
|
}, authorization_internal_service_1.AuthorizationInternalService.getRequestFetchOptions());
|
|
@@ -49,7 +54,11 @@ class AuthorizationAttributesService {
|
|
|
49
54
|
const url = `${this.getResourceAttributesUrl(accountId)}/${resource.type}/${resource.id}`;
|
|
50
55
|
const response = yield (0, monday_fetch_1.fetch)(url, {
|
|
51
56
|
method: 'DELETE',
|
|
52
|
-
headers: {
|
|
57
|
+
headers: {
|
|
58
|
+
Authorization: internalAuthToken,
|
|
59
|
+
'Content-Type': 'application/json',
|
|
60
|
+
'x-internal-controller-caller-app-name': (0, authorization_service_1.getCurrentAppName)(),
|
|
61
|
+
},
|
|
53
62
|
timeout: authorization_internal_service_1.AuthorizationInternalService.getRequestTimeout(),
|
|
54
63
|
body: JSON.stringify({ keys: attributeKeys }),
|
|
55
64
|
}, authorization_internal_service_1.AuthorizationInternalService.getRequestFetchOptions());
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AuthorizationService = exports.setRedisClient = exports.setRequestFetchOptions = void 0;
|
|
12
|
+
exports.getCurrentAppName = exports.AuthorizationService = exports.setRedisClient = exports.setRequestFetchOptions = void 0;
|
|
13
13
|
const lodash_1 = require("lodash");
|
|
14
14
|
const perf_hooks_1 = require("perf_hooks");
|
|
15
15
|
const monday_fetch_1 = require("@mondaydotcomorg/monday-fetch");
|
|
@@ -93,7 +93,11 @@ class AuthorizationService {
|
|
|
93
93
|
});
|
|
94
94
|
const response = yield (0, monday_fetch_1.fetch)(getCanActionsInScopesUrl(), {
|
|
95
95
|
method: 'POST',
|
|
96
|
-
headers: {
|
|
96
|
+
headers: {
|
|
97
|
+
Authorization: internalAuthToken,
|
|
98
|
+
'Content-Type': 'application/json',
|
|
99
|
+
'x-internal-controller-caller-app-name': getCurrentAppName(),
|
|
100
|
+
},
|
|
97
101
|
timeout: authorization_internal_service_1.AuthorizationInternalService.getRequestTimeout(),
|
|
98
102
|
body: JSON.stringify({
|
|
99
103
|
user_id: userId,
|
|
@@ -194,6 +198,7 @@ function getCurrentAppName() {
|
|
|
194
198
|
return 'MISSING';
|
|
195
199
|
}
|
|
196
200
|
}
|
|
201
|
+
exports.getCurrentAppName = getCurrentAppName;
|
|
197
202
|
function getVariable(key, options = { silent: false }) {
|
|
198
203
|
const result = tryJsonParse(getEnvVariable(key));
|
|
199
204
|
if (result === undefined && !options.silent) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mondaydotcomorg/monday-authorization",
|
|
3
|
-
"version": "1.1.9-featurebelkaauthz-sdk-update.
|
|
3
|
+
"version": "1.1.9-featurebelkaauthz-sdk-update.2210+3a2ebfca5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"files": [
|
|
33
33
|
"dist/"
|
|
34
34
|
],
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "3a2ebfca5cb1d1aad2149f24c735f14283b8c822"
|
|
36
36
|
}
|