Skip to main content

keys_policy

Creates, updates, deletes, gets or lists a keys_policy resource.

Overview

Namekeys_policy
TypeResource
Idgoogle.recaptchaenterprise.keys_policy

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. Resource name for this policy. Format: "projects/{project}/keys/{key}/policy" for a policy under a key.
challengeRuleGroupsarrayOptional. Rules to configure the behavior of reCAPTCHA for showing a challenge. Rule groups are evaluated in order. Evaluation stops when the first matching rule group is found.
clientSettingsobjectRequired. Configuration for clients protected by this policy. (id: GoogleCloudRecaptchaenterpriseV1ClientSettings)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_policyselectprojectsId, keysIdGet the policy for a key.
update_policyupdateprojectsId, keysIdupdateMaskUpdates the policy for a key.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
keysIdstring
projectsIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Get the policy for a key.

SELECT
name,
challengeRuleGroups,
clientSettings
FROM google.recaptchaenterprise.keys_policy
WHERE projectsId = '{{ projectsId }}' -- required
AND keysId = '{{ keysId }}' -- required
;

UPDATE examples

Updates the policy for a key.

UPDATE google.recaptchaenterprise.keys_policy
SET
data__clientSettings = '{{ clientSettings }}',
data__name = '{{ name }}',
data__challengeRuleGroups = '{{ challengeRuleGroups }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND keysId = '{{ keysId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
challengeRuleGroups,
clientSettings;