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

add flag to allow /operator/keyring requests to only hit local servers #6279

Merged
merged 9 commits into from
Aug 12, 2019

Conversation

s-mang
Copy link
Contributor

@s-mang s-mang commented Aug 5, 2019

Add parameter local-only to operator keyring list requests to force queries to only hit local servers (no WAN traffic).

HTTP API: GET /operator/keyring?local-only=true
CLI: consul keyring -list --local-only

Sending the local-only flag with any non-GET/list request will result in an error.

@s-mang s-mang requested review from a team and mkeeler August 5, 2019 22:01
Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

This looks really good. I have a few requests regarding code style, test framework usage and some error handling but nothing major.

agent/consul/internal_endpoint.go Outdated Show resolved Hide resolved
agent/consul/internal_endpoint_test.go Show resolved Hide resolved
agent/operator_endpoint.go Outdated Show resolved Hide resolved
Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

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

I was wondering if we want to provide the same functionality on the cli command consul keyring -list as well.

@s-mang
Copy link
Contributor Author

s-mang commented Aug 6, 2019

@i0rek

I was wondering if we want to provide the same functionality on the cli command consul keyring -list as well.

I'll leave this to @mkeeler to answer! Happy to add it in.

Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

@i0rek brings up a good point. This PR should include changes for both the API module in api/operator_keyring.go and for the CLI command in command/keyring/keyring.go

@s-mang
Copy link
Contributor Author

s-mang commented Aug 7, 2019

@mkeeler @i0rek this is ready for another review
re: using BadRequestError types: I just changed all of the instances in the file (most of them in the same handler) now, instead of waiting for the follow-on PR
re: testing using require pkg: I've got one new test in there using require, and I will submit a follow-on PR with only fixes to touched tests to use require.

@s-mang s-mang changed the title add bool query param 'local-only' to GET /operator/keyring add flag to allow /operator/keyring requests to only hit local servers Aug 8, 2019
Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@s-mang s-mang merged commit 8ff1f48 into master Aug 12, 2019
@s-mang s-mang deleted the federated-dcs-localonly-keyring branch August 12, 2019 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants