Skip to content
Prev Previous commit
Next Next commit
address tech review feedback (#1685)
  • Loading branch information
Xiaoshouzi-gh committed Apr 12, 2023
commit 1a0458ded80ebac2a208355098c109d7029710c7
21 changes: 10 additions & 11 deletions src/auth/auth-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1722,19 +1722,18 @@ export class SmsRegionsAuthConfig {
}
}
}

/**
* Enforcement state of reCAPTCHA protection.
* - 'OFF': Unenforced.
* - 'AUDIT': Assessment is created but result is not used to enforce.
* - 'ENFORCE': Assessment is created and result is used to enforce.
*/
* Enforcement state of reCAPTCHA protection.
* - 'OFF': Unenforced.
* - 'AUDIT': Create assessment but don't enforce the result.
* - 'ENFORCE': Create assessment and enforce the result.
*/
export type RecaptchaProviderEnforcementState = 'OFF' | 'AUDIT' | 'ENFORCE';

/**
* The actions for reCAPTCHA-protected requests.
* - 'BLOCK': The reCAPTCHA-protected request will be blocked.
*/
* The actions to take for reCAPTCHA-protected requests.
* - 'BLOCK': The reCAPTCHA-protected request will be blocked.
*/
export type RecaptchaAction = 'BLOCK';

/**
Expand All @@ -1752,7 +1751,7 @@ export interface RecaptchaManagedRule {
}

/**
* The key's platform type: only web supported now.
* The key's platform type: only web is currently supported.
*/
export type RecaptchaKeyClientType = 'WEB';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually support ANDROID and IOS too..

Does this mean the config returned will not show the mobile platform keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! We do return all 3 keys since we don't validate the key response. I think only web was supported at the time. Updated with all 3 type in the new commit.


Expand All @@ -1779,7 +1778,7 @@ export interface RecaptchaKey {
*/
export interface RecaptchaConfig {
/**
* The enforcement state of email password provider.
* The enforcement state of the email password provider.
*/
emailPasswordEnforcementState?: RecaptchaProviderEnforcementState;
/**
Expand Down
5 changes: 1 addition & 4 deletions src/auth/project-config-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import {
} from './auth-api-request';

/**
* Defines the project config manager used to help manage project config related operations.
* This includes:
* <ul>
* <li>The ability to update and get project config.</li>
* Manages (gets and updates) the current project config.
*/
export class ProjectConfigManager {
private readonly authRequestHandler: AuthRequestHandler;
Expand Down
24 changes: 12 additions & 12 deletions src/auth/project-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ export interface UpdateProjectConfigRequest {
* The multi-factor auth configuration to update on the project.
*/
multiFactorConfig?: MultiFactorConfig;

/**
* The recaptcha configuration to update on the project.
* By enabling reCAPTCHA Enterprise Integration you are
* agreeing to reCAPTCHA Enterprise
* The reCAPTCHA configuration to update on the project.
* By enabling reCAPTCHA Enterprise integration, you are
* agreeing to the reCAPTCHA Enterprise
* {@link https://cloud.google.com/terms/service-terms | Term of Service}.
*/
recaptchaConfig?: RecaptchaConfig;
}

/**
* Response received from getting or updating a project config.
* This object currently exposes only the SMS Region config.
* Response received when getting or updating the project config.
* Currently only includes the reCAPTCHA and SMS Region config.
*/
export interface ProjectConfigServerResponse {
smsRegionConfig?: SmsRegionConfig;
Expand All @@ -59,8 +59,8 @@ export interface ProjectConfigServerResponse {
}

/**
* Request sent to update project config.
* This object currently exposes only the SMS Region config.
* Request to update the project config.
* Currently only includes the reCAPTCHA and SMS Region config.
*/
export interface ProjectConfigClientRequest {
smsRegionConfig?: SmsRegionConfig;
Expand All @@ -86,9 +86,9 @@ export class ProjectConfig {
private readonly multiFactorConfig_?: MultiFactorConfig;

/**
* The recaptcha configuration to update on the project config.
* By enabling reCAPTCHA Enterprise Integration you are
* agreeing to reCAPTCHA Enterprise
* The reCAPTCHA configuration to update on the project.
* By enabling reCAPTCHA Enterprise integration, you are
* agreeing to the reCAPTCHA Enterprise
* {@link https://cloud.google.com/terms/service-terms | Term of Service}.
*/
private readonly recaptchaConfig_?: RecaptchaAuthConfig;
Expand Down Expand Up @@ -163,7 +163,7 @@ export class ProjectConfig {
}

/**
* The recaptcha configuration.
* The reCAPTCHA configuration.
*/
get recaptchaConfig(): RecaptchaConfig | undefined {
return this.recaptchaConfig_;
Expand Down
6 changes: 3 additions & 3 deletions src/auth/tenant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export interface UpdateTenantRequest {
smsRegionConfig?: SmsRegionConfig;

/**
* The recaptcha configuration to update on the tenant.
* By enabling reCAPTCHA Enterprise Integration you are
* agreeing to reCAPTCHA Enterprise
* The reCAPTCHA configuration to update on the tenant.
* By enabling reCAPTCHA Enterprise integration, you are
* agreeing to the reCAPTCHA Enterprise
* {@link https://cloud.google.com/terms/service-terms | Term of Service}.
*/
recaptchaConfig?: RecaptchaConfig;
Expand Down