-
Notifications
You must be signed in to change notification settings - Fork 12
feat: fleet secrets manager #263
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a793f26
adds fleet secrets manager
jajeffries 08f7806
correctly handle secret resolution
jajeffries 5169206
linting
jajeffries d05a2c7
improve context management
jajeffries 67e066f
PR feedback
jajeffries 38d6691
adds message dispatch channel to ensure sequential handling of messag…
jajeffries 89d2065
Apply suggestions from code review
jajeffries 63318af
fix disconnect race condition
jajeffries 785e842
linting
jajeffries File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| package messages | ||
|
|
||
| import ( | ||
| "time" | ||
| ) | ||
|
|
||
| // CurrentSecretsSchemaVersion defines the current version of the secrets schema | ||
| const CurrentSecretsSchemaVersion = "1.0" | ||
|
|
||
| // Error codes for secret operations | ||
| const ( | ||
| ErrorCodeNotFound = "NOT_FOUND" | ||
| ErrorCodeForbidden = "FORBIDDEN" | ||
| ErrorCodeInvalidPath = "INVALID_PATH" | ||
| ErrorCodeTimeout = "TIMEOUT" | ||
| ErrorCodeInternalError = "INTERNAL_ERROR" | ||
| ErrorCodeRateLimited = "RATE_LIMITED" | ||
| ) | ||
|
|
||
| // SecretRequest represents a single secret request in a SecretRequestMsg | ||
| type SecretRequest struct { | ||
| Path string `json:"path"` // The path to the secret in the control plane's secret store | ||
| Context string `json:"context"` // The context where the secret is used (policy ID, "config", or "backend") | ||
| } | ||
|
|
||
| // SecretRequestMsg represents a request for secrets | ||
| type SecretRequestMsg struct { | ||
| SchemaVersion string `json:"schema_version"` | ||
| RequestID string `json:"request_id"` // UUID v4 | ||
| Timestamp time.Time `json:"timestamp"` | ||
| Secrets []SecretRequest `json:"secrets"` | ||
| } | ||
|
|
||
| // SecretValue represents a successfully retrieved secret | ||
| type SecretValue struct { | ||
| Path string `json:"path"` | ||
| Value string `json:"value"` | ||
| Version int `json:"version"` | ||
| Metadata map[string]string `json:"metadata,omitempty"` | ||
| } | ||
|
|
||
| // SecretError represents an error for a failed secret retrieval | ||
| type SecretError struct { | ||
| Path string `json:"path"` | ||
| Error string `json:"error"` // Human-readable error message | ||
| Code string `json:"code"` // Machine-readable error code | ||
| } | ||
|
|
||
| // SecretResponseMsg represents a response to a secret request | ||
| type SecretResponseMsg struct { | ||
| SchemaVersion string `json:"schema_version"` | ||
| RequestID string `json:"request_id"` // Matches the request_id from the original request | ||
| Timestamp time.Time `json:"timestamp"` | ||
| Status string `json:"status"` // "success", "partial", "error" | ||
| Secrets []SecretValue `json:"secrets,omitempty"` // Omitted if status is "error" | ||
| Errors []SecretError `json:"errors,omitempty"` // Omitted if status is "success" | ||
| } | ||
|
|
||
| // SecretUpdate represents a single secret update notification | ||
| type SecretUpdate struct { | ||
| Path string `json:"path"` | ||
| Version int `json:"version"` | ||
| Contexts []string `json:"contexts"` // List of contexts (policy IDs) that use this secret | ||
| } | ||
|
|
||
| // SecretUpdateNotificationMsg represents a push notification for updated secrets | ||
| type SecretUpdateNotificationMsg struct { | ||
| SchemaVersion string `json:"schema_version"` | ||
| Timestamp time.Time `json:"timestamp"` | ||
| Updates []SecretUpdate `json:"updates"` | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.