Policies contain rules that can validate, authorize, authenticate, and transform requests, and shape
and transform responses. Inbound rules, Outbound rules, and
Response rules describe the available rules.
It's good practice to understand the functionality of the Services to decide which rules to add
and how to configure them. A good descriptive name is also important, especially if other Service
developers can reuse the Policy.
-
Navigate to the Policy Catalog.
-
Click New Policy.
The Policy builder opens with a Policy named New policy.
-
Click the New policy title, and enter a name for your Policy.
-
To add a rule:
-
Click the plus icon for the category of rule to add:
The category panel opens. For example, the following shows the available
Validation rules:
-
Click the rule to add.
The rule settings panel opens. For example, the following shows
Inbound TLS settings:
-
Optionally, in When this policy should be applied, enter an expression with
the condition that must be true for the rule to apply. Without an expression, a rule applies to all
requests.
For example, the expression request.method == "GET" causes the rule to run only on GET requests.
-
Configure the appropriate settings. Refer to Rule reference for explanations of the fields for each rule.
-
Click Validate & save.
-
Repeat the previous steps to add other rules to this Policy.
-
Optionally, click Add account to create an account for an outbound rule,
then click the account type.
-
When the Policy contains all required rules, click Save.
-
Select the project in which to save the Policy.
-
Click Save.