config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArgon2Params = Argon2idParams{
	Time:        3,
	Memory:      64 * 1024,
	Parallelism: 1,
	KeyLength:   32,
}

Functions

func Load

func Load() error

Types

type AddEnvRequest

type AddEnvRequest struct {
	ProjectId uuid.UUID `json:"project_id"`
	UserId    uuid.UUID `json:"user_id"`

	EnvName           string `json:"env_name"`
	CipherText        []byte `json:"cipher_text"`
	Nonce             []byte `json:"nonce"`
	WrappedDEK        []byte `json:"wrapped_dek,omitempty"`
	DekNonce          []byte `json:"dek_nonce,omitempty"`
	EncryptionVersion int32  `json:"encryption_version"`

	Metadata Metadata `json:"metadata"`
}

type AddEnvResponse

type AddEnvResponse struct {
	Message string `json:"message"`
}

type AddUserToProjectRequest

type AddUserToProjectRequest struct {
	ProjectName        string    `json:"project_name"`
	AdminId            uuid.UUID `json:"admin_id"`
	UserId             uuid.UUID `json:"user_id"`
	WrappedPRK         []byte    `json:"wrapped_prk"`
	WrapNonce          []byte    `json:"wrap_nonce"`
	EphemeralPublicKey []byte    `json:"ephemeral_public_key"`
}

type AddUserToProjectResponse

type AddUserToProjectResponse struct {
	Message string `json:"message"`
}

type Argon2idParams

type Argon2idParams struct {
	Time        uint32 `json:"time"`
	Memory      uint32 `json:"memory"`
	Parallelism uint8  `json:"parallelism"`
	KeyLength   uint32 `json:"key_length"`
}

type CreateRequestBody

type CreateRequestBody struct {
	Email    string `json:"email"`
	Password string `json:"password"`

	PublicKey               []byte `json:"public_key"`
	EncryptedUserPrivateKey []byte `json:"encrypted_user_private_key"`
	PrivateKeySalt          []byte `json:"private_key_salt"`
	PrivateKeyNonce         []byte `json:"private_key_nonce"`
}

type CreateResponseBody

type CreateResponseBody struct {
	Message string      `json:"message"`
	User    UserBody    `json:"user"`
	Session SessionBody `json:"session"`
}

type EncryptedPrivateKey

type EncryptedPrivateKey struct {
	EncryptedUserPrivateKey []byte `json:"encrypted_user_private_key"`
	PrivateKeySalt          []byte `json:"private_key_salt"`
	PrivateKeyNonce         []byte `json:"private_key_nonce"`
}

type EnvResponse

type EnvResponse struct {
	CipherText        []byte   `json:"cipher_text"`
	Nonce             []byte   `json:"nonce"`
	WrappedDEK        []byte   `json:"wrapped_dek,omitempty"`
	DekNonce          []byte   `json:"dek_nonce,omitempty"`
	EncryptionVersion int32    `json:"encryption_version"`
	Version           int32    `json:"version"`
	Metadata          Metadata `json:"metadata"`
}

type GetEnvForCIRequest

type GetEnvForCIRequest struct {
	ProjectId uuid.UUID `json:"project_id"`
	EnvName   string    `json:"env_name"`
}

type GetEnvForCIResponse

type GetEnvForCIResponse struct {
	CipherText        []byte `json:"cipher_text"`
	Nonce             []byte `json:"nonce"`
	WrappedDEK        []byte `json:"wrapped_dek,omitempty"`
	DekNonce          []byte `json:"dek_nonce,omitempty"`
	EncryptionVersion int32  `json:"encryption_version"`
}

type GetEnvRequest

type GetEnvRequest struct {
	ProjectId uuid.UUID `json:"project_id"`
	Email     string    `json:"user_email"`

	EnvName string `json:"env_name"`
	Version *int32 `json:"version"`
}

type GetEnvResponse

type GetEnvResponse struct {
	CipherText        []byte `json:"cipher_text"`
	Nonce             []byte `json:"nonce"`
	WrappedDEK        []byte `json:"wrapped_dek,omitempty"`
	DekNonce          []byte `json:"dek_nonce,omitempty"`
	EncryptionVersion int32  `json:"encryption_version"`
}

type GetEnvVersionsRequest

type GetEnvVersionsRequest struct {
	ProjectId uuid.UUID `json:"project_id"`
	Email     string    `json:"user_email"`

	EnvName string `json:"env_name"`
}

type GetEnvVersionsResponse

type GetEnvVersionsResponse struct {
	EnvVersions []EnvResponse `json:"env_versions"`
}

type GetMemberProjectRequest

