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

Support clear api key cache #5147

Merged
merged 3 commits into from
Dec 7, 2020
Merged

Support clear api key cache #5147

merged 3 commits into from
Dec 7, 2020

Conversation

stevejgordon
Copy link
Contributor

I updated UrlPart to support the use of the Ids type which seemed appropriate.

One query for review... The docs for this API suggest that the ids in the path can be empty to clear cache for all keys. The generated code requires the presence of an ID part and I'm not sure if this is okay or how best to address it?

Contributes to #5096

Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

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

We need to send an PR to elastic/elasticsearch to update the source spec

https://github.com/elastic/elasticsearch/blob/7.x/x-pack/plugin/src/test/resources/rest-api-spec/api/security.clear_api_key_cache.json#L9

To include the path with no ids.

We can use a patch file in our codebase to unblock us on this PR.

@Mpdreamz
Copy link
Member

Mpdreamz commented Dec 4, 2020

One query for review... The docs for this API suggest that the ids in the path can be empty to clear cache for all keys. The generated code requires the presence of an ID part and I'm not sure if this is okay or how best to address it?

Excellent catch @stevejgordon 🔍 👍

@stevejgordon
Copy link
Contributor Author

@Mpdreamz I think I've patched this correctly and now per the updated tests, we can support optional IDs.

@stevejgordon stevejgordon requested a review from Mpdreamz December 4, 2020 13:52
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

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

LGTM, don't forget to send an upstream PR for this :)

@stevejgordon stevejgordon merged commit e607d31 into 7.10 Dec 7, 2020
@stevejgordon stevejgordon deleted the feature/clear-api-key-cache branch December 7, 2020 12:21
github-actions bot pushed a commit that referenced this pull request Dec 7, 2020
* Support clear API key cache
* Patched to support optional ids
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2020

The backport to master failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-master master
# Navigate to the new working tree
cd .worktrees/backport-master
# Create a new branch
git switch --create backport-5147-to-master
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick ---mainline 1 e607d3126d05ec862c4d2a9de37bfcaecc05a249
# Push it to GitHub
git push --set-upstream origin backport-5147-to-master
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-master

Then, create a pull request where the base branch is master and the compare/head branch is backport-5147-to-master.

stevejgordon added a commit that referenced this pull request Dec 7, 2020
* Support clear API key cache
* Patched to support optional ids
stevejgordon added a commit that referenced this pull request Dec 8, 2020
* Support clear API key cache
* Patched to support optional ids

Co-authored-by: Steve Gordon <[email protected]>
stevejgordon added a commit that referenced this pull request Dec 8, 2020
* Support clear API key cache (#5147)
* Support clear API key cache
* Patched to support optional ids
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants