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

refactor: moving consul access and role interface #4193

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

ItsRico
Copy link
Contributor

@ItsRico ItsRico commented Oct 12, 2022

Moving configureConsulAccess and createRole to go-mod-secrets to consolidate consul API.

Closes: #3227

Signed-off-by: Rico Chavez-Lopez rchavezlopez@ucdavis.edu

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • [ x] I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • [x ] I am not introducing a new dependency (add notes below if you are)
  • [x ] I have added unit tests for the new feature or bug fix (if not, why?)
  • [ x] I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

https://github.com/ItsRico/edgex-go/tree/3227-testing
To test these changes,

  1. Checkout this branch
  2. Checkout refactor: moving consul access and role interface go-mod-secrets#163 in a subfolder of this branch
  3. The following two steps can be viewed here: https://github.com/ItsRico/edgex-go/compare/main...ItsRico:edgex-go:3227-testing?expand=1
  4. Update your go.mod file using the replace directive. ( => ./go-mod-secrets)
  5. Update your Makefile to copy go-mod-secrets (add a COPY to the inline Dockerfile)
    In edgex-go, run
  6. make test
  7. make clean
  8. make clean_docker_base
  9. make docker_base
  10. make dev
  11. Then, in your edgex-compose/compose-builder/ folder,
  12. make run dev

The unit tests for these changes can be found in aclroles_test.go and in go-mod-secrets's management_test.go.

Copy link
Contributor

@jim-wang-intel jim-wang-intel left a comment

Choose a reason for hiding this comment

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

still some questions and should refactor more.

go.sum Outdated Show resolved Hide resolved
internal/security/bootstrapper/command/setupacl/command.go Outdated Show resolved Hide resolved
@ItsRico ItsRico force-pushed the edgexgo-3227 branch 3 times, most recently from cdf811a to 7bb1638 Compare October 18, 2022 08:57
@ItsRico
Copy link
Contributor Author

ItsRico commented Oct 18, 2022

  • removed aclroles_test.go

Still need to add helper function for client creation and remove from loop

@ItsRico
Copy link
Contributor Author

ItsRico commented Oct 19, 2022

  • Updated reference to NewRegistryRole to NewConsulRole, reflecting corresponding changes in go-mod-secrets
  • Moved client creation outside of for loop for CreateRole
  • Reran Testing Instructions

image

lenny-goodell
lenny-goodell previously approved these changes Oct 19, 2022
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
Copy link
Member

@ItsRico , you will need to rebase and resolve the conflicts in internal/security/bootstrapper/command/setupacl/aclpolicies.go

@ItsRico
Copy link
Contributor Author

ItsRico commented Oct 19, 2022

Had an issue with the rebase, need to try again

jim-wang-intel
jim-wang-intel previously approved these changes Oct 19, 2022
Copy link
Contributor

@jim-wang-intel jim-wang-intel left a comment

Choose a reason for hiding this comment

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

LGTM

Moving configureConsulAccess and createRole to go-mod-secrets to
consolidate consul API.

Closes: edgexfoundry#3227

Signed-off-by: Rico Chavez-Lopez <rchavezlopez@ucdavis.edu>
@sonarcloud
Copy link

sonarcloud bot commented Oct 19, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

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

@bnevis-i bnevis-i merged commit 5b680ce into edgexfoundry:main Oct 19, 2022
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.

Refactor security-bootstrapper Vault's Consul Secret Engine APIs using go-mod-secret (yet to be created)
4 participants