Documentation
¶
Index ¶
- type AuditLog
- type Secret
- type SecretListItem
- type Service
- func (s *Service) DeleteSecret(ctx context.Context, userID, key string) error
- func (s *Service) GetSecret(ctx context.Context, userID, key string) (*Secret, error)
- func (s *Service) ListSecrets(ctx context.Context, userID string) ([]*SecretListItem, error)
- func (s *Service) SetDB(db *gorm.DB)
- func (s *Service) SetMasterPassword(password string)
- func (s *Service) StoreSecret(ctx context.Context, userID string, secret *Secret) error
- func (s *Service) UpdateSecret(ctx context.Context, userID string, secret *Secret) error
- type StringSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLog ¶
type AuditLog struct {
ID uint `json:"id" gorm:"primaryKey"`
UserID string `json:"user_id" gorm:"index;not null"`
SecretKey string `json:"secret_key" gorm:"not null"`
Action string `json:"action" gorm:"not null"` // CREATE, READ, UPDATE, DELETE
IPAddress string `json:"ip_address"`
UserAgent string `json:"user_agent"`
CreatedAt time.Time `json:"created_at"`
}
AuditLog represents an audit log entry for secret operations
type Secret ¶
type Secret struct {
ID uint `json:"id" gorm:"primaryKey"`
UserID string `json:"user_id" gorm:"index;not null"`
Key string `json:"key" gorm:"not null"`
Value string `json:"value,omitempty" gorm:"not null"` // Encrypted
Description string `json:"description"`
Tags StringSlice `json:"tags" gorm:"type:text"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
Secret represents a stored secret
type SecretListItem ¶
type SecretListItem struct {
Key string `json:"key"`
Description string `json:"description"`
Tags StringSlice `json:"tags"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
SecretListItem represents a secret in list operations (without value)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides vault operations
func (*Service) DeleteSecret ¶
DeleteSecret deletes a secret
func (*Service) ListSecrets ¶
ListSecrets returns a list of all secrets (without values)
func (*Service) SetMasterPassword ¶
SetMasterPassword sets the master password for encryption
func (*Service) StoreSecret ¶
StoreSecret stores a new secret
type StringSlice ¶
type StringSlice []string
StringSlice is a custom type for handling string slices in GORM
func (*StringSlice) Scan ¶
func (s *StringSlice) Scan(value interface{}) error
Scan implements the Scanner interface for database deserialization
Click to show internal directories.
Click to hide internal directories.