Repository navigation
src: vault driver logs in by AppRole and Kubernetes - #65
Merged
Merged
Conversation
… token is requested again before its lease expires Signed-off-by: Dmitriy Aleksandrov <goodmobiledevices@gmail.com>
Signed-off-by: Dmitriy Aleksandrov <goodmobiledevices@gmail.com>
Signed-off-by: Dmitriy Aleksandrov <goodmobiledevices@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 32 32
Lines 2693 2755 +62
=========================================
+ Hits 2693 2755 +62 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Benchmark diff:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The vault driver gets the token itself, without Vault Agent:
WithAppRole(roleID, secretID)— AppRole auth method;WithKubernetes(role, tokenFile)— Kubernetes auth method with the token of the service account,/var/run/secrets/kubernetes.io/serviceaccount/tokenby default; the file is read before every login, so the rotated token is used;WithAuthMount(mount)— another mount of the auth method,approleandkubernetesby default.The driver logs in at the first request and keeps the token, the new token is requested after 2/3 of its lease, and once more when Vault denies the request, because the token can be revoked before its lease expires. Wrong credentials wrap
tinyconf.ErrAccessDenied. A login method has priority overWithToken,WithTokenFileandVAULT_TOKEN. No new dependencies: the login is one request of the HTTP API.The e2e test logs in by AppRole to Vault 1.18. Documentation: the vault driver page, the use case with secrets, Known limitations of Why tinyconf, README, the skill.