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

refacotr!: TechDebt for refactor GenerateConsulToken API #105

Conversation

jim-wang-intel
Copy link
Contributor

@jim-wang-intel jim-wang-intel commented Apr 15, 2021

A breaking interface change for go-mod-bootstrap:

  • Modify the interface GenerateConsultoken API to just take serviceKey as the input for the API as to the authToken is unnecessary
    now and the authToken is directly from config.
  • Also remove its interface from SecretstoreClient as it is no longer used there.
  • Also move the implementation code of GenerateConsulToken into secrets.go instead of management.go

Fixes: #104

Signed-off-by: Jim Wang [email protected]

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • [x ] Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Current GenerateConsulToken API has an unused input argument token and thus call for removal.

Issue Number: #104

What is the new behavior?

GenerateConsulToken API has changed and now only takes serviceKey as an input.

Does this PR introduce a breaking change?

  • [x ] Yes
  • No

go-mod-bootstrap the calling side will be affected by this change and thus need to be changed.
Will be addressed in this go-mod-bootstrap PR: edgexfoundry/go-mod-bootstrap#212

Are there any new imports or modules? If so, what are they used for and why?

Are there any specific instructions or things that should be known prior to reviewing?

Other information

A breaking interface change for go-mod-bootstrap:
- Modify the interface GenerateConsultoken API to just take serviceKey as the input for the API as to the authToken is unnecessary
now and the authToken is directly from config.
- Also remove its interface from SecretstoreClient as it is no longer used there.
- Also move the implementation code of GenerateConsulToken into secrets.go instead of management.go

Fixes: #104

Signed-off-by: Jim Wang <[email protected]>
@jim-wang-intel jim-wang-intel added tech-debt issue_type denoting refactoring to improve design or removal of temporary workarounds ireland labels Apr 15, 2021
@jim-wang-intel jim-wang-intel added this to the Ireland milestone Apr 15, 2021
@jim-wang-intel jim-wang-intel self-assigned this Apr 15, 2021
Copy link
Collaborator

@bnevis-i bnevis-i left a comment

Choose a reason for hiding this comment

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

Looks pretty straightforward. Agree that we didn't need to pass the Vault token when it was already part of the instance data.

Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

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

LGTM

@lenny-goodell lenny-goodell merged commit 5f5b5b9 into edgexfoundry:master Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ireland tech-debt issue_type denoting refactoring to improve design or removal of temporary workarounds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Secure Consul Ph. 2] Refactor go-mod-secret's GenerateConsulToken interface
3 participants