Documentation
¶
Index ¶
- Constants
- func ValidateBucketPath(path string) error
- func ValidateOffsiteConfig(config *OffsiteSettingsJSON) error
- type OffsiteLog
- type OffsiteSettings
- type OffsiteSettingsJSON
- type OffsiteStore
- func (s *OffsiteStore) AddLog(log *OffsiteLog) error
- func (s *OffsiteStore) Create(settings *OffsiteSettings) error
- func (s *OffsiteStore) GetActive() (*OffsiteSettings, error)
- func (s *OffsiteStore) GetByID(id int64) (*OffsiteSettings, error)
- func (s *OffsiteStore) GetLogs(limit int) ([]OffsiteLog, error)
- func (s *OffsiteStore) GetPreviousSecretKey() (string, error)
- func (s *OffsiteStore) ListAllSecrets() ([]SecretRow, error)
- func (s *OffsiteStore) Remove() error
- func (s *OffsiteStore) UpdateSecretAccessKey(id int64, encryptedSecret string) error
- type OffsiteType
- type SecretRow
Constants ¶
View Source
const (
EventUpload = "upload"
)
View Source
const PlaceholderSecretKey = "%SAME-AS-BEFORE%" // #nosec G101 - not a hardcoded credential, just a placeholder
Variables ¶
This section is empty.
Functions ¶
func ValidateBucketPath ¶
ValidateBucketPath validates the S3 bucket path format
func ValidateOffsiteConfig ¶
func ValidateOffsiteConfig(config *OffsiteSettingsJSON) error
ValidateOffsiteConfig validates the offsite configuration
Types ¶
type OffsiteLog ¶
type OffsiteLog struct {
ID int64 `db:"id" json:"id"`
Event string `db:"event" json:"event"`
OffsiteSettingsID int64 `db:"offsite_settings_id" json:"offsiteSettingsId"`
Object string `db:"object" json:"object"`
Success bool `db:"success" json:"success"`
ErrorDetails *string `db:"error_details" json:"errorDetails,omitempty"`
CreatedAt rfc3339time.Time `db:"created_at" json:"createdAt"`
}
type OffsiteSettings ¶
type OffsiteSettings struct {
ID int64 `db:"id" json:"id"`
Active bool `db:"active" json:"active"`
Type OffsiteType `db:"type" json:"type"`
Bucket string `db:"bucket" json:"bucket"`
Endpoint *string `db:"endpoint" json:"endpoint,omitempty"`
Region *string `db:"region" json:"region,omitempty"`
AccessKeyID string `db:"access_key_id" json:"accessKeyId"`
SecretAccessKey string `db:"secret_access_key" json:"-"`
BucketPath *string `db:"bucket_path" json:"bucketPath,omitempty"`
EC2IAMRole bool `db:"ec2_iam_role" json:"ec2IamRole"`
CreatedAt rfc3339time.Time `db:"created_at" json:"createdAt"`
UpdatedAt rfc3339time.Time `db:"updated_at" json:"updatedAt"`
}
type OffsiteSettingsJSON ¶
type OffsiteSettingsJSON struct {
Type OffsiteType `json:"type"`
Bucket string `json:"bucket"`
Endpoint *string `json:"endpoint,omitempty"`
Region *string `json:"region,omitempty"`
AccessKeyID string `json:"accessKeyId"`
SecretAccessKey string `json:"secretAccessKey"`
BucketPath *string `json:"bucketPath,omitempty"`
EC2IAMRole bool `json:"ec2IamRole"`
}
type OffsiteStore ¶
type OffsiteStore struct {
// contains filtered or unexported fields
}
func NewOffsiteStore ¶
func NewOffsiteStore(db *sqlx.DB) *OffsiteStore
func (*OffsiteStore) AddLog ¶
func (s *OffsiteStore) AddLog(log *OffsiteLog) error
func (*OffsiteStore) Create ¶
func (s *OffsiteStore) Create(settings *OffsiteSettings) error
func (*OffsiteStore) GetActive ¶
func (s *OffsiteStore) GetActive() (*OffsiteSettings, error)
func (*OffsiteStore) GetByID ¶
func (s *OffsiteStore) GetByID(id int64) (*OffsiteSettings, error)
func (*OffsiteStore) GetLogs ¶
func (s *OffsiteStore) GetLogs(limit int) ([]OffsiteLog, error)
func (*OffsiteStore) GetPreviousSecretKey ¶
func (s *OffsiteStore) GetPreviousSecretKey() (string, error)
func (*OffsiteStore) ListAllSecrets ¶
func (s *OffsiteStore) ListAllSecrets() ([]SecretRow, error)
ListAllSecrets returns the stored secret of every offsite settings row (active or not — inactive rows back the '%SAME-AS-BEFORE%' apply flow).
func (*OffsiteStore) Remove ¶
func (s *OffsiteStore) Remove() error
func (*OffsiteStore) UpdateSecretAccessKey ¶
func (s *OffsiteStore) UpdateSecretAccessKey(id int64, encryptedSecret string) error
UpdateSecretAccessKey replaces the stored secret of one settings row.
Click to show internal directories.
Click to hide internal directories.