PingCentral

Creating and testing approval expressions

Configure a Spring Expression Language (SpEL) expression to manage promotion approval requirements for your environment.

Before you begin

When you configure an environment, on the Connection page, select Require Approval If Any Expression Fails or Require Approval If Any Expression Succeeds from the Approval Expression list. For more information, see Adding environments.

About this task

You can manage promotion approval requirements for your PingCentral environment by creating custom approval expressions with Spring Expression Language (SpEL). These expressions will evaluate the application based on its JSON payload to determine whether an administrator will be required to approve promotions.

Steps

  1. On the Connection page, in the Approval Expression field, click Test to expand the Test Spring Expression window.

    Result:

    The Test Spring Expression window displays.

  2. In the Application Configuration field, enter the application configuration information as a JSON payload.

    If you have promotion configuration information, enter it as a JSON payload in the Promotion Configuration field.

  3. In the Spring Expression field, use the following function to extract values from the JSON payload using a specified JSON path: #jsonPath(\{JSON payload}, \{JSON path}).

    Build your own expressions using the following variables:

    • #application: Represents the type of application (OAuth, OIDC, SAML Service Provider (SP), or PingAccess) and its corresponding API model (ClientApplicationView, ConnectionApplicationView, or PingAccessApplicationView).

    • #oAuthApplicationPromotion: Provides access to the OAuthApplicationPromotionView API model and promotion configuration information for OAuth and OIDC applications.

    • #samlSpApplicationPromotion: Provides access to the SamlApplicationPromotionView API model and promotion configuration information for SAML SP applications.

    • #pingAccessApplicationPromotion: Provides access to the PingAccessApplicationPromotionView API model and promotion configuration information for PingAccess applications.

    For help building expressions, see SpEL approval expression examples or Spring Expression Language (SpEL) in the Spring Framework documentation.

  4. Under the Spring Expression field, click Test Expression to test your expression.

    Result:

    The Spring Expression result displays.

    For information about approval expression handling, see the following:

    • If you selected Require Approval If Any Expression Fails from the Approval Type list: If any expression results in false then approval is required. If all expressions are true then approval is not required.

    • If you selected Require Approval If Any Expression Succeeds from the Approval Type list: If any expression results in true then approval is required. If all expressions are false then approval is not required.

    • If any of the expressions do not return a Boolean value or if there are any errors in the expressions, the promotions will require approval.

    • Multiple expressions can be added, and are evaluated sequentially from top to bottom in an IF/ELSE chain. You can change the order in which these expressions display in the list by dragging and dropping them into different locations within the list.

  5. Click the Update button to save your configuration or click the Cancel button to discard it.