@authing/guard-shim-react 4.5.13 → 4.5.14-alpha.1

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.
@@ -13,7 +13,7 @@ export declare const QR_CODE_WAY: LoginWay[];
13
13
  * 登录时所有支持的登录列表(前端定义列表)
14
14
  * 这里稍微有点乱 因为Login中的登录方式和这里的不匹配,暂时放在了一起
15
15
  */
16
- export declare type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-qrcode' | 'zjzwfw-qrcode' | 'ad' | 'ldap' | 'ldap-password' | 'ldap-email' | 'ldap-phone' | 'authing-otp-push';
16
+ export declare type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-qrcode' | 'ad' | 'ldap' | 'ldap-password' | 'ldap-email' | 'ldap-phone' | 'authing-otp-push';
17
17
  /**
18
18
  * when: 多账号页面跳转进入登录页面
19
19
  * 携带的回填数据信息
@@ -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;
@@ -48,5 +48,4 @@ export interface UiQrProps {
48
48
  onMaskContent?: (status: CodeStatus) => void;
49
49
  }
50
50
  declare const UiQrCode: React.NamedExoticComponent<UiQrProps>;
51
- declare const LinkQrcode: React.FC<UiQrProps>;
52
- export { UiQrCode, LinkQrcode };
51
+ export { UiQrCode };
@@ -15,7 +15,7 @@ interface WorkQrCodeProps extends Omit<UiQrProps, 'description' | 'status'> {
15
15
  /**
16
16
  * 二维码场景
17
17
  */
18
- scene: 'WXAPP_AUTH' | 'APP_AUTH' | 'WECHATMP_AUTH' | 'ZJ_AUTH';
18
+ scene: 'WXAPP_AUTH' | 'APP_AUTH' | 'WECHATMP_AUTH';
19
19
  /**
20
20
  * 不同状态请求文字
21
21
  */
@@ -38,7 +38,4 @@ interface WorkQrCodeProps extends Omit<UiQrProps, 'description' | 'status'> {
38
38
  qrCodeScanOptions?: any;
39
39
  }
40
40
  declare const WorkQrCode: React.ForwardRefExoticComponent<WorkQrCodeProps & React.RefAttributes<any>>;
41
- declare const WorkGeneQrCode: React.ForwardRefExoticComponent<WorkQrCodeProps & {
42
- authorizationUrl?: string | undefined;
43
- } & React.RefAttributes<any>>;
44
- export { WorkQrCode, WorkGeneQrCode };
41
+ export { WorkQrCode };
@@ -33,7 +33,6 @@ interface QrCodeRequest {
33
33
  random: string;
34
34
  url: string;
35
35
  }>>;
36
- getAuthUrlRequest?: () => Promise<any>;
37
36
  /**
38
37
  * 未扫码下的请求方法
39
38
  */
@@ -17,14 +17,6 @@ export declare type RootState = {
17
17
  * 二维码随机值
18
18
  */
19
19
  random?: string;
20
- /**
21
- * 用于与浙里办交换的认证码
22
- */
23
- authCode?: string;
24
- /**
25
- * 浙里办的认证地址
26
- */
27
- authUrl?: string;
28
20
  };
29
21
  /**
30
22
  * QrCode 准备阶段 Hook
@@ -1,11 +1,7 @@
1
- import { UiQrCode, LinkQrcode } from './UiQrCode';
2
- import { WorkQrCode, WorkGeneQrCode } from './WorkQrCode';
1
+ import { UiQrCode } from './UiQrCode';
2
+ import { WorkQrCode } from './WorkQrCode';
3
3
  declare type IQrCode = typeof WorkQrCode & {
4
4
  UI: typeof UiQrCode;
5
5
  };
6
- declare type IGeneQrCode = typeof WorkGeneQrCode & {
7
- UI: typeof LinkQrcode;
8
- };
9
6
  declare const QrCode: IQrCode;
10
- declare const GeneQrcode: IGeneQrCode;
11
- export { QrCode, GeneQrcode };
7
+ export { QrCode };
@@ -14,8 +14,7 @@ export declare enum LoginMethods {
14
14
  AuthingOtpPush = "authing-otp-push",
15
15
  WechatworkCorpQrconnect = "wechatwork-corp-qrconnect",
16
16
  DingTalkQrcode = "dingtalk-qrcode",
17
- Passkey = "passkey",
18
- ZJZWFWQrcode = "zjzwfw-qrcode"
17
+ Passkey = "passkey"
19
18
  }
20
19
  export declare enum OIDCConnectionMode {
21
20
  FRONT_CHANNEL = "FRONT_CHANNEL",
@@ -127,7 +126,6 @@ export interface QrCodeItem {
127
126
  redirectUrl: string;
128
127
  identifier: string;
129
128
  clientId?: string;
130
- authorizationUrl?: string;
131
129
  };
132
130
  }
133
131
  export declare type QrcodeTabsSettings = Record<LoginMethods, Array<QrCodeItem>>;
@@ -365,16 +363,4 @@ export interface ApplicationConfig {
365
363
  mfa: MFAType;
366
364
  changeable: boolean;
367
365
  }[];
368
- /** 注册阶段短信安全配置 */
369
- registerSmsConfig?: {
370
- robot: {
371
- switch: 'OFF' | 'ON' | 'CONDON';
372
- };
373
- };
374
- /** 登录阶段短信安全配置 */
375
- loginSmsConfig?: {
376
- robot: {
377
- switch: 'OFF' | 'ON' | 'CONDON';
378
- };
379
- };
380
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-react",
3
- "version": "4.5.13",
3
+ "version": "4.5.14-alpha.1",
4
4
  "description": "Guard shim for react 16 / 17, only be used to internal",
5
5
  "types": "dist/typings/src/index.d.ts",
6
6
  "module": "dist/guard.min.js",
@@ -1,11 +0,0 @@
1
- import { StoreInstance } from '../../Guard/core/hooks/useMultipleAccounts';
2
- import { QrCodeItem } from '../..';
3
- interface LoginWithAppQrcodeProps {
4
- onLoginSuccess: any;
5
- canLoop: boolean;
6
- multipleInstance?: StoreInstance;
7
- qrConfig: QrCodeItem['QRConfig'];
8
- qrCodeScanOptions: any;
9
- }
10
- export declare const LoginWithZjQrcode: (props: LoginWithAppQrcodeProps) => JSX.Element | null;
11
- export {};