Migrate Security and EncryptedSavedObjects test plugins to the Kibana Platform#61614
Merged
azasypkin merged 5 commits intoelastic:masterfrom Mar 30, 2020
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-security (Team:Security) |
2802b2d to
a32e93d
Compare
azasypkin
commented
Mar 27, 2020
| core.http.createRouter().get( | ||
| { | ||
| path: '/api/saved_objects/get-decrypted-as-internal-user/{id}', | ||
| validate: { params: value => ({ value }) }, |
Contributor
Author
There was a problem hiding this comment.
note: custom ^validation^ to unblock this PR as it's not important for the test plugins anyway (it seems we're hitting the bug #61652).
jportner
approved these changes
Mar 30, 2020
Comment on lines
56
to
63
| const namespace = deps.spaces.spacesService.getSpaceId(request); | ||
|
|
||
| try { | ||
| return response.ok({ | ||
| body: await encryptedSavedObjects.getDecryptedAsInternalUser( | ||
| SAVED_OBJECT_WITH_SECRET_TYPE, | ||
| request.params.id, | ||
| { namespace: namespace === 'default' ? undefined : namespace } |
Contributor
There was a problem hiding this comment.
Nit
Suggested change
| const namespace = deps.spaces.spacesService.getSpaceId(request); | |
| try { | |
| return response.ok({ | |
| body: await encryptedSavedObjects.getDecryptedAsInternalUser( | |
| SAVED_OBJECT_WITH_SECRET_TYPE, | |
| request.params.id, | |
| { namespace: namespace === 'default' ? undefined : namespace } | |
| const spaceId = deps.spaces.spacesService.getSpaceId(request); | |
| const namespace = deps.spaces.spacesService.spaceIdToNamespace(spaceId); | |
| try { | |
| return response.ok({ | |
| body: await encryptedSavedObjects.getDecryptedAsInternalUser( | |
| SAVED_OBJECT_WITH_SECRET_TYPE, | |
| request.params.id, | |
| { namespace } |
Contributor
Author
There was a problem hiding this comment.
Ah, awesome, didn't new about spaceIdToNamespace, thanks!
Contributor
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Contributor
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR migrates two test plugins we have to the Kibana Platform. I also finally moved ESO API integration tests to a dedicated directory in a preparation to upcoming ESO enhancements.
Note to reviewers: it's a bit easier to review commit by commit (plain move -> changes).