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

VAULT-19233 First part of caching static secrets work #23054

Merged
merged 7 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions command/agentproxyshared/cache/cacheboltdb/bolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ const (
// TokenType - Bucket/type for auto-auth tokens
TokenType = "token"

// StaticSecretType - Bucket/type for static secrets
StaticSecretType = "static-secret"

// LeaseType - v2 Bucket/type for auth AND secret leases.
//
// This bucket stores keys in the same order they were created using
Expand Down
6 changes: 6 additions & 0 deletions command/agentproxyshared/cache/cachememdb/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ type Index struct {
// Required: true, Unique: true
Token string

// Tokens is a list of tokens that can access this cached response,
// which is used for static secret caching, and enabling multiple
// tokens to be able to access the same cache entry for static secrets.
// Required: false, Unique: false
Tokens []string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated this to be a map[string]struct{} so that values had to be unique. Coming in the next PR.


// TokenParent is the parent token of the token held by this index
// Required: false, Unique: false
TokenParent string
Expand Down
1 change: 1 addition & 0 deletions command/agentproxyshared/cache/cachememdb/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestSerializeDeserialize(t *testing.T) {
testIndex := &Index{
ID: "testid",
Token: "testtoken",
Tokens: []string{"token1", "token2"},
TokenParent: "parent token",
TokenAccessor: "test accessor",
Namespace: "test namespace",
Expand Down
Loading