Skip to content

Commit 42f0549

Browse files
committed
KEP-3488: Update table of CEL authz library methods.
1 parent 35befff commit 42f0549

File tree

1 file changed

+20
-17
lines changed
  • keps/sig-api-machinery/3488-cel-admission-control

1 file changed

+20
-17
lines changed

keps/sig-api-machinery/3488-cel-admission-control/README.md

+20-17
Original file line numberDiff line numberDiff line change
@@ -1406,30 +1406,33 @@ We will support admission control use cases requiring permission checks:
14061406
- Validate that only a controller responsible for a finalizer can remove it from the finalizers
14071407
field.
14081408

1409-
To depend on an authz decision, validation expressions can use the `authorizer`
1410-
variable, which performs authz checks for the admission request user (the same
1411-
use as identified by `request.userInfo`), and which will be bound at evaluation
1412-
time to an Authorizer object supporting receiver-style function overloads:
1413-
1414-
| Symbol | Type | Description |
1415-
|-------------|-------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
1416-
| path | Authorizer.(path string) -> PathCheck | Defines a check for an non-resource request path (e.g. /healthz) |
1417-
| check | PathCheck.(httpRequestVerb string) -> Decision | Checks if the user is authorized for the HTTP request verb on the path |
1418-
| resource | Authorizer.(kind string, group string, version string) -> ResourceCheck | Defines a check for API resources |
1419-
| subresource | ResourceCheck.(subresource string) -> ResourceCheck | Specifies thath the check is for a subresource |
1420-
| namespace | ResourceCheck.(namespace string) -> ResourceCheck | Specifies that the check is for a namespace (if not called, the check is for the cluster scope) |
1421-
| name | ResourceCheck.(name string) -> ResourceCheck | Specifies that the check is for a specific resource name |
1422-
| check | ResourceCheck.(apiVerb string) -> Decision | Checks if the admission request user is authorized for the API verb on the resource |
1423-
| allowed | Decision.() -> bool | Is the admission request user authorized? |
1424-
| denied | Decision.() -> bool | Is the admission request user denied authorization? |
1409+
To depend on an authz decision, validation expressions can use the `authorizer` variable, which
1410+
performs authz checks for the admission request user (the same use as identified by
1411+
`request.userInfo`) by default, and which will be bound at evaluation time to an Authorizer object
1412+
supporting receiver-style function overloads:
1413+
1414+
| Symbol | Type | Description |
1415+
|----------------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
1416+
| serviceAccount | Authorizer.(namespace string, name string) -> Authorizer | Returns an authorizer whose subject is the named serviceaccount (instead of admission request user) |
1417+
| path | Authorizer.(path string) -> PathCheck | Defines a check for an non-resource request path (e.g. /healthz) |
1418+
| check | PathCheck.(httpRequestVerb string) -> Decision | Checks if the user is authorized for the HTTP request verb on the path |
1419+
| group | Authorizer.(group string) -> GroupCheck | Defines a check for API resources within a group |
1420+
| resource | GroupCheck.(resource string) -> ResourceCheck | Specifies the resource to be checked within the group |
1421+
| subresource | ResourceCheck.(subresource string) -> ResourceCheck | Specifies that the check is for a subresource |
1422+
| namespace | ResourceCheck.(namespace string) -> ResourceCheck | Specifies that the check is for a namespace (if not called, the check is for the cluster scope) |
1423+
| name | ResourceCheck.(name string) -> ResourceCheck | Specifies that the check is for a specific resource name |
1424+
| check | ResourceCheck.(apiVerb string) -> Decision | Checks if the subject is authorized for the API verb on the resource |
1425+
| allowed | Decision.() -> bool | Is the subject authorized? |
1426+
| reason | Decision.() -> string | Returns a human-readable explanation of why this decision was made |
1427+
| errored | Decision.() -> bool | Returns true if and only if an error occurred while making this decision |
1428+
| error | Decision.() -> string | Returns the text of the error that occurred. If no error occurred, returns the empty string |
14251429

14261430
xref: https://kubernetes.io/docs/reference/access-authn-authz/authorization/#review-your-request-attributes for a details on
14271431
authorization attributes.
14281432

14291433
Example expressions using `authorizer`:
14301434

14311435
- `authorizer.resource('signers', 'certificates.k8s.io', '*').name(oldObject.spec.signerName).check('approve').allowed()`
1432-
- `authorizer.path('/metrics').denied('get')`
14331436

14341437
Note that this API:
14351438

0 commit comments

Comments
 (0)