@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.
@@ -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<import("../_utils/http").AuthingGuardResponse<any>>;
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
- export declare const VerifyEmail: (content: VerifyEmailContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
35
- export declare const VerifySms: (content: VerifySmsContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
36
- export declare const VerifyTotp: (content: VerifyTotpContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
37
- export declare const VerifyFace: (content: VerifyFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
38
- export declare const AssociateFace: (content: AssociateFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
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<import("../_utils/http").AuthingGuardResponse<any>>;
41
- "verify-sms": (content: VerifySmsContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
42
- "verify-totp": (content: VerifyTotpContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
43
- "verify-face": (content: VerifyFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
44
- "associate-face": (content: AssociateFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
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 {};
@@ -11,7 +11,8 @@ export declare enum MFAType {
11
11
  SMS = "SMS",
12
12
  EMAIL = "EMAIL",
13
13
  TOTP = "OTP",
14
- FACE = "FACE"
14
+ FACE = "FACE",
15
+ PASSKEY = "PASSKEY"
15
16
  }
16
17
  export interface GuardMFAInitData {
17
18
  mfaToken: string;
@@ -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 useCaptchaCheck: (sence: 'login' | 'register') => boolean;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react18",
3
- "version": "4.5.13-alpha.2",
3
+ "version": "4.5.13-alpha.4",
4
4
  "description": "Guard shim for react 18, only be used to internal",
5
5
  "types": "dist/typings/src/index.d.ts",
6
6
  "module": "dist/guard.min.js",