-
Notifications
You must be signed in to change notification settings - Fork 125
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
feat: SecretProvider for storing/retrieving secrets #707
Conversation
9d682a4
to
50a8ddc
Compare
50a8ddc
to
5ab4d46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
592832d
to
d287bb3
Compare
Add the ability to create SecretProvider and properly initilize it when in secure mode, Use of SecretProvied will be added in future PRs. close #653 Signed-off-by: lenny <[email protected]>
d287bb3
to
bcd0eef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks pretty good, although I had some questions about what appear to be some unrelated changes.
Also I wasn't sure how to test this PR. Could you provide some basic instructions on how to do so?
internal/common/config.go
Outdated
@@ -26,6 +26,8 @@ type ConfigurationStruct struct { | |||
DeviceList []DeviceConfig `consul:"-"` | |||
// Driver is a string map contains customized configuration for the protocol driver implemented based on Device SDK | |||
Driver map[string]string | |||
// SecretStore contain information for connecting to the secure SecretStore (Vault) to retrieve or store secrets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp: contain --> contains
Signed-off-by: lenny <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #707 +/- ##
==========================================
- Coverage 45.37% 45.31% -0.06%
==========================================
Files 32 32
Lines 3121 3125 +4
==========================================
Hits 1416 1416
- Misses 1592 1596 +4
Partials 113 113
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@cloudxxx8 why did you merge this? Per my last review I still had some testing to do and hadn't yet approved this. |
@lenny-intel I re-tested today using the edgexfoundry snap. I added the following override to security-secretstore-setup (which in turn execs security-file-token-provider):
...and the token is generated for device-simple once I bring everything up. I then manually copied the file from the Note, when I tried testing by adding |
sorry, @tonyespy , I should have read through your comments thoroughly. I merged this PR because I saw you put comments not "change request" and Lenny had resolved all the comments. Also, I would like to unblock other two PRs early. |
PR Checklist
Please check if your PR fulfills the following requirements:
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/device-sdk-c/blob/master/.github/CONTRIBUTING.md
What is the current behavior?
Issue Number: #653
What is the new behavior?
Added creation and initialization SecretProvider during bootstrap for both secure and non-secure modes
Added InsecureSecrets and SecretStore config to device-simple as samples and used to test initializing SecretProvider in secure mode.
APIs to take advantage of the SecretProvider are TBD in future PRs
Does this PR introduce a breaking change?
New Imports
Specific Instructions
This PR is about just about creating and initializing the Secret Provider. Using it come in following PR.
Do the following to test this PR:
ADD_SECRETSTORE_TOKENS: "device-simple"
toenvironment
section forvault-worker
make run
Run Device Simple in secure mode
example/cmd/device-simple/
Run Device Simple in non-secure mode
Other information