-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Adding optional Description field to Roles APIs #182039
Adding optional Description field to Roles APIs #182039
Conversation
/ci |
/ci |
/ci |
Pinging @elastic/kibana-security (Team:Security) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in advance 👍
Could you please also update the get_all_by_space.test.ts test for new added route, where we get all routes for a given space?
@elena-shostak Definitely! Added in latest commit: 6c812ba |
/ci |
/ci |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
History
To update your PR or re-run it, just comment with: cc @kc13greiner |
* master: (1654 commits) Bump ejs from 3.1.9 to 3.1.10 Don't render exceptions flyout if data is loading (elastic#181588) Enable value list modal (elastic#181593) skip flaky suite (elastic#181777) skip failing test suite (elastic#182263) [Mappings Editor] Disable _source field in serverless (elastic#181712) [data.search] Fix unhandled promise rejections (elastic#181785) [Fleet] Fix logic for detecting first time Elastic Agent users (elastic#182214) [ML] Decouple data_visualizer from MapEmbeddable (elastic#181928) [ES|QL] Sorting accepts expressions (elastic#181916) [ML] Single Metric Viewer: ensures chart displays correctly when opening from a job annotation (elastic#182176) Adding optional Description field to Roles APIs (elastic#182039) Upgrade Markdown-it to 14.1.0 (elastic#182244) Bump xml-crypto from 5.0.0 to 6.0.0 [DOCS] Fix docs and screenshots for rule creation changes (elastic#181925) Update dependency elastic-apm-node to ^4.5.3 (main) (elastic#182236) [Obs AI Assistant] register alert details context in observability plugin (elastic#181501) Add `@typescript-eslint/no-floating-promises` (elastic#181456) [Playground] Propagate Error message into FE (elastic#182201) [ES|QL] Rename the setting to a more generic one and move to the general section (elastic#182074) ...
## Summary In preparation for the KB UI and ES API to accept `description` for Roles, Kibana `get`, `getAll`, and `put` Roles routes should handle a description. ## Testing Start KB/ES locally In Dev Tools PUT role: ``` PUT kbn:api/security/role/mytestrole { "description": "This is a test role", "metadata": { "version": 1 }, "elasticsearch": { "cluster": [ ], "indices": [ ] }, "kibana": [ { "base": [ ], "feature": { "discover": [ "all" ], "visualize": [ "all" ], "dashboard": [ "all" ], "dev_tools": [ "read" ], "advancedSettings": [ "read" ], "indexPatterns": [ "read" ], "graph": [ "all" ], "apm": [ "read" ], "maps": [ "read" ], "canvas": [ "read" ], "infrastructure": [ "all" ], "logs": [ "all" ], "uptime": [ "all" ] }, "spaces": [ "*" ] } ] } ``` This will fail since ES doesn't accept `descriptions` yet Pull the ES Role Description PR elastic/elasticsearch#107088 and run `yarn es source` and `yarn start` Rerun the PUT above, receive 204! Check the role `description` with a GET: ``` GET kbn:api/security/role/mytestrole ``` <img width="1712" alt="Screenshot 2024-04-30 at 9 43 32 PM" src="https://github.com/elastic/kibana/assets/21210601/20394086-f223-4be8-8660-eb8d3930116c"> It has a limit of 2048 per the requirements: <img width="2248" alt="Screenshot 2024-04-30 at 9 45 13 PM" src="https://github.com/elastic/kibana/assets/21210601/7dc97a8e-1246-49e4-954e-885be433c7c7">
Summary
In preparation for the KB UI and ES API to accept
description
for Roles, Kibanaget
,getAll
, andput
Roles routes should handle a description.Testing
Start KB/ES locally
In Dev Tools PUT role:
This will fail since ES doesn't accept
descriptions
yetPull the ES Role Description PR elastic/elasticsearch#107088
and run
yarn es source
andyarn start
Rerun the PUT above, receive 204!
Check the role
description
with a GET:It has a limit of 2048 per the requirements: