-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Updatable API keys - REST API spec and tests #88270
Merged
Merged
Changes from 200 commits
Commits
Show all changes
208 commits
Select commit
Hold shift + click to select a range
3bba543
Service and request draft
n1v0lg 3a709a9
Update response
n1v0lg fc53cf3
Get api key docs for name
n1v0lg 74d264c
More
n1v0lg 0bc2ec5
More
n1v0lg 648ae52
Check expiration
n1v0lg 2d43dda
Integ test
n1v0lg 4384e56
More
n1v0lg 3d73b99
Assert role descriptors as expected
n1v0lg ff54fec
Clean up role descriptor checks
n1v0lg e484923
Test not found
n1v0lg a9c8caa
WIP expected metadata
n1v0lg d638a45
Fix metadata
n1v0lg 0c819e4
Nit
n1v0lg abe677b
Fix setting metadata
n1v0lg 3c7b2c1
Nit
n1v0lg 29f0320
WIP use old role descriptors
n1v0lg eef2b38
Clean up
n1v0lg e5b8650
More todos
n1v0lg 30cfc39
One more
n1v0lg b14271a
Other users API key not found
n1v0lg cd5d58f
Nit
n1v0lg eeca38a
Tweaks
n1v0lg 7c3d3f0
Null bytes
n1v0lg f6d1783
Other
n1v0lg 0e44586
Not found test clean up
n1v0lg 3c83743
Tweaks
n1v0lg b88cdc8
Inactive tests
n1v0lg 68eaa91
Expiration test
n1v0lg 36bb431
Friendlier exception message
n1v0lg c545e20
Translate response
n1v0lg 63c0729
Noop not possible
n1v0lg 7aefeb1
Merge branch 'master' into update-api-keys-service-level
n1v0lg 89d7229
Much clean up
n1v0lg 003f969
Test validate
n1v0lg 8937d94
Spotless
n1v0lg bdd4dfb
Also test empty name
n1v0lg 4bd5cad
More clean up
n1v0lg d88f949
Skip todo
n1v0lg 421e04f
Remove unused
n1v0lg 719e4ba
Update request tests and serialization
n1v0lg c536534
Lint
n1v0lg c46ab34
Clean up
n1v0lg de179dd
Merge branch 'master' into update-api-keys-service-level
n1v0lg 7931e00
Nits
n1v0lg 3f8b218
Checkstyle
n1v0lg 7166217
Fix
n1v0lg 0f48e8c
Owner realms
n1v0lg ae573ca
Checkstyle
n1v0lg 629e5a1
Merge branch 'master' into update-api-keys-service-level
n1v0lg d29c1e2
Use raw field
n1v0lg 147adb0
Clean up new and merged doc
n1v0lg 8cffe22
With versioning
n1v0lg 0cac5e5
Clean up
n1v0lg 7d9956e
Invalidate doc cache
n1v0lg f5d089f
More clean up
n1v0lg 0b34c7b
Test cache
n1v0lg 65c8d46
Assert auth cache not cleared
n1v0lg 2e3b623
Null tweaks
n1v0lg 2f91430
Null input stream
n1v0lg 73d3fac
Merge branch 'master' into update-api-keys-service-level
n1v0lg ef49292
Updated doc test
n1v0lg 3f099c4
Lint
n1v0lg 9426e56
More lint
n1v0lg 325d4d0
More clean up
n1v0lg 044831f
Put in version stop gap
n1v0lg 1d3d8a2
Combine tests
n1v0lg e377155
Include domain
n1v0lg e95fd34
Use param message
n1v0lg c536811
Bump version
n1v0lg b7b4c36
Check get api correct metadata
n1v0lg 30b0267
Rename
n1v0lg 17375b3
Still the logging
n1v0lg 0481c01
Imports
n1v0lg 1a29f8b
Test creator
n1v0lg 6d7a341
Add creator assertions
n1v0lg 99d5d06
Randomize expiration
n1v0lg 6d7013c
Fix assertion
n1v0lg 64990b5
WIP tests multiple role descriptors
n1v0lg bba8f2b
More clean up
n1v0lg dd69a00
Support multiple roles
n1v0lg 3aefef8
Domain check and test clean up
n1v0lg 49b4dd5
Better names
n1v0lg 4a0b2b2
WIP address feedback
n1v0lg 2bd3ea4
Scroll helper
n1v0lg 0473c5d
Add assertion
n1v0lg 6c33703
api key error message
n1v0lg d7bd723
More inline
n1v0lg 9418b9b
Merge branch 'master' into update-api-keys-service-level
n1v0lg 0b2457d
Single and fix test
n1v0lg 3f283d9
Better error message
n1v0lg 0d02eba
Nit
n1v0lg 82fdb6b
Api keys not allowed
n1v0lg 7a371a4
Move assertion up
n1v0lg 4586139
Merge branch 'master' into update-api-keys-service-level
n1v0lg 910500b
Merge branch 'master' into update-api-keys-service-level
n1v0lg a9dd29f
WIP actions
n1v0lg 41d3f03
Manage own api key priv
n1v0lg d26f459
WIP
n1v0lg a9d005f
Error message
n1v0lg 49eba62
Nit
n1v0lg 3fdb5ff
Simplify
n1v0lg df2b6a3
Role descs
n1v0lg 58019b4
More tweaks
n1v0lg 58a7e02
Assert
n1v0lg 3946dc1
Merge branch 'master' into update-api-keys-service-level
n1v0lg a896ae0
Address feedback
n1v0lg 542b360
More logs and finals
n1v0lg 7c36b17
Merge branch 'master' into update-api-keys-service-level
n1v0lg b9fcad1
More randomization in test
n1v0lg 2b45045
Merge branch 'master' into update-api-keys-service-level
n1v0lg 87b6fb0
Caps API key
n1v0lg 725248d
Merge branch 'master' into update-api-keys-service-level
n1v0lg 7481d52
Merge branch 'master' into update-api-keys-service-level
n1v0lg 160cac3
Merge branch 'update-api-keys-service-level' into update-api-keys-res…
n1v0lg 59b9093
WIP
n1v0lg ca65709
Address review
n1v0lg e025390
Merge branch 'master' into update-api-keys-service-level
n1v0lg 8ed5724
Merge branch 'update-api-keys-service-level' into update-api-keys-res…
n1v0lg 8a1a88b
Hard-won rest test
n1v0lg 782f6ec
Nits
n1v0lg 60a0755
Plug in client
n1v0lg d8fc643
Merge
n1v0lg 7e2e786
WIP
n1v0lg 44f16ab
Merge branch 'master' into update-api-keys-rest-transport-layers
n1v0lg 4ff33aa
Native realm user
n1v0lg 5489f53
Api key test
n1v0lg 41b573f
REST test
n1v0lg 665c426
Expect metadata rest test
n1v0lg 84b22f6
Nit
n1v0lg a04792b
Manage own api key test
n1v0lg 7f5240a
Tweak method
n1v0lg 74b9e79
More tweaks
n1v0lg 6a89230
Simplify
n1v0lg ab9b0d8
Only post
n1v0lg 673de56
Clean up
n1v0lg 9ada903
Use stream utils
n1v0lg dc1db79
Undo
n1v0lg e8d7bb8
Undo more
n1v0lg a354673
Nit
n1v0lg 96e4864
Import
n1v0lg 85ee9de
Add to non-operator constants
n1v0lg d538118
Clean up
n1v0lg 77021e4
Few more tweaks
n1v0lg 222d475
Nit
n1v0lg 7654f75
Address early feedback
n1v0lg 1ead5ea
Merge branch 'master' into update-api-keys-rest-transport-layers
n1v0lg 5aab296
Fix tests
n1v0lg 0f17546
Better error message
n1v0lg b3aaf2e
WIP rest tests
n1v0lg 9e7ce5e
Also test bearer token auth
n1v0lg 085cc4f
Grant target can update api key test
n1v0lg dde0b72
Refactor
n1v0lg f90b93e
Randomize auth method
n1v0lg 5e7a5bd
Use header constant
n1v0lg 4be5dee
Randomize cluster privs
n1v0lg 7b137d2
Plug in more client
n1v0lg 5070e48
Import
n1v0lg bad21a0
Random realm id
n1v0lg cb67b3e
Get random node
n1v0lg 046a22d
Nit
n1v0lg a2f5f38
Add back comment
n1v0lg 4f66060
Auto sync user roles test
n1v0lg 46bc5f2
Merge branch 'master' into update-api-keys-rest-transport-layers
n1v0lg 57938c5
Clean up test
n1v0lg 6a2deb1
Test grantor cannot update
n1v0lg a838648
Include ID in assertion
n1v0lg 2d6d9d0
Update docs/changelog/88186.yaml
n1v0lg 3e3e5e0
Changelog
n1v0lg 05571e2
Merge branch 'master' into update-api-keys-rest-transport-layers
n1v0lg 57b7e67
Validator tests
n1v0lg 0fc25b9
Priv test
n1v0lg 75e2e0e
Clean up tests
n1v0lg ea8d79e
Randomize more but not too much
n1v0lg bedd5b0
Imports
n1v0lg 96e681a
Randomize cluster privs in auto update test
n1v0lg 7d80fc8
Rest spec
n1v0lg 01453a0
WIP test
n1v0lg 56cc6e8
Yaml is great
n1v0lg cf580a0
Fix
n1v0lg 60514e3
Test update
n1v0lg 7447a01
Format
n1v0lg ae64208
More test wip
n1v0lg b965043
WIP privs
n1v0lg bb612ef
Has priv assert
n1v0lg a424a95
Metadata
n1v0lg 5c90ec3
Assert on metadata
n1v0lg 38c4601
Fix typo
n1v0lg b745020
Test does to replace
n1v0lg 0f76663
Nit
n1v0lg e145418
Empty request fields test
n1v0lg c0c4ecf
Test auto update
n1v0lg 84350c0
Merge branch 'master' into updatable-api-keys-rest-spec
n1v0lg f1ade59
Add spec type
n1v0lg 0523f40
Spacing nit
n1v0lg d93e20e
Singular id in rest spec
n1v0lg 7b9581a
Merge branch 'master' into updatable-api-keys-rest-spec
n1v0lg 9e75b44
Undo
n1v0lg 7ed1094
Body not required
n1v0lg 433b2d9
No body test
n1v0lg cc7cf5c
Add note on empty body
n1v0lg ca0ae11
Omit
n1v0lg 2444a58
Update docs/changelog/88270.yaml
n1v0lg bcd5cdf
Merge branch 'master' into updatable-api-keys-rest-spec
n1v0lg 508c9e4
Merge branch 'master' into updatable-api-keys-rest-spec
n1v0lg c43444c
Doc stubs
n1v0lg 99c7214
Remove clear cache calls
n1v0lg 218c559
Changelog
n1v0lg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
rest-api-spec/src/main/resources/rest-api-spec/api/security.update_api_key.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"security.update_api_key": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html", | ||
"description": "Updates attributes of an existing API key." | ||
}, | ||
"stability": "stable", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": [ | ||
"application/json" | ||
], | ||
"content_type": [ | ||
"application/json" | ||
] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_security/api_key/{id}", | ||
"methods": [ | ||
"PUT" | ||
], | ||
"parts": { | ||
"id": { | ||
"type": "string", | ||
"description": "The ID of the API key to update" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"body": { | ||
"description": "The API key request to update attributes of an API key.", | ||
"required": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Need to write the docs still 😅
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.
Merging the REST spec without a doc page will cause downstream doc build to fail. We should add stub docs with this PR. An example is #76670
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.
Thanks for the pointer! Will do.