@mondaydotcomorg/monday-authorization 3.5.1-fix-authorize-profile-picker-dfc6315 → 3.5.1-fix-authorize-profile-picker-7481de0

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.
@@ -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,GAK1B;IACD,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAW;IAEpC,OAAO,CAAC,MAAM,KAAK,WAAW,GAK7B;IACD,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAc;IAE1C,MAAM,CAAC,eAAe,IAAI,IAAI;IAK9B,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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AAM,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;WA+DZ,wBAAwB,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;mBA+DnB,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"}
@@ -98,16 +98,17 @@ class AuthorizationService {
98
98
  }
99
99
  const allowedProfiles = this.igniteClient.configuration.getObjectValue(ALLOWED_SDK_PLATFORM_PROFILES_KEY, []);
100
100
  const isAllowedProfile = allowedProfiles.includes(appName);
101
- console.log('AUTH-DEBUG: getProfile called', { accountId, userId, appName, allowedProfiles, isAllowedProfile });
101
+ authorizationInternalService.logger.error({ tag: 'auth-debug', accountId, userId, appName, allowedProfiles, isAllowedProfile }, 'AuthorizationService.getProfile: checking allowed profiles');
102
102
  if (isAllowedProfile) {
103
103
  const profile = attributionsService.getProfile();
104
- console.log('AUTH-DEBUG: selected profile via allowed profiles', { accountId, userId, appName, profile });
104
+ authorizationInternalService.logger.error({ tag: 'auth-debug', accountId, userId, appName, profile }, 'AuthorizationService.getProfile: selected profile via allowed profiles');
105
105
  return profile;
106
106
  }
107
107
  const inReleaseProfiles = this.igniteClient.configuration.getObjectValue(IN_RELEASE_SDK_PLATFORM_PROFILES_KEY, []);
108
108
  const isInReleaseProfile = inReleaseProfiles.includes(appName);
109
109
  const isFeatureFlagReleased = this.igniteClient.isReleased(PLATFORM_PROFILE_RELEASE_FF, { accountId, userId });
110
- console.log('AUTH-DEBUG: checking feature flag release', {
110
+ authorizationInternalService.logger.error({
111
+ tag: 'auth-debug',
111
112
  accountId,
112
113
  userId,
113
114
  appName,
@@ -115,18 +116,13 @@ class AuthorizationService {
115
116
  isInReleaseProfile,
116
117
  isFeatureFlagReleased,
117
118
  featureFlag: PLATFORM_PROFILE_RELEASE_FF,
118
- });
119
+ }, 'AuthorizationService.getProfile: checking feature flag release');
119
120
  if (isInReleaseProfile && isFeatureFlagReleased) {
120
121
  const profile = attributionsService.getProfile();
121
- console.log('AUTH-DEBUG: selected profile via feature flag release', { accountId, userId, appName, profile });
122
+ authorizationInternalService.logger.error({ tag: 'auth-debug', accountId, userId, appName, profile }, 'AuthorizationService.getProfile: selected profile via feature flag release');
122
123
  return profile;
123
124
  }
124
- console.log('AUTH-DEBUG: selected default APP profile', {
125
- accountId,
126
- userId,
127
- appName,
128
- profile: attributionsService.PlatformProfile.APP,
129
- });
125
+ authorizationInternalService.logger.error({ tag: 'auth-debug', accountId, userId, appName, profile: attributionsService.PlatformProfile.APP }, 'AuthorizationService.getProfile: selected default APP profile');
130
126
  return attributionsService.PlatformProfile.APP;
131
127
  }
