mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-01 12:10:05 +08:00
🐛 fix(security): 新增密钥存储状态枚举
This commit is contained in:
@@ -7,6 +7,17 @@ import (
|
||||
"github.com/99designs/keyring"
|
||||
)
|
||||
|
||||
func TestStoreStatusValuesRemainStable(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if StatusAvailable != "available" {
|
||||
t.Fatalf("expected StatusAvailable to remain stable, got %q", StatusAvailable)
|
||||
}
|
||||
if StatusUnavailable != "unavailable" {
|
||||
t.Fatalf("expected StatusUnavailable to remain stable, got %q", StatusUnavailable)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildRefRejectsEmptyKind(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -18,6 +18,13 @@ type SecretStore interface {
|
||||
HealthCheck() error
|
||||
}
|
||||
|
||||
type StoreStatus string
|
||||
|
||||
const (
|
||||
StatusAvailable StoreStatus = "available"
|
||||
StatusUnavailable StoreStatus = "unavailable"
|
||||
)
|
||||
|
||||
type UnavailableError struct {
|
||||
Reason string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user