Documentation
¶
Index ¶
- func Decrypt(ciphertext []byte, key *[32]byte) (plaintext []byte, err error)
- func Encrypt(plaintext []byte, key *[32]byte) (ciphertext []byte, err error)
- func NewEncryptionKey() *[32]byte
- type AWSIntegrationRepository
- type ClusterRepository
- type GCPIntegrationRepository
- type GitRepoRepository
- type KubeIntegrationRepository
- type OAuthIntegrationRepository
- type OIDCIntegrationRepository
- type ProjectRepository
- type RegistryRepository
- type Repository
- type SessionRepository
- type UserRepository
- type WriteProject
- type WriteUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
Decrypt decrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Expects input form nonce|ciphertext|tag where '|' indicates concatenation.
func Encrypt ¶
Encrypt encrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Output takes the form nonce|ciphertext|tag where '|' indicates concatenation.
func NewEncryptionKey ¶
func NewEncryptionKey() *[32]byte
NewEncryptionKey generates a random 256-bit key for Encrypt() and Decrypt(). It panics if the source of randomness fails.
Types ¶
type AWSIntegrationRepository ¶
type AWSIntegrationRepository interface {
CreateAWSIntegration(am *ints.AWSIntegration) (*ints.AWSIntegration, error)
ReadAWSIntegration(id uint) (*ints.AWSIntegration, error)
ListAWSIntegrationsByProjectID(projectID uint) ([]*ints.AWSIntegration, error)
}
AWSIntegrationRepository represents the set of queries on the AWS auth mechanism
type ClusterRepository ¶
type ClusterRepository interface {
CreateClusterCandidate(cc *models.ClusterCandidate) (*models.ClusterCandidate, error)
ReadClusterCandidate(id uint) (*models.ClusterCandidate, error)
ListClusterCandidatesByProjectID(projectID uint) ([]*models.ClusterCandidate, error)
UpdateClusterCandidateCreatedClusterID(id uint, createdClusterID uint) (*models.ClusterCandidate, error)
CreateCluster(cluster *models.Cluster) (*models.Cluster, error)
ReadCluster(id uint) (*models.Cluster, error)
ListClustersByProjectID(projectID uint) ([]*models.Cluster, error)
UpdateClusterTokenCache(tokenCache *ints.TokenCache) (*models.Cluster, error)
}
ClusterRepository represents the set of queries on the Cluster model
type GCPIntegrationRepository ¶
type GCPIntegrationRepository interface {
CreateGCPIntegration(am *ints.GCPIntegration) (*ints.GCPIntegration, error)
ReadGCPIntegration(id uint) (*ints.GCPIntegration, error)
ListGCPIntegrationsByProjectID(projectID uint) ([]*ints.GCPIntegration, error)
}
GCPIntegrationRepository represents the set of queries on the GCP auth mechanism
type GitRepoRepository ¶
type GitRepoRepository interface {
CreateGitRepo(gr *models.GitRepo) (*models.GitRepo, error)
ReadGitRepo(id uint) (*models.GitRepo, error)
ListGitReposByProjectID(projectID uint) ([]*models.GitRepo, error)
}
GitRepoRepository represents the set of queries on the GitRepo model
type KubeIntegrationRepository ¶
type KubeIntegrationRepository interface {
CreateKubeIntegration(am *ints.KubeIntegration) (*ints.KubeIntegration, error)
ReadKubeIntegration(id uint) (*ints.KubeIntegration, error)
ListKubeIntegrationsByProjectID(projectID uint) ([]*ints.KubeIntegration, error)
}
KubeIntegrationRepository represents the set of queries on the OIDC auth mechanism
type OAuthIntegrationRepository ¶
type OAuthIntegrationRepository interface {
CreateOAuthIntegration(am *ints.OAuthIntegration) (*ints.OAuthIntegration, error)
ReadOAuthIntegration(id uint) (*ints.OAuthIntegration, error)
ListOAuthIntegrationsByProjectID(projectID uint) ([]*ints.OAuthIntegration, error)
}
OAuthIntegrationRepository represents the set of queries on the oauth mechanism
type OIDCIntegrationRepository ¶
type OIDCIntegrationRepository interface {
CreateOIDCIntegration(am *ints.OIDCIntegration) (*ints.OIDCIntegration, error)
ReadOIDCIntegration(id uint) (*ints.OIDCIntegration, error)
ListOIDCIntegrationsByProjectID(projectID uint) ([]*ints.OIDCIntegration, error)
}
OIDCIntegrationRepository represents the set of queries on the OIDC auth mechanism
type ProjectRepository ¶
type ProjectRepository interface {
CreateProject(project *models.Project) (*models.Project, error)
CreateProjectRole(project *models.Project, role *models.Role) (*models.Role, error)
ReadProject(id uint) (*models.Project, error)
ListProjectsByUserID(userID uint) ([]*models.Project, error)
DeleteProject(project *models.Project) (*models.Project, error)
}
ProjectRepository represents the set of queries on the Project model
type RegistryRepository ¶
type RegistryRepository interface {
CreateRegistry(reg *models.Registry) (*models.Registry, error)
ReadRegistry(id uint) (*models.Registry, error)
ListRegistriesByProjectID(projectID uint) ([]*models.Registry, error)
UpdateRegistryTokenCache(tokenCache *ints.RegTokenCache) (*models.Registry, error)
}
RegistryRepository represents the set of queries on the Registry model
type Repository ¶
type Repository struct {
User UserRepository
Project ProjectRepository
Session SessionRepository
GitRepo GitRepoRepository
Cluster ClusterRepository
Registry RegistryRepository
KubeIntegration KubeIntegrationRepository
OIDCIntegration OIDCIntegrationRepository
OAuthIntegration OAuthIntegrationRepository
GCPIntegration GCPIntegrationRepository
AWSIntegration AWSIntegrationRepository
}
Repository collects the repositories for each model
type SessionRepository ¶
type SessionRepository interface {
CreateSession(session *models.Session) (*models.Session, error)
UpdateSession(session *models.Session) (*models.Session, error)
DeleteSession(session *models.Session) (*models.Session, error)
SelectSession(session *models.Session) (*models.Session, error)
}
SessionRepository represents the set of queries on the Session model
type UserRepository ¶
type UserRepository interface {
CreateUser(user *models.User) (*models.User, error)
CheckPassword(id int, pwd string) (bool, error)
ReadUser(id uint) (*models.User, error)
ReadUserByEmail(email string) (*models.User, error)
UpdateUser(user *models.User) (*models.User, error)
DeleteUser(user *models.User) (*models.User, error)
}
UserRepository represents the set of queries on the User model
type WriteProject ¶
WriteProject is the function type for all Project write operations