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

[8.16] [Authz] Fix description generation for Open API spec for an API (#198054) #198837

Merged

Conversation

SiddharthMantri
Copy link
Contributor

Backport

This will backport the following commits from main to 8.16:

Questions ?

Please refer to the Backport tool documentation

\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by: Sid "}}]}] BACKPORT-->

…tic#198054)

Closes elastic#198058.

Adds a fix for elastic#197001

## Summary
There was an error in how descriptions were added to the Open API spec
for a given route - for the specific case when both a route description
and security authz required privileges were present. The code with the
error is:
https://github.com/elastic/kibana/pull/197001/files#diff-5942307fac5a7b321e7f317bacd2837a7f766f3e79d5aad285513b1f82951b46R79-R80

This PR fixes that error.

Also updated: Description field for required privileges now includes a
more intuitive descriptor: `Required authorization` as well as a line
break.

<img width="838" alt="image"
src="https://github.com/user-attachments/assets/e6af0459-28e8-40e5-873d-924d1a49b01b">

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit b12e7d0)

# Conflicts:
#	packages/kbn-router-to-openapispec/src/process_router.ts
#	packages/kbn-router-to-openapispec/src/process_versioned_router.ts
Copy link
Contributor

@kc13greiner kc13greiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backport LGTM!

…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --update --no-serverless'
@SiddharthMantri SiddharthMantri merged commit c450a85 into elastic:8.16 Nov 4, 2024
21 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants