models

package
v0.0.0-...-6371a9c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLog

type AccessLog struct {
	ID         int64     `json:"id"`
	SecretID   int64     `json:"secret_id"`
	UserID     int64     `json:"user_id"`
	AccessedAt time.Time `json:"accessed_at"`
	Source     string    `json:"source"`
	Username   string    `pg:"-" json:"username"`
}

type AppRole

type AppRole struct {
	ID          int64     `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	RoleID      string    `json:"role_id"`
	SecretID    string    `json:"secret_id"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type AppRoleRule

type AppRoleRule struct {
	Name            string                 `hcl:"name,label"`
	Capabilities    []string               `hcl:"capabilities"`
	AllowParameters map[string]interface{} `hcl:"allowed_parameters,optional"`
}

type AppRolesPolicy

type AppRolesPolicy struct {
	ID           int64    `json:"id"`
	AppRoleID    int64    `json:"app_role_id"`
	PolicyID     int64    `json:"policy_id"`
	Capabilities []string `json:"capabilities"`
}

type ApprovalRequest

type ApprovalRequest struct {
	ID        int64                  `json:"id"`
	UserID    int64                  `json:"user_id"`
	SecretID  *int64                 `json:"secret_id,omitempty"`
	Action    string                 `json:"action"`
	Status    string                 `json:"status"`
	Details   map[string]interface{} `json:"details"`
	CreatedAt time.Time              `json:"created_at"`
	UpdatedAt time.Time              `json:"updated_at"`
}

type AuditLog

type AuditLog struct {
	ID        int64                  `json:"id"`
	Username  string                 `json:"username"`
	Action    string                 `json:"action"`
	SecretID  *int64                 `json:"secret_id,omitempty"`
	Details   map[string]interface{} `json:"details"`
	Timestamp time.Time              `json:"timestamp"`
}

type Claims

type Claims struct {
	AuthType string `json:"auth_type"`
	Username string `json:"username"`
	UserID   int64  `json:"user_id"`
	jwt.StandardClaims
}

type Config

type Config struct {
	Server struct {
		Host string
		Port int
	}
	Database struct {
		Host     string
		Port     int
		User     string
		Password string
		Name     string
		SSLMode  string
	}
	Security struct {
		MasterKey string `mapstructure:"master_key"`
	}

	Sync struct {
		Platform string
		Vault    struct {
			Address string
			Token   string
		}
		AWS struct {
			Region          string
			AccessKeyID     string
			SecretAccessKey string
		}
		Azure struct {
			TenantID     string
			ClientID     string
			ClientSecret string
			KeyVaultName string
		}
	}
}

type Group

type Group struct {
	ID        int64     `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
}

type GroupPolicy

type GroupPolicy struct {
	ID           int64    `json:"id"`
	GroupID      int64    `json:"group_id"`
	PolicyID     int64    `json:"policy_id"`
	Capabilities []string `json:"capabilities"`
}

type GroupRule

type GroupRule struct {
	Name            string                 `hcl:"name,label"`
	Capabilities    []string               `hcl:"capabilities"`
	AllowParameters map[string]interface{} `hcl:"allowed_parameters,optional"`
}

type Notification

type Notification struct {
	ID        int64     `json:"id"`
	SecretID  int64     `json:"secret_id"`
	Message   string    `json:"message"`
	CreatedAt time.Time `json:"created_at"`
}

type Path

type Path struct {
	ID         int                    `json:"id"`
	Path       string                 `json:"path"`
	EngineType string                 `json:"engine_type"`
	Metadata   map[string]interface{} `json:"metadata"`
	CreatedBy  int64                  `json:"created_by"`

	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type PathPermission

type PathPermission struct {
	ID              int64     `json:"id" pg:",pk"`
	GroupID         int64     `json:"group_id"`
	PathID          int64     `json:"path_id" pg:"fk:path_id"`
	PermissionLevel string    `json:"permission_level"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

type PathRule

type PathRule struct {
	Path            string                 `hcl:"path,label"`
	Capabilities    []string               `hcl:"capabilities"`
	AllowParameters map[string]interface{} `hcl:"allowed_parameters,optional"`
}

type Policy

type Policy struct {
	ID          int64         `json:"id"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	HCL         string        `json:"hcl"` // Store HCL string
	PathID      int64         `json:"path_id"`
	Paths       []PathRule    `hcl:"path,block"`
	Groups      []GroupRule   `hcl:"group,block"`
	Users       []UserRule    `hcl:"user,block"`
	AppRoles    []AppRoleRule `hcl:"approle,block"`
	CreatedAt   time.Time     `json:"created_at"`
	UpdatedAt   time.Time     `json:"updated_at"`
}

type RootCA

type RootCA struct {
	ID        int64     `json:"id"`
	RootCert  []byte    `json:"root_cert"`
	RootKey   []byte    `json:"root_key"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Secret

type Secret struct {
	ID     int64 `json:"id"`
	PathID int   `json:"path_id" pg:"fk:path_id"`

	Key            string                 `json:"key"`
	Version        int                    `json:"version"`
	EncryptedDEK   []byte                 `json:"encrypted_dek"`
	EncryptedValue []byte                 `json:"encrypted_value"`
	Metadata       map[string]interface{} `json:"metadata"`
	IsMultiValue   bool                   `json:"is_multi_value"`

	Tags []string `json:"tags"`

	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	IsOneTime        bool       `json:"is_one_time"`
	ExpiresAt        *time.Time `json:"expires_at,omitempty"`
	RotatedAt        *time.Time `json:"rotated_at,omitempty"`
	RotationInterval string     `json:"rotation_interval,omitempty"`
	LastRotatedAt    *time.Time `json:"last_rotated_at,omitempty"`
	CreatedBy        int64      `json:"created_by"`

	Value string `pg:"-" json:"value"`

	Path          string `pg:"-" json:"path"`
	KeyType       string `pg:"-" json:"key_type"`
	CreatedByUser string `pg:"-" json:"created_by_user,omitempty"`
}

type SecretAccess

type SecretAccess struct {
	ID          int64  `json:"id"`
	SecretID    int64  `json:"secret_id" pg:"fk:secret_id"`
	UserID      *int64 `json:"user_id,omitempty"`
	GroupID     *int64 `json:"group_id,omitempty"`
	AccessLevel string `json:"access_level"`
	// contains filtered or unexported fields
}

type SecretDeletion

type SecretDeletion struct {
	ID             int64                  `json:"id"`
	SecretID       int64                  `json:"secret_id" pg:"fk:secret_id"`
	PathID         int                    `json:"path_id" pg:"fk:path_id"`
	Key            string                 `json:"key"`
	Version        int                    `json:"version"`
	EncryptedDEK   []byte                 `json:"encrypted_dek"`   // Encrypted Data Encryption Key
	EncryptedValue []byte                 `json:"encrypted_value"` // Encrypted Secret Value
	Metadata       map[string]interface{} `json:"metadata"`
	DeletedAt      time.Time              `json:"deleted_at"`
	Accesses       []SecretAccess         `json:"accesses"`
}
type SharedLink struct {
	ID        int64     `json:"id"`
	LinkID    string    `json:"link_id"`
	SecretID  int64     `json:"secret_id" pg:"fk:secret_id"`
	ExpiresAt time.Time `json:"expires_at"`
}

Struct for shared link

type SubCA

type SubCA struct {
	ID        int64     `json:"id"`
	PathID    int64     `json:"path_id"`
	SubCACert []byte    `json:"sub_ca_cert"`
	SubCAKey  []byte    `json:"sub_ca_key"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type TransitKeyVersion

type TransitKeyVersion struct {
	ID            int       `json:"id"`
	KeyID         int       `json:"key_id"`
	Version       int       `json:"version"`
	KeyData       []byte    `json:"key_data"`
	KeyType       string    `json:"key_type"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	KeyDataString string    `json:"key_data_string"`
}

type User

type User struct {
	ID        int64     `json:"id"`
	Username  string    `json:"username"`
	Password  string    `json:"password"`
	CreatedAt time.Time `json:"created_at"`
}

type UserGroup

type UserGroup struct {
	UserID  int64 `json:"user_id"`
	GroupID int64 `json:"group_id"`
}

type UserPolicy

type UserPolicy struct {
	ID           int64    `json:"id"`
	UserID       int64    `json:"user_id"`
	PolicyID     int64    `json:"policy_id"`
	Capabilities []string `json:"capabilities"`
}

type UserRule

type UserRule struct {
	Name            string                 `hcl:"name,label"`
	Capabilities    []string               `hcl:"capabilities"`
	AllowParameters map[string]interface{} `hcl:"allowed_parameters,optional"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL