-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ReCaptchaEnterprise for App Check (#5595)
* Add recaptcha enterprise provider * start on app-check-compat * Correct Enterprise URL * prettier * Add changeset * start on app-check-compat * Add enterprise endpoint * Fix tests * update index.d.ts * Add more tests * Update .changeset/ten-impalas-wink.md Co-authored-by: Feiyang <[email protected]> * Address PR comments * Update doc comment * Address doc-related PR comments * Formatting pass * update comments Co-authored-by: Feiyang <[email protected]> Co-authored-by: Feiyang1 <[email protected]>
- Loading branch information
1 parent
31bd6f2
commit 6160497
Showing
17 changed files
with
536 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@firebase/app-check': minor | ||
'@firebase/app-check-compat': minor | ||
'firebase': minor | ||
--- | ||
|
||
Add ReCAPTCHA Enterprise as an attestation option for App Check. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,105 @@ | ||
## API Report File for "@firebase/app-check" | ||
|
||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
```ts | ||
|
||
import { FirebaseApp } from '@firebase/app'; | ||
import { PartialObserver } from '@firebase/util'; | ||
import { Unsubscribe } from '@firebase/util'; | ||
|
||
// @public | ||
export interface AppCheck { | ||
app: FirebaseApp; | ||
} | ||
|
||
// @internal (undocumented) | ||
export type _AppCheckComponentName = 'app-check'; | ||
|
||
// @internal (undocumented) | ||
export type _AppCheckInternalComponentName = 'app-check-internal'; | ||
|
||
// @public | ||
export interface AppCheckOptions { | ||
isTokenAutoRefreshEnabled?: boolean; | ||
provider: CustomProvider | ReCaptchaV3Provider; | ||
} | ||
|
||
// @public | ||
export interface AppCheckToken { | ||
readonly expireTimeMillis: number; | ||
// (undocumented) | ||
readonly token: string; | ||
} | ||
|
||
// @public | ||
export type AppCheckTokenListener = (token: AppCheckTokenResult) => void; | ||
|
||
// @public | ||
export interface AppCheckTokenResult { | ||
readonly token: string; | ||
} | ||
|
||
// Warning: (ae-forgotten-export) The symbol "AppCheckProvider" needs to be exported by the entry point index.d.ts | ||
// | ||
// @public | ||
export class CustomProvider implements AppCheckProvider { | ||
constructor(_customProviderOptions: CustomProviderOptions); | ||
// Warning: (ae-forgotten-export) The symbol "AppCheckTokenInternal" needs to be exported by the entry point index.d.ts | ||
// | ||
// @internal (undocumented) | ||
getToken(): Promise<AppCheckTokenInternal>; | ||
// @internal (undocumented) | ||
initialize(app: FirebaseApp): void; | ||
// @internal (undocumented) | ||
isEqual(otherProvider: unknown): boolean; | ||
} | ||
|
||
// @public | ||
export interface CustomProviderOptions { | ||
getToken: () => Promise<AppCheckToken>; | ||
} | ||
|
||
// @public | ||
export function getToken(appCheckInstance: AppCheck, forceRefresh?: boolean): Promise<AppCheckTokenResult>; | ||
|
||
// @public | ||
export function initializeAppCheck(app: FirebaseApp | undefined, options: AppCheckOptions): AppCheck; | ||
|
||
// @public | ||
export function onTokenChanged(appCheckInstance: AppCheck, observer: PartialObserver<AppCheckTokenResult>): Unsubscribe; | ||
|
||
// @public | ||
export function onTokenChanged(appCheckInstance: AppCheck, onNext: (tokenResult: AppCheckTokenResult) => void, onError?: (error: Error) => void, onCompletion?: () => void): Unsubscribe; | ||
|
||
export { PartialObserver } | ||
|
||
// @public | ||
export class ReCaptchaV3Provider implements AppCheckProvider { | ||
constructor(_siteKey: string); | ||
// @internal | ||
getToken(): Promise<AppCheckTokenInternal>; | ||
// @internal (undocumented) | ||
initialize(app: FirebaseApp): void; | ||
// @internal (undocumented) | ||
isEqual(otherProvider: unknown): boolean; | ||
} | ||
|
||
// @public | ||
export function setTokenAutoRefreshEnabled(appCheckInstance: AppCheck, isTokenAutoRefreshEnabled: boolean): void; | ||
|
||
export { Unsubscribe } | ||
|
||
|
||
``` | ||
## API Report File for "@firebase/app-check" | ||
|
||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
```ts | ||
|
||
import { FirebaseApp } from '@firebase/app'; | ||
import { PartialObserver } from '@firebase/util'; | ||
import { Unsubscribe } from '@firebase/util'; | ||
|
||
// @public | ||
export interface AppCheck { | ||
app: FirebaseApp; | ||
} | ||
|
||
// @internal (undocumented) | ||
export type _AppCheckComponentName = 'app-check'; | ||
|
||
// @internal (undocumented) | ||
export type _AppCheckInternalComponentName = 'app-check-internal'; | ||
|
||
// @public | ||
export interface AppCheckOptions { | ||
isTokenAutoRefreshEnabled?: boolean; | ||
provider: CustomProvider | ReCaptchaV3Provider | ReCaptchaEnterpriseProvider; | ||
} | ||
|
||
// @public | ||
export interface AppCheckToken { | ||
readonly expireTimeMillis: number; | ||
// (undocumented) | ||
readonly token: string; | ||
} | ||
|
||
// @public | ||
export type AppCheckTokenListener = (token: AppCheckTokenResult) => void; | ||
|
||
// @public | ||
export interface AppCheckTokenResult { | ||
readonly token: string; | ||
} | ||
|
||
// Warning: (ae-forgotten-export) The symbol "AppCheckProvider" needs to be exported by the entry point index.d.ts | ||
// | ||
// @public | ||
export class CustomProvider implements AppCheckProvider { | ||
constructor(_customProviderOptions: CustomProviderOptions); | ||
// Warning: (ae-forgotten-export) The symbol "AppCheckTokenInternal" needs to be exported by the entry point index.d.ts | ||
// | ||
// @internal (undocumented) | ||
getToken(): Promise<AppCheckTokenInternal>; | ||
// @internal (undocumented) | ||
initialize(app: FirebaseApp): void; | ||
// @internal (undocumented) | ||
isEqual(otherProvider: unknown): boolean; | ||
} | ||
|
||
// @public | ||
export interface CustomProviderOptions { | ||
getToken: () => Promise<AppCheckToken>; | ||
} | ||
|
||
// @public | ||
export function getToken(appCheckInstance: AppCheck, forceRefresh?: boolean): Promise<AppCheckTokenResult>; | ||
|
||
// @public | ||
export function initializeAppCheck(app: FirebaseApp | undefined, options: AppCheckOptions): AppCheck; | ||
|
||
// @public | ||
export function onTokenChanged(appCheckInstance: AppCheck, observer: PartialObserver<AppCheckTokenResult>): Unsubscribe; | ||
|
||
// @public | ||
export function onTokenChanged(appCheckInstance: AppCheck, onNext: (tokenResult: AppCheckTokenResult) => void, onError?: (error: Error) => void, onCompletion?: () => void): Unsubscribe; | ||
|
||
export { PartialObserver } | ||
|
||
// @public | ||
export class ReCaptchaEnterpriseProvider implements AppCheckProvider { | ||
constructor(_siteKey: string); | ||
// @internal | ||
getToken(): Promise<AppCheckTokenInternal>; | ||
// @internal (undocumented) | ||
initialize(app: FirebaseApp): void; | ||
// @internal (undocumented) | ||
isEqual(otherProvider: unknown): boolean; | ||
} | ||
|
||
// @public | ||
export class ReCaptchaV3Provider implements AppCheckProvider { | ||
constructor(_siteKey: string); | ||
// @internal | ||
getToken(): Promise<AppCheckTokenInternal>; | ||
// @internal (undocumented) | ||
initialize(app: FirebaseApp): void; | ||
// @internal (undocumented) | ||
isEqual(otherProvider: unknown): boolean; | ||
} | ||
|
||
// @public | ||
export function setTokenAutoRefreshEnabled(appCheckInstance: AppCheck, isTokenAutoRefreshEnabled: boolean): void; | ||
|
||
export { Unsubscribe } | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.