Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MaxSecretSize is the maximum allowed size for a secret (64 KB). MaxSecretSize = 64 * 1024 // MaxRequestBodySize is the maximum allowed request body size. // Set slightly larger than MaxSecretSize to account for JSON overhead. MaxRequestBodySize = MaxSecretSize + 1024 // MaxReadAttempts is the maximum number of incorrect passcode attempts // before a secret is automatically deleted. MaxReadAttempts = 3 // DefaultExpiry is the default TTL for secrets when no expiry is specified. DefaultExpiry = 24 * time.Hour )
Variables ¶
View Source
var ExpiryOptions = []string{"1h", "6h", "1d", "3d"}
ExpiryOptions defines the valid expiry duration strings.
Functions ¶
This section is empty.
Types ¶
type SecretRepository ¶
type SecretRepository interface {
StoreSecret(ctx context.Context, id string, secret []byte, ttl time.Duration) error
GetSecret(ctx context.Context, id string) ([]byte, error)
DelIfMatch(ctx context.Context, id string, old []byte) error
IncrFailAndMaybeDelete(ctx context.Context, id string) (int64, error)
DeleteAttempts(ctx context.Context, id string) error
Ping(ctx context.Context) error
}
func NewRedisRepository ¶
func NewRedisRepository(rdb *redis.Client) SecretRepository
Click to show internal directories.
Click to hide internal directories.