Skip to content

Commit 6be08b1

Browse files
update criterion definition & fix example policy
1 parent a11064a commit 6be08b1

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

content/docs/get-started/fundamentals/core/build-policies.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ There are four logical operators:
115115

116116
In PPL, a criterion defines a specific condition to evaluate, such as a user’s email or device type.
117117

118-
- Each criterion is an object where the key is the criterion name (optionally with a sub-path, delimited by `/`), and the value specifies what to match or compare.
119-
- The exact format of the value depends on the type of criterion being used.
118+
- Each criterion is represented by an object with a single key/value pair, where the key is the criterion type.
119+
- For some criteria the key accepts a sub-path, delimited by /. For example: claim/family_name.
120+
- The format of the criterion value varies depending on the criterion type.
121+
- Some criteria do not use their value. For example: `accept`, `reject`, and `authenticated_user`. In this case, the value can be anything.
120122

121123
#### Matchers
122124

@@ -140,11 +142,11 @@ Now that you've briefly covered PPL, let's jump into some simple examples:
140142
This example instructs Pomerium to only grant a user access if their email address is `[email protected]`.
141143

142144
```yaml title="PPL rule"
143-
policy: # Policy object starts here
144-
allow: # At least one action
145-
and: # Logical operator
146-
- email: # Criterion
147-
is: [email protected] # Value
145+
policy:
146+
allow:
147+
and:
148+
- email:
149+
148150
```
149151

150152
**Example 2**: Allow access based on the domain criterion
@@ -218,7 +220,7 @@ policy:
218220
allow:
219221
and:
220222
- domain:
221-
is: example.com
223+
is: example.com
222224
```
223225

224226
Now, access the route.

content/docs/internals/ppl.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ Although these policies are equally effective, we recommend using just one opera
135135

136136
In PPL, a criterion defines a specific condition to evaluate, such as a user’s email or device type.
137137

138-
- Each criterion is an object where the key is the criterion name (optionally with a sub-path, delimited by `/`), and the value specifies what to match or compare.
139-
- The exact format of the value depends on the type of criterion being used.
138+
- Each criterion is represented by an object with a single key/value pair, where the key is the criterion type.
139+
- For some criteria the key accepts a sub-path, delimited by /. For example: claim/family_name.
140+
- The format of the criterion value varies depending on the criterion type.
141+
- Some criteria do not use their value. For example: `accept`, `reject`, and `authenticated_user`. In this case, the value can be anything.
140142

141143
```yaml
142144
allow:

0 commit comments

Comments
 (0)