-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* 🚧 build(VSecM): parallelize building images * minor * minor * move vendor * removed proto generation from bundle.sh * even faster * typo * code cleanup --------- Signed-off-by: Volkan Özçelik <[email protected]>
- Loading branch information
Showing
26 changed files
with
215 additions
and
193 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,56 @@ | ||
package collection | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
"strings" | ||
|
||
"github.com/vmware-tanzu/secrets-manager/app/safe/internal/state/io" | ||
"github.com/vmware-tanzu/secrets-manager/app/safe/internal/state/stats" | ||
f "github.com/vmware-tanzu/secrets-manager/core/constants/file" | ||
"github.com/vmware-tanzu/secrets-manager/core/env" | ||
log "github.com/vmware-tanzu/secrets-manager/core/log/std" | ||
) | ||
|
||
func populateSecretsFromFileStore(cid string) error { | ||
root := env.DataPathForSafe() | ||
files, err := os.ReadDir(root) | ||
if err != nil { | ||
return errors.Join( | ||
err, | ||
errors.New("populateSecrets: problem reading secrets directory"), | ||
) | ||
} | ||
|
||
for _, file := range files { | ||
if file.IsDir() { | ||
continue | ||
} | ||
|
||
fn := file.Name() | ||
if strings.HasSuffix(fn, f.AgeBackupExtension) { | ||
continue | ||
} | ||
|
||
key := strings.Replace(fn, f.AgeExtension, "", 1) | ||
|
||
_, exists := Secrets.Load(key) | ||
if exists { | ||
continue | ||
} | ||
|
||
secretOnDisk, err := io.ReadFromDisk(key) | ||
if err != nil { | ||
log.ErrorLn(&cid, | ||
"populateSecrets: problem reading secret from disk:", | ||
err.Error()) | ||
continue | ||
} | ||
if secretOnDisk != nil { | ||
stats.CurrentState.Increment(key, Secrets.Load) | ||
Secrets.Store(key, *secretOnDisk) | ||
} | ||
} | ||
|
||
return nil | ||
} |
This file contains 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 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 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 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 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 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 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 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 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 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,27 @@ | ||
/* | ||
| Protect your secrets, protect your sensitive data. | ||
: Explore VMware Secrets Manager docs at https://vsecm.com/ | ||
</ | ||
<>/ keep your secrets… secret | ||
>/ | ||
<>/' Copyright 2023–present VMware Secrets Manager contributors. | ||
>/' SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
package sentinel | ||
|
||
// SecretRequest encapsulates a VSecM Safe REST command payload. | ||
type SecretRequest struct { | ||
Workloads []string `json:"workload"` | ||
Secret string `json:"secret"` | ||
Namespaces []string `json:"namespaces,omitempty"` | ||
Encrypt bool `json:"encrypt,omitempty"` | ||
Delete bool `json:"delete,omitempty"` | ||
Append bool `json:"append,omitempty"` | ||
List bool `json:"list,omitempty"` | ||
Template string `json:"template,omitempty"` | ||
Format string `json:"format,omitempty"` | ||
SerializedRootKeys string `json:"root-keys,omitempty"` | ||
NotBefore string `json:"nbf,omitempty"` | ||
Expires string `json:"exp,omitempty"` | ||
} |
Oops, something went wrong.