Skip to content

Extract security.privileges.query in a typealias #1735

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

Merged
merged 4 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
89 changes: 54 additions & 35 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion specification/security/_types/Privileges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,27 @@ export class IndicesPrivileges {
/**
* A search query that defines the documents the owners of the role have read access to. A document within the specified indices must match this query for it to be accessible by the owners of the role.
*/
query?: string[] | QueryContainer | RoleTemplateQueryContainer
query?: IndicesPrivilegesQuery
/**
* Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.
* @server_default false
*/
allow_restricted_indices?: boolean
}

/**
* While creating or updating a role you can provide either a JSON structure or a string to the API.
* However, the response provided by Elasticsearch will only be string with a json-as-text content.
*
* Since this is embedded in IndicesPrivileges, the same structure is used for clarity in both contexts.
*
* @codegen_names text, query, template
*/
export type IndicesPrivilegesQuery =
| string
| QueryContainer
| RoleTemplateQueryContainer

/** @variants container */
export class RoleTemplateQueryContainer {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export class Response {
applications: ApplicationPrivileges[]
cluster: string[]
global: GlobalPrivilege[]
/**
* In this context IndicesPrivileges.query property can only be a string, see IndicesPrivileges documentation for detail.
*/
indices: IndicesPrivileges[]
run_as: string[]
}
Expand Down