type GetMemberProjectRequest struct {
	ProjectName string    `json:"project_name"`
	UserId      uuid.UUID `json:"user_id"`
}

type GetMemberProjectResponse

type GetMemberProjectResponse struct {
	ProjectId          uuid.UUID `json:"project_id"`
	WrappedPRK         []byte    `json:"wrapped_prk"`
	WrapNonce          []byte    `json:"wrap_nonce"`
	EphemeralPublicKey []byte    `json:"ephemeral_public_key"`
}

type GetProjectByNameResponse

type GetProjectByNameResponse struct {
	ProjectID uuid.UUID `json:"project_id"`
}

type GetProjectByRepo

type GetProjectByRepo struct {
	RepoPrincipal string `json:"repo_principal"`
}

type GetUserProjectRequest

type GetUserProjectRequest struct {
	ProjectName string    `json:"project_name"`
	UserId      uuid.UUID `json:"user_id"`
}

type GetUserProjectResponse

type GetUserProjectResponse struct {
	ProjectId          uuid.UUID `json:"project_id"`
	WrappedPRK         []byte    `json:"wrapped_prk"`
	WrapNonce          []byte    `json:"wrap_nonce"`
	EphemeralPublicKey []byte    `json:"ephemeral_public_key"`
}

type GithubOIDCLoginRequest

type GithubOIDCLoginRequest struct {
	IDToken string `json:"id_token"`
}

GithubOIDCLoginRequest POST /oidc/github

type GithubOIDCLoginResponse

type GithubOIDCLoginResponse struct {
	SessionID uuid.UUID `json:"session_id"`
	ProjectID uuid.UUID `json:"project_id"`
}

type KeyPair

type KeyPair struct {
	PublicKey  []byte              `json:"public_key"`
	PrivateKey []byte              `json:"private_key"`
	EncKey     EncryptedPrivateKey `json:"encrypted_private_key"`
}

type ListProjectRequest

type ListProjectRequest struct {
	UserId uuid.UUID `json:"user_id"`
}

type ListProjectResponse

type ListProjectResponse struct {
	Projects []Project `json:"projects"`
}

type LoginRequestBody

type LoginRequestBody struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResponseBody

type LoginResponseBody struct {
	Message string      `json:"message"`
	User    UserBody    `json:"user"`
	Session SessionBody `json:"session"`
}

type LogoutRequestBody

type LogoutRequestBody struct {
	UserID uuid.UUID `json:"user_id"`
}

type LogoutResponseBody

type LogoutResponseBody struct {
	Message string `json:"message"`
}

type Metadata

type Metadata struct {
	Type string `json:"type"`
}

type Project

type Project struct {
	Id        uuid.UUID `json:"project_id"`
	Name      string    `json:"name"`
	Role      string    `json:"role"`
	IsRevoked bool      `json:"is_revoked"`
}

type ProjectCreateRequest

type ProjectCreateRequest struct {
	Name               string    `json:"name"`
	UserId             uuid.UUID `json:"user_id"`
	WrappedPRK         []byte    `json:"wrapped_prk"`
	WrapNonce          []byte    `json:"wrap_nonce"`
	EphemeralPublicKey []byte    `json:"ephemeral_public_key"`
}

type ProjectCreateResponse

type ProjectCreateResponse struct {
	Message string `json:"message"`
}

type ProjectDeleteRequest

type ProjectDeleteRequest struct {
	ProjectName string    `json:"project_name"`
	UserId      uuid.UUID `json:"user_id"`
}

type ProjectDeleteResponse

type ProjectDeleteResponse struct {
	Message string `json:"message"`
}

type RefreshRequestBody

type RefreshRequestBody struct {
	UserID uuid.UUID `json:"user_id"`
}

type RefreshResponseBody

type RefreshResponseBody struct {
	Message string      `json:"message"`
	Session SessionBody `json:"session"`
}

type ServiceRole

