Skip to content

Commit

Permalink
Add docs for role.spec.allow.reason.mode (#49537)
Browse files Browse the repository at this point in the history
  • Loading branch information
kopiczko authored Nov 29, 2024
1 parent 4cd6273 commit 4e4b0ff
Showing 1 changed file with 42 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ below:

```yaml
kind: role
version: v6
version: v7
metadata:
name: employee
spec:
Expand Down Expand Up @@ -120,7 +120,7 @@ For example, the following role enables a user to search for resources that the
```yaml
# requester.yaml
kind: role
version: v6
version: v7
metadata:
name: k8s-requester
spec:
Expand Down Expand Up @@ -215,7 +215,7 @@ You can specify the `max_duration` option with a role like the following:

```yaml
kind: role
version: v6
version: v7
metadata:
name: temp-dba
spec:
Expand Down Expand Up @@ -271,7 +271,7 @@ your ticket ID":

```yaml
kind: role
version: v6
version: v7
metadata:
name: employee
spec:
Expand All @@ -294,6 +294,41 @@ user:
1. If one of the user's roles includes the `reason` strategy, the user must
provide a reason when authenticating.

## Requiring request reasons

The `allow.request.reason.mode` field controls whether a reason is required when users submit
Access Requests.

Allowed values are:

|Value|Meaning|
|---|---|
| `optional` | The default. The user does not need to provide a reason when making a request. |
| `required` | The user must provide a non-empty reason when making a request. |

Example:

```yaml
kind: role
version: v7
metadata:
name: node-requester
spec:
allow:
request:
roles:
- 'node-access'
search_as_roles:
- 'root-node-access'
reason:
mode: 'required'
```

If a user with "node-requester" role assigned makes an Access Request for "node-access" role or any
resource allowed by "root-node-access" they will be required to provide a reason. If a user's
role set includes multiple roles governing Access Requests to the same roles and resources,
"require" mode takes precedence.

## Review thresholds

You can configure a user's roles to specify the criteria that an Access Request
Expand All @@ -307,7 +342,7 @@ roles:

```yaml
kind: role
version: v6
version: v7
metadata:
name: devops
spec:
Expand Down Expand Up @@ -430,7 +465,7 @@ The following role adds the suggested reviewers `user1` and `user2`:

```yaml
kind: role
version: v6
version: v7
metadata:
name: employee
spec:
Expand Down Expand Up @@ -559,7 +594,7 @@ them, use the `allow.review_requests.preview_as_roles` and

```yaml
kind: role
version: v6
version: v7
metadata:
name: reviewer
spec:
Expand Down

0 comments on commit 4e4b0ff

Please sign in to comment.