132
128
  static async canActionInScopeMultiple(accountId, userId, scopedActions) {
@@ -134,23 +130,24 @@ class AuthorizationService {
134
130
  return [];
135
131
  }
136
132
  const shouldNavigateToGraph = Boolean(this.igniteClient?.isReleased(NAVIGATE_CAN_ACTION_IN_SCOPE_TO_GRAPH_FF, { accountId, userId }));
137
- console.log('AUTH-DEBUG: determining which API flow to use', {
133
+ authorizationInternalService.logger.error({
134
+ tag: 'auth-debug',
138
135
  accountId,
139
136
  userId,
140
137
  shouldNavigateToGraph,
141
138
  featureFlag: NAVIGATE_CAN_ACTION_IN_SCOPE_TO_GRAPH_FF,
142
- });
139
+ }, 'AuthorizationService.canActionInScopeMultiple: determining which API flow to use');
143
140
  const startTime = perf_hooks.performance.now();
144
141
  let scopedActionResponseObjects;
145
142
  let apiType;
146
143
  if (shouldNavigateToGraph) {
147
144
  apiType = 'graph';
148
- console.log('AUTH-DEBUG: using graph API flow', { accountId, userId, apiType });
145
+ authorizationInternalService.logger.error({ tag: 'auth-debug', accountId, userId, apiType }, 'AuthorizationService.canActionInScopeMultiple: using graph API flow');
149
146
  scopedActionResponseObjects = await this.graphApi.checkPermissions(accountId, userId, scopedActions);
150
147
  }
151
148
  else {
152
149
  apiType = 'platform';
153
- console.log('AUTH-DEBUG: using platform API flow', { accountId, userId, apiType });
150
+ authorizationInternalService.logger.error({ tag: 'auth-debug', accountId, userId, apiType }, 'AuthorizationService.canActionInScopeMultiple: using platform API flow');
154
151
  const profile = this.getProfile(accountId, userId);
155
152
  const internalAuthToken = authorizationInternalService.AuthorizationInternalService.generateInternalAuthToken(accountId, userId);
156
153
  scopedActionResponseObjects = await this.platformApi.checkPermissions(profile, internalAuthToken, userId, scopedActions);
@@ -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,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,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;WA+DZ,wBAAwB,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;mBA+DnB,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,16 +96,17 @@ class AuthorizationService {
96
96
  }
97
97
  const allowedProfiles = this.igniteClient.configuration.getObjectValue(ALLOWED_SDK_PLATFORM_PROFILES_KEY, []);
98
98
  const isAllowedProfile = allowedProfiles.includes(appName);
99
- console.log('AUTH-DEBUG: getProfile called', { accountId, userId, appName, allowedProfiles, isAllowedProfile });
99
+ logger.error({ tag: 'auth-debug', accountId, userId, appName, allowedProfiles, isAllowedProfile }, 'AuthorizationService.getProfile: checking allowed profiles');
100
100
  if (isAllowedProfile) {
101
101
  const profile = getProfile();
102
- console.log('AUTH-DEBUG: selected profile via allowed profiles', { accountId, userId, appName, profile });
102
+ logger.error({ tag: 'auth-debug', accountId, userId, appName, profile }, 'AuthorizationService.getProfile: selected profile via allowed profiles');
103
103
  return profile;
104
104
  }
105
105
  const inReleaseProfiles = this.igniteClient.configuration.getObjectValue(IN_RELEASE_SDK_PLATFORM_PROFILES_KEY, []);
106
106
  const isInReleaseProfile = inReleaseProfiles.includes(appName);
107
107
  const isFeatureFlagReleased = this.igniteClient.isReleased(PLATFORM_PROFILE_RELEASE_FF, { accountId, userId });
108
- console.log('AUTH-DEBUG: checking feature flag release', {
108
+ logger.error({
109
+ tag: 'auth-debug',
109
110
  accountId,
110
111
  userId,
111
112
  appName,
@@ -113,18 +114,13 @@ class AuthorizationService {
113
114
  isInReleaseProfile,
114
115
  isFeatureFlagReleased,
115
116
  featureFlag: PLATFORM_PROFILE_RELEASE_FF,
116
- });
117
+ }, 'AuthorizationService.getProfile: checking feature flag release');
117
118
  if (isInReleaseProfile && isFeatureFlagReleased) {
118
119
  const profile = getProfile();
119
- console.log('AUTH-DEBUG: selected profile via feature flag release', { accountId, userId, appName, profile });
120
+ logger.error({ tag: 'auth-debug', accountId, userId, appName, profile }, 'AuthorizationService.getProfile: selected profile via feature flag release');
120
121
  return profile;
121
122
  }
122
- console.log('AUTH-DEBUG: selected default APP profile', {
123
- accountId,
124
- userId,
125
- appName,
126
- profile: PlatformProfile.APP,
127
- });
123
+ logger.error({ tag: 'auth-debug', accountId, userId, appName, profile: PlatformProfile.APP }, 'AuthorizationService.getProfile: selected default APP profile');
128
124
  return PlatformProfile.APP;
129
125
  }
130
126
  static async canActionInScopeMultiple(accountId, userId, scopedActions) {
@@ -132,23 +128,24 @@ class AuthorizationService {
132
128
  return [];
133
129
  }
134
130
  const shouldNavigateToGraph = Boolean(this.igniteClient?.isReleased(NAVIGATE_CAN_ACTION_IN_SCOPE_TO_GRAPH_FF, { accountId, userId }));
135
- console.log('AUTH-DEBUG: determining which API flow to use', {
131
+ logger.error({
132
+ tag: 'auth-debug',
136
133
  accountId,
137
134
  userId,
138
135
  shouldNavigateToGraph,
139
136
  featureFlag: NAVIGATE_CAN_ACTION_IN_SCOPE_TO_GRAPH_FF,
140
- });
137
+ }, 'AuthorizationService.canActionInScopeMultiple: determining which API flow to use');
141
138
  const startTime = performance.now();
142
139
  let scopedActionResponseObjects;
143
140
  let apiType;
144
141
  if (shouldNavigateToGraph) {
145
142
  apiType = 'graph';
146
- console.log('AUTH-DEBUG: using graph API flow', { accountId, userId, apiType });
143
+ logger.error({ tag: 'auth-debug', accountId, userId, apiType }, 'AuthorizationService.canActionInScopeMultiple: using graph API flow');
147
144
  scopedActionResponseObjects = await this.graphApi.checkPermissions(accountId, userId, scopedActions);
148
145
  }
149
146
  else {
150
147
  apiType = 'platform';
151
- console.log('AUTH-DEBUG: using platform API flow', { accountId, userId, apiType });
148
+ logger.error({ tag: 'auth-debug', accountId, userId, apiType }, 'AuthorizationService.canActionInScopeMultiple: using platform API flow');
152
149
  const profile = this.getProfile(accountId, userId);
153
150
  const internalAuthToken = AuthorizationInternalService.generateInternalAuthToken(accountId, userId);
154
151
  scopedActionResponseObjects = await this.platformApi.checkPermissions(profile, internalAuthToken, userId, scopedActions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondaydotcomorg/monday-authorization",
3
- "version": "3.5.1-fix-authorize-profile-picker-dfc6315",
3
+ "version": "3.5.1-fix-authorize-profile-picker-7481de0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "BSD-3-Clause",
@@ -161,11 +161,17 @@ export class AuthorizationService {
161
161
  []
162
162
  );
163
163
  const isAllowedProfile = allowedProfiles.includes(appName);
164
- console.log('AUTH-DEBUG: getProfile called', { accountId, userId, appName, allowedProfiles, isAllowedProfile });
164
+ logger.error(
165
+ { tag: 'auth-debug', accountId, userId, appName, allowedProfiles, isAllowedProfile },
166
+ 'AuthorizationService.getProfile: checking allowed profiles'
167
+ );
165
168
 
166
169
  if (isAllowedProfile) {
167
170
  const profile = getProfile();
168
- console.log('AUTH-DEBUG: selected profile via allowed profiles', { accountId, userId, appName, profile });
171
+ logger.error(
172
+ { tag: 'auth-debug', accountId, userId, appName, profile },
173
+ 'AuthorizationService.getProfile: selected profile via allowed profiles'
174
+ );
169
175
  return profile;
170
176
  }
171
177
 
@@ -176,28 +182,33 @@ export class AuthorizationService {
176
182
  const isInReleaseProfile = inReleaseProfiles.includes(appName);
177
183
  const isFeatureFlagReleased = this.igniteClient.isReleased(PLATFORM_PROFILE_RELEASE_FF, { accountId, userId });
178
184
 
179
- console.log('AUTH-DEBUG: checking feature flag release', {
180
- accountId,
181
- userId,
182
- appName,
183
- inReleaseProfiles,
184
- isInReleaseProfile,
185
- isFeatureFlagReleased,
186
- featureFlag: PLATFORM_PROFILE_RELEASE_FF,
187
- });
185
+ logger.error(
186
+ {
187
+ tag: 'auth-debug',
188
+ accountId,
189
+ userId,
190
+ appName,
191
+ inReleaseProfiles,
192
+ isInReleaseProfile,
193
+ isFeatureFlagReleased,
194
+ featureFlag: PLATFORM_PROFILE_RELEASE_FF,
195
+ },
196
+ 'AuthorizationService.getProfile: checking feature flag release'
197
+ );
188
198
 
189
199
  if (isInReleaseProfile && isFeatureFlagReleased) {
190
200
  const profile = getProfile();
191
- console.log('AUTH-DEBUG: selected profile via feature flag release', { accountId, userId, appName, profile });
201
+ logger.error(
202
+ { tag: 'auth-debug', accountId, userId, appName, profile },
203
+ 'AuthorizationService.getProfile: selected profile via feature flag release'
204
+ );
192
205
  return profile;
193
206
  }
194
207
 
195
- console.log('AUTH-DEBUG: selected default APP profile', {
196
- accountId,
197
- userId,
198
- appName,
199
- profile: PlatformProfile.APP,
200
- });
208
+ logger.error(
209
+ { tag: 'auth-debug', accountId, userId, appName, profile: PlatformProfile.APP },
210
+ 'AuthorizationService.getProfile: selected default APP profile'
211
+ );
201
212
  return PlatformProfile.APP;
202
213
  }
203
214
 
@@ -214,12 +225,16 @@ export class AuthorizationService {
214
225
  this.igniteClient?.isReleased(NAVIGATE_CAN_ACTION_IN_SCOPE_TO_GRAPH_FF, { accountId, userId })
215
226
  );
216
227
 
217
- console.log('AUTH-DEBUG: determining which API flow to use', {
218
- accountId,
219
- userId,
220
- shouldNavigateToGraph,
221
- featureFlag: NAVIGATE_CAN_ACTION_IN_SCOPE_TO_GRAPH_FF,
222
- });
228
+ logger.error(
229
+ {
230
+ tag: 'auth-debug',
231
+ accountId,
232
+ userId,
233
+ shouldNavigateToGraph,
234
+ featureFlag: NAVIGATE_CAN_ACTION_IN_SCOPE_TO_GRAPH_FF,
235
+ },
236
+ 'AuthorizationService.canActionInScopeMultiple: determining which API flow to use'
237
+ );
223
238
 
224
239
  const startTime = performance.now();
225
240
  let scopedActionResponseObjects: ScopedActionResponseObject[];
@@ -227,11 +242,17 @@ export class AuthorizationService {
227
242
 
228
243
  if (shouldNavigateToGraph) {
229
244
  apiType = 'graph';
230
- console.log('AUTH-DEBUG: using graph API flow', { accountId, userId, apiType });
245
+ logger.error(
246
+ { tag: 'auth-debug', accountId, userId, apiType },
247
+ 'AuthorizationService.canActionInScopeMultiple: using graph API flow'
248
+ );
231
249
  scopedActionResponseObjects = await this.graphApi.checkPermissions(accountId, userId, scopedActions);
232
250
  } else {
233
251
  apiType = 'platform';
234
- console.log('AUTH-DEBUG: using platform API flow', { accountId, userId, apiType });
252
+ logger.error(
253
+ { tag: 'auth-debug', accountId, userId, apiType },
254
+ 'AuthorizationService.canActionInScopeMultiple: using platform API flow'
255
+ );
235
256
  const profile = this.getProfile(accountId, userId);
236
257
  const internalAuthToken = AuthorizationInternalService.generateInternalAuthToken(accountId, userId);
237
258