@authing/guard-shim-react18 4.5.13-alpha.2 → 4.5.13-alpha.4
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/guard.min.css +1 -1
- package/dist/guard.min.js +215 -205
- package/dist/typings/src/MFA/businessRequest.d.ts +33 -12
- package/dist/typings/src/MFA/core/passkey.d.ts +14 -0
- package/dist/typings/src/MFA/interface.d.ts +2 -1
- package/dist/typings/src/Type/application.d.ts +0 -12
- package/dist/typings/src/_utils/context.d.ts +4 -2
- package/dist/typings/src/_utils/passkey.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import { CredentialCreationOptionsJSON, CredentialRequestOptionsJSON, PublicKeyCredentialWithAssertionJSON, PublicKeyCredentialWithAttestationJSON } from '@github/webauthn-json';
|
|
2
|
+
import { AuthingGuardResponse } from '../_utils/http';
|
|
1
3
|
export declare enum MfaBusinessAction {
|
|
2
4
|
VerifyEmail = "verify-email",
|
|
3
5
|
VerifySms = "verify-sms",
|
|
4
6
|
VerifyTotp = "verify-totp",
|
|
5
7
|
VerifyFace = "verify-face",
|
|
6
|
-
AssociateFace = "associate-face"
|
|
8
|
+
AssociateFace = "associate-face",
|
|
9
|
+
PasskeyBind = "passkey-bind",
|
|
10
|
+
PasskeyVerify = "passkey-verify"
|
|
7
11
|
}
|
|
8
|
-
export declare const authFlow: (action: MfaBusinessAction, content: any) => Promise<
|
|
12
|
+
export declare const authFlow: (action: MfaBusinessAction, content: any) => Promise<AuthingGuardResponse<any>>;
|
|
9
13
|
interface VerifySmsContent {
|
|
10
14
|
phone: string;
|
|
11
15
|
code: string;
|
|
@@ -31,16 +35,33 @@ interface AssociateFaceContent {
|
|
|
31
35
|
isExternalPhoto?: boolean;
|
|
32
36
|
mfaToken?: string;
|
|
33
37
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
declare type BindPasskeyContent = PublicKeyCredentialWithAttestationJSON;
|
|
39
|
+
interface VerifyPasskeyContent {
|
|
40
|
+
credential: PublicKeyCredentialWithAssertionJSON;
|
|
41
|
+
ticket: string;
|
|
42
|
+
}
|
|
43
|
+
interface GetPasskeyBindChallengeParams {
|
|
44
|
+
mfaToken: string;
|
|
45
|
+
}
|
|
46
|
+
interface GetPasskeyVerifyChallengeParams {
|
|
47
|
+
mfaToken: string;
|
|
48
|
+
}
|
|
49
|
+
export declare const VerifyEmail: (content: VerifyEmailContent) => Promise<AuthingGuardResponse<any>>;
|
|
50
|
+
export declare const VerifySms: (content: VerifySmsContent) => Promise<AuthingGuardResponse<any>>;
|
|
51
|
+
export declare const VerifyTotp: (content: VerifyTotpContent) => Promise<AuthingGuardResponse<any>>;
|
|
52
|
+
export declare const VerifyFace: (content: VerifyFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
53
|
+
export declare const AssociateFace: (content: AssociateFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
54
|
+
export declare const GetPasskeyBindChallenge: (content: GetPasskeyBindChallengeParams) => Promise<AuthingGuardResponse<CredentialCreationOptionsJSON>>;
|
|
55
|
+
export declare const GetPasskeyVerifyChallenge: (content: GetPasskeyVerifyChallengeParams) => Promise<AuthingGuardResponse<CredentialRequestOptionsJSON & {
|
|
56
|
+
ticket: string;
|
|
57
|
+
}>>;
|
|
39
58
|
export declare const useMfaBusinessRequest: () => {
|
|
40
|
-
"verify-email": (content: VerifyEmailContent) => Promise<
|
|
41
|
-
"verify-sms": (content: VerifySmsContent) => Promise<
|
|
42
|
-
"verify-totp": (content: VerifyTotpContent) => Promise<
|
|
43
|
-
"verify-face": (content: VerifyFaceContent) => Promise<
|
|
44
|
-
"associate-face": (content: AssociateFaceContent) => Promise<
|
|
59
|
+
"verify-email": (content: VerifyEmailContent) => Promise<AuthingGuardResponse<any>>;
|
|
60
|
+
"verify-sms": (content: VerifySmsContent) => Promise<AuthingGuardResponse<any>>;
|
|
61
|
+
"verify-totp": (content: VerifyTotpContent) => Promise<AuthingGuardResponse<any>>;
|
|
62
|
+
"verify-face": (content: VerifyFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
63
|
+
"associate-face": (content: AssociateFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
64
|
+
"passkey-bind": (content: BindPasskeyContent) => Promise<AuthingGuardResponse<any>> | null;
|
|
65
|
+
"passkey-verify": (content: VerifyPasskeyContent) => Promise<AuthingGuardResponse<any>> | null;
|
|
45
66
|
};
|
|
46
67
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { React } from 'shim-react';
|
|
2
|
+
interface BindPasskeyProps {
|
|
3
|
+
mfaToken: string;
|
|
4
|
+
mfaLogin: (code: any, data: any, message?: string) => void;
|
|
5
|
+
}
|
|
6
|
+
interface VerifyPasskeyProps {
|
|
7
|
+
mfaToken: string;
|
|
8
|
+
mfaLogin: (code: any, data: any, message?: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare type MFAPasskeyProps = BindPasskeyProps & VerifyPasskeyProps & {
|
|
11
|
+
passkeyEnabled: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const MFAPasskey: React.FC<MFAPasskeyProps>;
|
|
14
|
+
export {};
|
|
@@ -363,16 +363,4 @@ export interface ApplicationConfig {
|
|
|
363
363
|
mfa: MFAType;
|
|
364
364
|
changeable: boolean;
|
|
365
365
|
}[];
|
|
366
|
-
/** 注册阶段短信安全配置 */
|
|
367
|
-
registerSmsConfig?: {
|
|
368
|
-
robot: {
|
|
369
|
-
switch: 'OFF' | 'ON' | 'CONDON';
|
|
370
|
-
};
|
|
371
|
-
};
|
|
372
|
-
/** 登录阶段短信安全配置 */
|
|
373
|
-
loginSmsConfig?: {
|
|
374
|
-
robot: {
|
|
375
|
-
switch: 'OFF' | 'ON' | 'CONDON';
|
|
376
|
-
};
|
|
377
|
-
};
|
|
378
366
|
}
|
|
@@ -49,6 +49,8 @@ export interface IGuardContext {
|
|
|
49
49
|
defaultLanguageConfig: Lang;
|
|
50
50
|
/** 租户信息获取和操作处理相关 */
|
|
51
51
|
tenantInstance?: MultipleTenant;
|
|
52
|
+
/** 判断是否是国外的用户池 */
|
|
53
|
+
isForeignUserpool: boolean;
|
|
52
54
|
}
|
|
53
55
|
export declare const createGuardXContext: () => {
|
|
54
56
|
Provider: React.FC<{
|
|
@@ -160,5 +162,5 @@ export declare const useGuardDefaultLanguage: () => Lang;
|
|
|
160
162
|
export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
|
|
161
163
|
/** 当前人机验证策略 */
|
|
162
164
|
export declare const useRobotVerify: () => "always_enable" | "disable" | "condition_set";
|
|
163
|
-
/**
|
|
164
|
-
export declare const
|
|
165
|
+
/** 当前用户池是否是国外用户池 */
|
|
166
|
+
export declare const useIsForeignUserpool: () => boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CredentialCreationOptionsJSON, CredentialRequestOptionsJSON } from '@github/webauthn-json';
|
|
2
|
+
export declare const registerPasskey: (challenge: CredentialCreationOptionsJSON) => Promise<import("@github/webauthn-json").PublicKeyCredentialWithAttestationJSON | undefined>;
|
|
3
|
+
export declare const verifyPasskey: (challenge: CredentialRequestOptionsJSON) => Promise<import("@github/webauthn-json").PublicKeyCredentialWithAssertionJSON | undefined>;
|
package/package.json
CHANGED