Skip to content

Commit 0c0ba4c

Browse files
authored
Deprecate pendingSSO, missingMFA fields (#1651)
This pull request updates the `UserInfo` interface in `packages/hub/src/lib/oauth-handle-redirect.ts` to improve how security restrictions are represented. It introduces a new `securityRestrictions` field and marks two existing fields as deprecated. ### Updates to the `UserInfo` interface: * Added a new `securityRestrictions` field to represent various security restrictions (`"mfa"`, `"sso"`, `"ip"`, `"token-policy"`) in a unified way. * Deprecated the `pendingSSO` field, recommending the use of `securityRestrictions` with `"sso"` instead. * Deprecated the `missingMFA` field, recommending the use of `securityRestrictions` with `"mfa"` instead.
1 parent 1ec2442 commit 0c0ba4c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/hub/src/lib/oauth-handle-redirect.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,26 @@ export interface UserInfo {
7777
*/
7878
roleInOrg?: string;
7979
/**
80+
* @deprecated Use securityRestrictions instead with "sso"
8081
* HuggingFace field. When the user granted the oauth app access to the org, but didn't complete SSO.
8182
*
8283
* Should never happen directly after the oauth flow.
8384
*/
8485
pendingSSO?: boolean;
8586
/**
87+
* @deprecated Use securityRestrictions instead with "mfa"
88+
*
8689
* HuggingFace field. When the user granted the oauth app access to the org, but didn't complete MFA.
8790
*
8891
* Should never happen directly after the oauth flow.
8992
*/
9093
missingMFA?: boolean;
94+
/**
95+
* HuggingFace field. When the user granted the oauth app access to the org, but didn't complete following security restrictions.
96+
*
97+
* Should never happen directly after the oauth flow.
98+
*/
99+
securityRestrictions?: ("mfa" | "sso" | "ip" | "token-policy")[];
91100
}>;
92101
}
93102

0 commit comments

Comments
 (0)