fix ui_not_allowed naming while preserving ux_not_allowed compatibility#8608
fix ui_not_allowed naming while preserving ux_not_allowed compatibility#8608lalimasharda wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to standardize “UI not allowed” terminology by renaming uxNotAllowed/UX_NOT_ALLOWED to uiNotAllowed/UI_NOT_ALLOWED across msal-common and msal-browser, updating both runtime mappings and unit tests.
Changes:
- Renamed interaction-required error code
uxNotAllowed→uiNotAllowedand updated interaction-required matching lists (InteractionRequiredAuthError*). - Renamed native broker status constant
UX_NOT_ALLOWED→UI_NOT_ALLOWEDand updatedNativeAuthErrormapping. - Regenerated
msal-common.api.mdand updated affected unit tests.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/msal-common/src/error/InteractionRequiredAuthErrorCodes.ts | Renames the exported interaction-required error code constant. |
| lib/msal-common/src/error/InteractionRequiredAuthError.ts | Updates interaction-required code/suberror allowlists to the new name/value. |
| lib/msal-common/test/error/InteractionRequiredAuthError.spec.ts | Updates tests to use the renamed interaction-required code. |
| lib/msal-common/apiReview/msal-common.api.md | Updates API review output to reflect the renamed public export. |
| lib/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts | Renames the WAM/native status constant. |
| lib/msal-browser/src/error/NativeAuthError.ts | Updates status-to-error mapping to the renamed status/code. |
| lib/msal-browser/test/error/NativeAuthError.spec.ts | Updates tests to assert the renamed status/code mapping. |
Comments suppressed due to low confidence (1)
lib/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts:15
NativeStatusCodes.UI_NOT_ALLOWEDis defined as the literal string "UI_NOT_ALLOWED". However, repo changelogs and docs refer to the WAM/native status/suberror asUX_NOT_ALLOWED/ux_not_allowed. If the native broker still emits "UX_NOT_ALLOWED", this rename will preventcreateNativeAuthErrorfrom recognizing the condition. Consider keeping the existing "UX_NOT_ALLOWED" literal and addingUI_NOT_ALLOWEDas an alias, or handling both values.
export const PERSISTENT_ERROR = "PERSISTENT_ERROR";
export const DISABLED = "DISABLED";
export const ACCOUNT_UNAVAILABLE = "ACCOUNT_UNAVAILABLE";
export const UI_NOT_ALLOWED = "UI_NOT_ALLOWED";
|
@copilot please run beachball:change and commit the change files |
Done. I ran |
|
@copilot can you take another pass at reviewing the PR? |
I took another pass through the PR. The UI/UX compatibility updates and test coverage look good, and targeted tests for |
|
@copilot can you run apiExtractor and fix the msal-common api.md? |
| /** | ||
| * Deprecated alias for {@link InteractionRequiredAuthErrorCodes.uiNotAllowed}. UI/UX is not allowed (e.g., blocked by policy), requiring alternate interaction. | ||
| * @deprecated Please use {@link InteractionRequiredAuthErrorCodes.uiNotAllowed}. | ||
| * @public | ||
| */ |
There was a problem hiding this comment.
These shouldn't be publicly accessible. If it's not used we can simply remove it instead of deprecating it
There was a problem hiding this comment.
Removing now would be a breaking change because it a part of the public api.
There was a problem hiding this comment.
No it's not. We only export error codes we actually throw. If we're no longer throwing this code we can remove it.
This pull request standardizes the terminology used for UI/UX restriction error codes by making
uiNotAllowed/UI_NOT_ALLOWEDthe primary naming, while preserving backward compatibility for existinguxNotAllowed/ux_not_allowedconsumers.Error code and constant updates:
uiNotAllowed("ui_not_allowed") as the primary interaction-required error code inInteractionRequiredAuthErrorCodes.ts.uxNotAllowed("ux_not_allowed") as a deprecated alias that points users touiNotAllowed.UI_NOT_ALLOWEDas primary while also supporting legacyUX_NOT_ALLOWEDstatus values for compatibility.Error handling and messaging updates:
InteractionRequiredAuthError.tsto recognize bothuiNotAllowedand deprecateduxNotAllowed."ui_not_allowed"and"ux_not_allowed"for compatibility with existing server/broker responses.createNativeAuthErrorinmsal-browserto handle bothUI_NOT_ALLOWEDandUX_NOT_ALLOWEDnative statuses.Documentation updates:
docs/errors.mdto documentui_not_allowedas the primary value andux_not_allowedas a deprecated alias.lib/msal-common/apiReview/msal-common.api.mdto reflect the public API surface including the deprecated alias.Test updates:
InteractionRequiredAuthError.spec.tscoverage to validate bothuiNotAllowedand deprecateduxNotAllowedmappings.NativeAuthError.spec.tscoverage to validate bothUI_NOT_ALLOWEDand legacyUX_NOT_ALLOWEDnative status mappings.