Política VerifyIAM

Esta página se aplica a Apigee, pero no a Apigee Hybrid.

Consulta la documentación de Apigee Edge.

Descripción general

VerifyIAM es parte de un método basado en IAM de Google Cloud para administrar la autenticación y la autorización para el acceso a la API, similar a la política de OAuthv2. Para obtener información sobre cómo incluir VerifyIAM en una solución de control de acceso basada en IAM, consulta Descripción general de la autenticación de API basada en IAM.

Esta es una política estándar y se puede implementar en cualquier tipo de entorno. Para obtener información sobre los tipos de políticas y la disponibilidad con cada tipo de entorno, consulta Tipos de políticas.

Referencia de elementos

En esta referencia, se muestran los elementos y atributos de la política VerifyIAM.

<VerifyIAM async="false" continueOnError="false" enabled="true" name="MyVerifyIAMPolicy">
    <DisplayName>Custom label used in UI</DisplayName>
    <CredentialSource>flow_variable_name_containing_credential_value</CredentialSource>
</VerifyIAM>

Atributos <VerifyIAM>

<VerifyIAM async="false" continueOnError="false" enabled="true" name="MyVerifyIAMPolicy">

The following table describes attributes that are common to all policy parent elements:

Attribute Description Default Presence
name

The internal name of the policy. The value of the name attribute can contain letters, numbers, spaces, hyphens, underscores, and periods. This value cannot exceed 255 characters.

Optionally, use the <DisplayName> element to label the policy in the management UI proxy editor with a different, natural-language name.

N/A Required
continueOnError

Set to false to return an error when a policy fails. This is expected behavior for most policies.

Set to true to have flow execution continue even after a policy fails. See also:

false Optional
enabled

Set to true to enforce the policy.

Set to false to turn off the policy. The policy will not be enforced even if it remains attached to a flow.

true Optional
async

This attribute is deprecated.

false Deprecated

<DisplayName> element

Use in addition to the name attribute to label the policy in the management UI proxy editor with a different, natural-language name.

<DisplayName>Policy Display Name</DisplayName>
Default

N/A

If you omit this element, the value of the policy's name attribute is used.

Presence Optional
Type String

Elemento <CredentialSource>

<CredentialSource>flow_variable_name_containing_credential_value</CredentialSource>

Este elemento especifica la variable de flujo que contiene el valor de la credencial y tiene las siguientes características:

  • Por lo general, el cliente envía el valor en un parámetro de consulta, un encabezado HTTP o un parámetro de formulario. La cadena debe especificar la variable de flujo correspondiente en el formato request.queryparam.token.
  • Cuando se lee desde la referencia, se espera un valor directo. Por ejemplo, "Bearer" no debe estar presente como prefijo.
  • Si se omite, la ejecución de la política supone que el valor está en el encabezado de autorización y en el formato estándar "Bearer xyz".
Predeterminado N/A
Presence Opcional
Tipo Variable de flujo

Ejemplo:

<VerifyIAM async="false" continueOnError="false" enabled="true" name="Verify-IAM-Permissions-1">
    <DisplayName>VerifyIAM policy for flow 1</DisplayName>
    <CredentialSource>request.queryparam.token</CredentialSource>
</VerifyIAM>

Referencia de errores

This section describes the fault codes and error messages that are returned and fault variables that are set by Apigee when this policy triggers an error. This information is important to know if you are developing fault rules to handle faults. To learn more, see What you need to know about policy errors and Handling faults.

Runtime errors

These errors can occur when the policy executes.

Fault code HTTP status Cause
steps.verifyiam.CredentialSourceRefUnresolved 400 Flow variable provided inside credential source could not be resolved.
steps.verifyiam.CredentialValueNotProvided 400 Credential not found. If the credential source reference is not provided, we look at the default place like authorization header.
steps.verifyiam.Forbidden 403 Request could not be forwarded due to lack of sufficient permissions or missing access scopes or any other related issues.
steps.verifyiam.MiscellaneousAuthorizationConfigurationError 500 An issue with the authentication request to IAM. The API producer needs to fix this error based on details in the error response.
steps.verifyiam.Unauthorized 401 Problem with the credential, such as the value being invalid or expired.
steps.verifyiam.UnexpectedAuthorizationInfrastructureError 500 Internal error.

Deployment errors

This policy does not return any policy-specific deployment errors.

Fault variables

These variables are set when this policy triggers an error at runtime.

Variables Where Example
fault.name="fault_name" fault_name is the name of the fault, as listed in the Runtime errors table above. The fault name is the last part of the fault code. fault.name="Unauthorized"
verifyiam.policy_name.failed policy_name is the user-specified name of the policy that threw the fault. verifyiam.Verify-IAMToken.failed = true