Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Update feature privilege docs to reflect new route authorization #201017

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions dev_docs/key_concepts/feature_privileges.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ public setup(core: CoreSetup, deps: FeatureControlExampleDeps) {
{
path: '/internal/my_plugin/sensitive_action',
validate: false,
options: {
tags: ['access:my_closed_example_api'],
security: {
authz: {
requiredPrivileges: ['my_closed_example_api']
}
},
},
async (context, request, response) => {
Expand All @@ -193,8 +195,11 @@ public setup(core: CoreSetup, deps: FeatureControlExampleDeps) {
);
}
```
<DocCallOut>
For more information on the `security.authz` object and API authorization, please refer to our guide on <DocLink id="kibDevDocsSecurityAPIAuthorization" text="Configuring authorization on routes"/>
</DocCallOut>

Notice, we've added an `options.tags` property for the API route that returns sensitive information. This tag is then used in the privileges object as follow
Notice, we've added a `security.authz.requiredPrivileges` property for the API route that returns sensitive information. This added configuration is then used in the privileges object as follow

```ts
{
Expand Down Expand Up @@ -347,7 +352,6 @@ A deep dive into every option for the Kibana Feature configuration and what they
}
```


### FeatureKibanaPrivileges Interface

#### excludeFromBasePrivileges (optional)
Expand Down