type ServiceRole struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`

	ServiceRolePublicKey []byte `json:"service_role_public_key"`
	RepoPrincipal        string `json:"repo_principal"`

	CreatedBy uuid.UUID `json:"created_by"`
	CreatedAt time.Time `json:"created_at"`
}

type ServiceRoleCreateRequest

type ServiceRoleCreateRequest struct {
	ServiceRoleName string `json:"service_role_name"`

	ServiceRolePublicKey []byte `json:"service_role_public_key"`

	RepoPrincipal string    `json:"repo_principal"`
	CreatedBy     uuid.UUID `json:"created_by"`
}

ServiceRoleCreateRequest POST /service_role/create

type ServiceRoleCreateResponse

type ServiceRoleCreateResponse struct {
	Message     string      `json:"message"`
	ServiceRole ServiceRole `json:"service_role"`
}

type ServiceRoleDelegateRequest

type ServiceRoleDelegateRequest struct {
	RepoPrincipal string `json:"repo_principal"`

	ProjectId uuid.UUID `json:"project_id"`
	EnvName   string    `json:"env_name"`

	WrappedPRK         []byte `json:"wrapped_prk"`
	WrapNonce          []byte `json:"wrap_nonce"`
	EphemeralPublicKey []byte `json:"ephemeral_public_key"`

	DelegatedBy uuid.UUID `json:"delegated_by"`
}

ServiceRoleDelegateRequest POST /service_role/delegate

type ServiceRoleDelegateResponse

type ServiceRoleDelegateResponse struct {
	Message string `json:"message"`
}

type ServiceRoleDeleteRequest

type ServiceRoleDeleteRequest struct {
	ServiceRoleId uuid.UUID `json:"service_role_id"`
	CreatedBy     uuid.UUID `json:"created_by"`
}

ServiceRoleDeleteRequest POST /service_role/delete

type ServiceRoleDeleteResponse

type ServiceRoleDeleteResponse struct {
	Message string `json:"message"`
}

type ServiceRoleGetRequest

type ServiceRoleGetRequest struct {
	RepoPrincipal string `json:"repo_principal"`
}

ServiceRoleGetRequest POST /service_role/get

type ServiceRoleGetResponse

type ServiceRoleGetResponse struct {
	ServiceRole ServiceRole `json:"service_role"`
	Message     string      `json:"message"`
}

type ServiceRoleKeyPair

type ServiceRoleKeyPair struct {
	PublicKey  []byte `json:"public_key"`
	PrivateKey []byte `json:"private_key"`
}

type ServiceRoleListRequest

type ServiceRoleListRequest struct {
	CreatedBy uuid.UUID `json:"created_by"`
}

type ServiceRoleListResponse

type ServiceRoleListResponse struct {
	ServiceRoles []ServiceRole `json:"services"`
}

type ServiceRolePermsRequest

type ServiceRolePermsRequest struct {
	RepoPrincipal string `json:"repo_principal"`
}

ServiceRolePermsRequest POST /service_role/perms

type ServiceRolePermsResponse

type ServiceRolePermsResponse struct {
	ProjectID   uuid.UUID `json:"project_id"`
	ProjectName string    `json:"project_name"`
	Env         string    `json:"env"`
}

type ServiceRollProjectKeyRequest

type ServiceRollProjectKeyRequest struct {
	ProjectID uuid.UUID `json:"project_id"`
	SessionID uuid.UUID `json:"session_id"`
	Env       string    `json:"env"`
}

ServiceRollProjectKeyRequest POST /service_role/project-key

type ServiceRollProjectKeyResponse

type ServiceRollProjectKeyResponse struct {
	ProjectId          uuid.UUID `json:"project_id"`
	WrappedPRK         []byte    `json:"wrapped_prk"`
	WrapNonce          []byte    `json:"wrap_nonce"`
	EphemeralPublicKey []byte    `json:"ephemeral_public_key"`
}

type SessionBody

type SessionBody struct {
	AccessToken  uuid.UUID `json:"access_token"`
	RefreshToken uuid.UUID `json:"refresh_token"`
	ExpiresIn    int       `json:"expires_in"`
}

type SetAccessRequest

type SetAccessRequest struct {
	ProjectName string    `json:"project_name"`
	UserEmail   string    `json:"user_email"`
	AdminId     uuid.UUID `json:"admin_id"`
	IsRevoked   bool      `json:"is_revoked"`
}

type SetAccessResponse

type SetAccessResponse struct {
	Message string `json:"message"`
}

type UserBody

type UserBody struct {
	Id                      uuid.UUID      `json:"id"`
	Email                   string         `json:"email"`
	PublicKey               []byte         `json:"public_key"`
	EncryptedUserPrivateKey []byte         `json:"encrypted_user_private_key"`
	PrivateKeySalt          []byte         `json:"private_key_salt"`
	PrivateKeyNonce         []byte         `json:"private_key_nonce"`
	ArgonParams             Argon2idParams `json:"argon_params"`
}

type UserKeyRequestBody

type UserKeyRequestBody struct {
	Email string `json:"email"`
}

type UserKeyResponseBody

type UserKeyResponseBody struct {
	Message   string    `json:"message"`
	UserId    uuid.UUID `json:"user_id"`
	PublicKey []byte    `json:"public_key"`
}

Jump to

Keyboard shortcuts

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