Skip to content

Commit 4d0c751

Browse files
committed
Defined reCAPTCHA config. (#1574)
* Defined reCAPTCHA config. - Added reCAPTCHA protection states. - Added reCAPTCHA action rule. - Added reCAPTCHA key config.
1 parent 90426de commit 4d0c751

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

src/auth/auth-config.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,3 +1722,68 @@ export class SmsRegionsAuthConfig {
17221722
}
17231723
}
17241724
}
1725+
1726+
/**
1727+
* Enforcement state of reCAPTCHA protection.
1728+
* - 'OFF': Unenforced.
1729+
* - 'AUDIT': Assessment is created but result is not used to enforce.
1730+
* - 'ENFORCE': Assessment is created and result is used to enforce.
1731+
*/
1732+
export type RecaptchaProviderEnforcementState = 'OFF' | 'AUDIT' | 'ENFORCE';
1733+
1734+
/**
1735+
* The actions for reCAPTCHA-protected requests.
1736+
* - 'BLOCK': The reCAPTCHA-protected request will be blocked.
1737+
*/
1738+
export type RecaptchaAction = 'BLOCK';
1739+
1740+
/**
1741+
* The config for a reCAPTCHA action rule.
1742+
*/
1743+
export interface RecaptchaManagedRule {
1744+
/**
1745+
* The action will be enforced if the reCAPTCHA score of a request is larger than endScore.
1746+
*/
1747+
endScore: number;
1748+
/**
1749+
* The action for reCAPTCHA-protected requests.
1750+
*/
1751+
action?: RecaptchaAction;
1752+
}
1753+
1754+
/**
1755+
* The key's platform type: only web supported now.
1756+
*/
1757+
export type RecaptchaKeyClientType = 'WEB';
1758+
1759+
/**
1760+
* The reCAPTCHA key config.
1761+
*/
1762+
export interface RecaptchaKey {
1763+
/**
1764+
* The key's client platform type.
1765+
*/
1766+
type?: RecaptchaKeyClientType;
1767+
1768+
/**
1769+
* The reCAPTCHA site key.
1770+
*/
1771+
key: string;
1772+
}
1773+
1774+
export interface RecaptchaConfig {
1775+
/**
1776+
* The enforcement state of email password provider.
1777+
*/
1778+
emailPasswordEnforcementState?: RecaptchaProviderEnforcementState;
1779+
1780+
/**
1781+
* The reCAPTCHA managed rules.
1782+
*/
1783+
managedRules: RecaptchaManagedRule[];
1784+
1785+
/**
1786+
* The reCAPTCHA keys.
1787+
*/
1788+
recaptchaKeys?: RecaptchaKey[];
1789+
}

0 commit comments

Comments
 (0)