models

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package models package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandGroupPath added in v0.16.0

func ExpandGroupPath(currentPath string) []string

ExpandGroupPath returns the expanded path list for a group's path. The expanded path list includes the full path for the group in addition to all parent paths

func GetGroupParentPath added in v0.16.0

func GetGroupParentPath(currentPath string) string

GetGroupParentPath returns the path for a group's parent based only on the current path.

func IsDescendantOfPath added in v0.16.0

func IsDescendantOfPath(descendantPath, ancestorPath string) bool

IsDescendantOfPath returns true if the namespace is a descendant of the specified (ancestor group) path.

Types

type ActivityEvent

type ActivityEvent struct {
	UserID           *string
	ServiceAccountID *string
	NamespacePath    *string
	Payload          []byte
	TargetID         string
	Action           ActivityEventAction
	TargetType       ActivityEventTargetType
	Metadata         ResourceMetadata
}

ActivityEvent resource

func (*ActivityEvent) ResolveMetadata added in v0.10.0

func (a *ActivityEvent) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type ActivityEventAction

type ActivityEventAction string

ActivityEventAction represents the type of action.

const (
	ActionAdd                 ActivityEventAction = "ADD"
	ActionAddMember           ActivityEventAction = "ADD_MEMBER"
	ActionCreateMembership    ActivityEventAction = "CREATE_MEMBERSHIP"
	ActionApply               ActivityEventAction = "APPLY"
	ActionCancel              ActivityEventAction = "CANCEL"
	ActionCreate              ActivityEventAction = "CREATE"
	ActionDeleteChildResource ActivityEventAction = "DELETE_CHILD_RESOURCE"
	ActionLock                ActivityEventAction = "LOCK"
	ActionMigrate             ActivityEventAction = "MIGRATE"
	ActionRemove              ActivityEventAction = "REMOVE"
	ActionRemoveMember        ActivityEventAction = "REMOVE_MEMBER"
	ActionRemoveMembership    ActivityEventAction = "REMOVE_MEMBERSHIP"
	ActionSetVariables        ActivityEventAction = "SET_VARIABLES"
	ActionUnlock              ActivityEventAction = "UNLOCK"
	ActionUpdate              ActivityEventAction = "UPDATE"
	ActionUpdateMember        ActivityEventAction = "UPDATE_MEMBER"
)

ActivityEventAction Types

type ActivityEventAddTeamMemberPayload

type ActivityEventAddTeamMemberPayload struct {
	UserID     *string `json:"userId"`
	Maintainer bool    `json:"maintainer"`
}

ActivityEventAddTeamMemberPayload is the custom payload for adding a user to a team

type ActivityEventCreateNamespaceMembershipPayload

type ActivityEventCreateNamespaceMembershipPayload struct {
	UserID           *string `json:"userId"`
	ServiceAccountID *string `json:"serviceAccountId"`
	TeamID           *string `json:"teamId"`
	Role             string  `json:"role"`
}

ActivityEventCreateNamespaceMembershipPayload helps with custom payloads for activity events for namespace memberships.

type ActivityEventDeleteChildResourcePayload

type ActivityEventDeleteChildResourcePayload struct {
	Name string `json:"name"`
	ID   string `json:"id"`
	Type string `json:"type"`
}

ActivityEventDeleteChildResourcePayload holds information about the resource that was deleted. The target ID and target type of the associated activity event will be that of the group (or workspace for a workspace-level variable) the resource was in.

type ActivityEventMigrateGroupPayload added in v0.9.0

type ActivityEventMigrateGroupPayload struct {
	PreviousGroupPath string `json:"previousGroupPath"`
}

ActivityEventMigrateGroupPayload is the custom payload for migrating a group.

type ActivityEventMoveManagedIdentityPayload added in v0.16.0

type ActivityEventMoveManagedIdentityPayload struct {
	PreviousGroupPath string `json:"previousGroupPath"`
}

ActivityEventMoveManagedIdentityPayload is the custom payload for moving a managed identity to another group.

type ActivityEventRemoveNamespaceMembershipPayload

type ActivityEventRemoveNamespaceMembershipPayload struct {
	UserID           *string `json:"userId"`
	ServiceAccountID *string `json:"serviceAccountId"`
	TeamID           *string `json:"teamId"`
}

ActivityEventRemoveNamespaceMembershipPayload helps with custom payloads for activity events for namespace memberships.

type ActivityEventRemoveTeamMemberPayload

type ActivityEventRemoveTeamMemberPayload struct {
	UserID *string `json:"userId"`
}

ActivityEventRemoveTeamMemberPayload is the custom payload for removing a user from a team

type ActivityEventTargetType

type ActivityEventTargetType string

ActivityEventTargetType represents the type of the target of the action.

const (
	TargetGPGKey                         ActivityEventTargetType = "GPG_KEY"
	TargetGroup                          ActivityEventTargetType = "GROUP"
	TargetManagedIdentity                ActivityEventTargetType = "MANAGED_IDENTITY"
	TargetManagedIdentityAccessRule      ActivityEventTargetType = "MANAGED_IDENTITY_ACCESS_RULE"
	TargetNamespaceMembership            ActivityEventTargetType = "NAMESPACE_MEMBERSHIP"
	TargetRun                            ActivityEventTargetType = "RUN"
	TargetRunner                         ActivityEventTargetType = "RUNNER"
	TargetServiceAccount                 ActivityEventTargetType = "SERVICE_ACCOUNT"
	TargetStateVersion                   ActivityEventTargetType = "STATE_VERSION"
	TargetTeam                           ActivityEventTargetType = "TEAM"
	TargetTerraformProvider              ActivityEventTargetType = "TERRAFORM_PROVIDER"
	TargetTerraformProviderVersion       ActivityEventTargetType = "TERRAFORM_PROVIDER_VERSION"
	TargetTerraformProviderVersionMirror ActivityEventTargetType = "TERRAFORM_PROVIDER_VERSION_MIRROR"
	TargetTerraformModule                ActivityEventTargetType = "TERRAFORM_MODULE"
	TargetTerraformModuleVersion         ActivityEventTargetType = "TERRAFORM_MODULE_VERSION"
	TargetVariable                       ActivityEventTargetType = "VARIABLE"
	TargetVCSProvider                    ActivityEventTargetType = "VCS_PROVIDER"
	TargetWorkspace                      ActivityEventTargetType = "WORKSPACE"
	TargetRole                           ActivityEventTargetType = "ROLE"
)

ActivityEventTargetType Values

type ActivityEventUpdateNamespaceMembershipPayload

type ActivityEventUpdateNamespaceMembershipPayload struct {
	PrevRole string `json:"prevRole"`
	NewRole  string `json:"newRole"`
}

ActivityEventUpdateNamespaceMembershipPayload helps with custom payloads for activity events for namespace memberships.

type ActivityEventUpdateTeamMemberPayload

type ActivityEventUpdateTeamMemberPayload struct {
	UserID     *string `json:"userId"`
	Maintainer bool    `json:"maintainer"`
}

ActivityEventUpdateTeamMemberPayload is the custom payload for updating a member of a team

type Apply

type Apply struct {
	WorkspaceID string
	Status      ApplyStatus
	TriggeredBy string
	Comment     string
	Metadata    ResourceMetadata
}

Apply includes information related to running a terraform plan command

func (*Apply) ResolveMetadata added in v0.10.0

func (a *Apply) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type ApplyStatus

type ApplyStatus string

ApplyStatus represents the various states for a Apply resource

const (
	ApplyCanceled ApplyStatus = "canceled"
	ApplyCreated  ApplyStatus = "created"
	ApplyErrored  ApplyStatus = "errored"
	ApplyFinished ApplyStatus = "finished"
	ApplyPending  ApplyStatus = "pending"
	ApplyQueued   ApplyStatus = "queued"
	ApplyRunning  ApplyStatus = "running"
)

Apply Status Types

type ConfigurationStatus

type ConfigurationStatus string

ConfigurationStatus represents the various states for a ConfigurationVersion resource

const (
	ConfigurationErrored  ConfigurationStatus = "errored"
	ConfigurationPending  ConfigurationStatus = "pending"
	ConfigurationUploaded ConfigurationStatus = "uploaded"
)

Configuration version status types

type ConfigurationVersion

type ConfigurationVersion struct {
	VCSEventID  *string
	Status      ConfigurationStatus
	WorkspaceID string
	CreatedBy   string
	Metadata    ResourceMetadata
	Speculative bool
}

ConfigurationVersion resource represents a terraform configuration that can be used by a single Run

func (*ConfigurationVersion) ResolveMetadata added in v0.10.0

func (c *ConfigurationVersion) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type DefaultRoleID added in v0.9.0

type DefaultRoleID string

DefaultRoleID represents the static UUIDs for default Tharsis roles.

const (
	OwnerRoleID    DefaultRoleID = "623c83ea-23fe-4de6-874a-a99ccf6a76fc"
	DeployerRoleID DefaultRoleID = "8aa7adba-b769-471f-8ebb-3215f33991cb"
	ViewerRoleID   DefaultRoleID = "52da70fd-37b0-4349-bb64-fb4659bcf5f5"
)

DefaultRoleID constants.

func (DefaultRoleID) IsDefaultRole added in v0.9.0

func (d DefaultRoleID) IsDefaultRole() bool

IsDefaultRole returns true if ID belongs to a default role.

func (DefaultRoleID) Permissions added in v0.9.0

func (d DefaultRoleID) Permissions() ([]permissions.Permission, bool)

Permissions returns the Permission set for a default Tharsis role.

func (DefaultRoleID) String added in v0.9.0

func (d DefaultRoleID) String() string

String returns the ID as a string.

type GPGKey

type GPGKey struct {
	CreatedBy    string
	GroupID      string
	ASCIIArmor   string
	Fingerprint  string
	ResourcePath string
	Metadata     ResourceMetadata
	GPGKeyID     uint64
}

GPGKey represents a GPG key used for signing

func (*GPGKey) GetGroupPath added in v0.6.0

func (g *GPGKey) GetGroupPath() string

GetGroupPath returns the group path

func (*GPGKey) GetHexGPGKeyID

func (g *GPGKey) GetHexGPGKeyID() string

GetHexGPGKeyID returns the GPG key ID in hex format

func (*GPGKey) ResolveMetadata added in v0.10.0

func (g *GPGKey) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type Group

type Group struct {
	Name        string
	Description string
	ParentID    string
	FullPath    string
	CreatedBy   string
	Metadata    ResourceMetadata
}

Group resource

func (*Group) ExpandPath

func (g *Group) ExpandPath() []string

ExpandPath returns the expanded path list for the group. The expanded path list includes the full path for the group in addition to all parent paths

func (*Group) GetDepth added in v0.11.0

func (g *Group) GetDepth() int

GetDepth returns the depth of the tree from root to this group. A root group is counted as 1.

func (*Group) GetParentPath

func (g *Group) GetParentPath() string

GetParentPath returns the path for the group's immediate parent.

func (*Group) GetRootGroupPath

func (g *Group) GetRootGroupPath() string

GetRootGroupPath returns the root path for the group

func (*Group) IsDescendantOfGroup added in v0.16.0

func (g *Group) IsDescendantOfGroup(otherGroupPath string) bool

IsDescendantOfGroup returns true if the group is a descendant of the specified (other/ancestor group) path.

func (*Group) ResolveMetadata added in v0.10.0

func (g *Group) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*Group) Validate

func (g *Group) Validate() error

Validate returns an error if the model is not valid

type Job

type Job struct {
	Timestamps               JobTimestamps
	CancelRequestedTimestamp *time.Time
	Status                   JobStatus
	Type                     JobType
	WorkspaceID              string
	RunID                    string
	RunnerID                 *string
	RunnerPath               *string
	Metadata                 ResourceMetadata
	MaxJobDuration           int32
	CancelRequested          bool
}

Job represents a unit of work that needs to be completed

func (*Job) ResolveMetadata added in v0.10.0

func (j *Job) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type JobLogDescriptor

type JobLogDescriptor struct {
	JobID    string
	Metadata ResourceMetadata
	Size     int
}

JobLogDescriptor contains metadata for job logs

type JobStatus

type JobStatus string

JobStatus type

const (
	JobQueued   JobStatus = "queued"
	JobPending  JobStatus = "pending"
	JobRunning  JobStatus = "running"
	JobFinished JobStatus = "finished"
)

Job Status Constants

type JobTimestamps

type JobTimestamps struct {
	QueuedTimestamp   *time.Time
	PendingTimestamp  *time.Time
	RunningTimestamp  *time.Time
	FinishedTimestamp *time.Time
}

JobTimestamps includes the timestamp for each job state change

type JobType

type JobType string

JobType indicates the type of job

const (
	JobPlanType  JobType = "plan"
	JobApplyType JobType = "apply"
)

Job Types Constants

type ManagedIdentity

type ManagedIdentity struct {
	Type          ManagedIdentityType
	ResourcePath  string
	Name          string
	Description   string
	GroupID       string
	CreatedBy     string
	AliasSourceID *string
	Metadata      ResourceMetadata
	Data          []byte
}

ManagedIdentity is used to provide identities to terraform providers

func (*ManagedIdentity) GetGroupPath

func (m *ManagedIdentity) GetGroupPath() string

GetGroupPath returns the group path

func (*ManagedIdentity) IsAlias added in v0.2.0

func (m *ManagedIdentity) IsAlias() bool

IsAlias returns true is managed identity is an alias.

func (*ManagedIdentity) ResolveMetadata added in v0.10.0

func (m *ManagedIdentity) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*ManagedIdentity) Validate

func (m *ManagedIdentity) Validate() error

Validate returns an error if the model is not valid

type ManagedIdentityAccessRule

type ManagedIdentityAccessRule struct {
	Metadata                  ResourceMetadata
	Type                      ManagedIdentityAccessRuleType
	RunStage                  JobType
	ManagedIdentityID         string
	ModuleAttestationPolicies []ManagedIdentityAccessRuleModuleAttestationPolicy
	AllowedUserIDs            []string
	AllowedServiceAccountIDs  []string
	AllowedTeamIDs            []string
}

ManagedIdentityAccessRule is used to restrict access to a managed identity

func (*ManagedIdentityAccessRule) ResolveMetadata added in v0.10.0

func (m *ManagedIdentityAccessRule) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*ManagedIdentityAccessRule) Validate added in v0.3.0

func (m *ManagedIdentityAccessRule) Validate() error

Validate returns an error if the model is not valid

type ManagedIdentityAccessRuleModuleAttestationPolicy added in v0.3.0

type ManagedIdentityAccessRuleModuleAttestationPolicy struct {
	PredicateType *string `json:"predicateType,omitempty"`
	PublicKey     string  `json:"publicKey"`
}

ManagedIdentityAccessRuleModuleAttestationPolicy is used in access rules to verify that a module has an in-toto attestation that is signed with the specified public key and an optional predicate type

type ManagedIdentityAccessRuleType added in v0.3.0

type ManagedIdentityAccessRuleType string

ManagedIdentityAccessRuleType represents the supported managed identity rule types

const (
	ManagedIdentityAccessRuleEligiblePrincipals ManagedIdentityAccessRuleType = "eligible_principals"
	ManagedIdentityAccessRuleModuleAttestation  ManagedIdentityAccessRuleType = "module_attestation"
)

Managed Identity Rule Types

type ManagedIdentityType

type ManagedIdentityType string

ManagedIdentityType represents the supported managed identity types

const (
	ManagedIdentityAzureFederated   ManagedIdentityType = "azure_federated"
	ManagedIdentityAWSFederated     ManagedIdentityType = "aws_federated"
	ManagedIdentityTharsisFederated ManagedIdentityType = "tharsis_federated"
)

Managed Identity Types

type MembershipNamespace

type MembershipNamespace struct {
	GroupID     *string
	WorkspaceID *string
	ID          string
	Path        string
}

MembershipNamespace represents a namespace which can be a group or workspace

func (*MembershipNamespace) IsDescendantOfGroup added in v0.16.0

func (m *MembershipNamespace) IsDescendantOfGroup(groupPath string) bool

IsDescendantOfGroup returns true if the namespace is a descendant of the specified ancestor group path.

func (MembershipNamespace) IsTopLevel

func (m MembershipNamespace) IsTopLevel() bool

IsTopLevel returns true if this is a top-level namespace

type NamespaceMembership

type NamespaceMembership struct {
	UserID           *string
	ServiceAccountID *string
	TeamID           *string
	Namespace        MembershipNamespace
	RoleID           string
	Metadata         ResourceMetadata
}

NamespaceMembership represents an association between a member and a namespace

func (*NamespaceMembership) ResolveMetadata added in v0.10.0

func (nm *NamespaceMembership) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type OIDCTrustPolicy

type OIDCTrustPolicy struct {
	BoundClaims map[string]string
	Issuer      string
}

OIDCTrustPolicy defined the IDP that can be used for logging into the service account

type Plan

type Plan struct {
	WorkspaceID          string
	Status               PlanStatus
	Metadata             ResourceMetadata
	ResourceAdditions    int
	ResourceChanges      int
	ResourceDestructions int
	HasChanges           bool
}

Plan includes information related to running a terraform plan command

func (*Plan) ResolveMetadata added in v0.10.0

func (p *Plan) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type PlanStatus

type PlanStatus string

PlanStatus represents the various states for a Plan resource

const (
	PlanCanceled PlanStatus = "canceled"
	PlanQueued   PlanStatus = "queued"
	PlanErrored  PlanStatus = "errored"
	PlanFinished PlanStatus = "finished"
	PlanPending  PlanStatus = "pending"
	PlanRunning  PlanStatus = "running"
)

Run Status Types

type ResourceLimit added in v0.11.0

type ResourceLimit struct {
	Name     string
	Metadata ResourceMetadata
	Value    int
}

ResourceLimit represents a resource limit

type ResourceMetadata

type ResourceMetadata struct {
	CreationTimestamp    *time.Time `json:"createdAt"`
	LastUpdatedTimestamp *time.Time `json:"updatedAt,omitempty" `
	ID                   string     `json:"id"`
	Version              int        `json:"version"`
}

ResourceMetadata contains metadata for a particular resource

type Role

type Role struct {
	Name        string
	Description string
	CreatedBy   string

	Metadata ResourceMetadata
	// contains filtered or unexported fields
}

Role defines a subject's ability to access or modify resources within Tharsis. It provides a set of permissions that dictate which resources can be viewed or modified.

func (*Role) GetPermissions added in v0.9.0

func (r *Role) GetPermissions() []permissions.Permission

GetPermissions returns permissions for a role.

func (*Role) ResolveMetadata added in v0.10.0

func (r *Role) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*Role) SetPermissions added in v0.9.0

func (r *Role) SetPermissions(perms []permissions.Permission)

SetPermissions sets permissions for a role.

func (*Role) Validate added in v0.9.0

func (r *Role) Validate() error

Validate returns an error if the model is not valid

type Run

type Run struct {
	ConfigurationVersionID *string
	ForceCancelAvailableAt *time.Time
	ForceCanceledBy        *string
	ModuleVersion          *string
	ModuleSource           *string
	TargetAddresses        []string
	ModuleDigest           []byte // This is only set for modules stored in the Tharsis module registry
	CreatedBy              string
	PlanID                 string
	ApplyID                string
	WorkspaceID            string
	Status                 RunStatus
	Comment                string
	TerraformVersion       string
	Metadata               ResourceMetadata
	HasChanges             bool
	IsDestroy              bool
	ForceCanceled          bool
	AutoApply              bool
	Refresh                bool
}

Run represents a terraform run Only one of ConfigurationVersionID, ModuleSource/ModuleVersion can be non-nil. The ModuleVersion field is optional: blank if non-registry or want latest version

func (*Run) ResolveMetadata added in v0.10.0

func (r *Run) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type RunStatus

type RunStatus string

RunStatus represents the various states for a Run resource

const (
	RunApplied            RunStatus = "applied"
	RunApplyQueued        RunStatus = "apply_queued"
	RunApplying           RunStatus = "applying"
	RunCanceled           RunStatus = "canceled"
	RunErrored            RunStatus = "errored"
	RunPending            RunStatus = "pending"
	RunPlanQueued         RunStatus = "plan_queued"
	RunPlanned            RunStatus = "planned"
	RunPlannedAndFinished RunStatus = "planned_and_finished"
	RunPlanning           RunStatus = "planning"
)

Run Status Types

type Runner added in v0.8.0

type Runner struct {
	Type         RunnerType
	Name         string
	Description  string
	GroupID      *string
	ResourcePath string
	CreatedBy    string
	Metadata     ResourceMetadata
}

Runner resource

func (*Runner) GetGroupPath added in v0.8.0

func (r *Runner) GetGroupPath() string

GetGroupPath returns the group path

func (*Runner) ResolveMetadata added in v0.10.0

func (r *Runner) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*Runner) Validate added in v0.8.0

func (r *Runner) Validate() error

Validate returns an error if the model is not valid

type RunnerType added in v0.8.0

type RunnerType string

RunnerType constant

const (
	GroupRunnerType  RunnerType = "group"
	SharedRunnerType RunnerType = "shared"
)

RunnerType constants

type SCIMToken

type SCIMToken struct {
	Nonce     string
	CreatedBy string
	Metadata  ResourceMetadata
}

SCIMToken represents a SCIM token.

type ServiceAccount

type ServiceAccount struct {
	Metadata          ResourceMetadata
	ResourcePath      string
	Name              string
	Description       string
	GroupID           string
	CreatedBy         string
	OIDCTrustPolicies []OIDCTrustPolicy
}

ServiceAccount provided M2M authentication

func (*ServiceAccount) GetGroupPath

func (s *ServiceAccount) GetGroupPath() string

GetGroupPath returns the group path

func (*ServiceAccount) ResolveMetadata added in v0.10.0

func (s *ServiceAccount) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*ServiceAccount) Validate

func (s *ServiceAccount) Validate() error

Validate returns an error if the model is not valid

type StateVersion

type StateVersion struct {
	WorkspaceID string
	RunID       *string
	CreatedBy   string
	Metadata    ResourceMetadata
}

StateVersion represents a specific version of the the terraform state associated with a workspace

func (*StateVersion) ResolveMetadata added in v0.10.0

func (s *StateVersion) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type StateVersionOutput

type StateVersionOutput struct {
	Name           string
	StateVersionID string
	Metadata       ResourceMetadata
	Value          []byte
	Type           []byte
	Sensitive      bool
}

StateVersionOutput represents a terraform state version output

type Team

type Team struct {
	Name           string
	Description    string
	SCIMExternalID string
	Metadata       ResourceMetadata
}

Team represents a team of (human) users

func (*Team) ResolveMetadata added in v0.10.0

func (t *Team) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*Team) Validate

func (t *Team) Validate() error

Validate returns an error if the model is not valid

type TeamMember

type TeamMember struct {
	UserID       string
	TeamID       string
	Metadata     ResourceMetadata
	IsMaintainer bool
}

TeamMember represents an association between a (human) user and a namespace

func (*TeamMember) ResolveMetadata added in v0.10.0

func (t *TeamMember) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type TerraformModule

type TerraformModule struct {
	CreatedBy     string
	Name          string // the module name
	System        string // the name of the remote system the module is intended to target
	GroupID       string
	RootGroupID   string // the module namespace is the path of the root group
	ResourcePath  string // resource path is <group-path>/<module-name>/<system>
	RepositoryURL string
	Metadata      ResourceMetadata
	Private       bool
}

TerraformModule represents a terraform module

func (*TerraformModule) GetGroupPath

func (t *TerraformModule) GetGroupPath() string

GetGroupPath returns the group path

func (*TerraformModule) GetRegistryNamespace

func (t *TerraformModule) GetRegistryNamespace() string

GetRegistryNamespace returns the module registry namespace for the terraform module

func (*TerraformModule) ResolveMetadata added in v0.10.0

func (t *TerraformModule) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*TerraformModule) Validate

func (t *TerraformModule) Validate() error

Validate returns an error if the model is not valid

type TerraformModuleAttestation

type TerraformModuleAttestation struct {
	CreatedBy     string
	Description   string
	ModuleID      string
	SchemaType    string
	PredicateType string
	Data          string
	DataSHASum    []byte
	Metadata      ResourceMetadata
	Digests       []string
}

TerraformModuleAttestation represents a terraform module attestation

func (*TerraformModuleAttestation) ResolveMetadata added in v0.10.0

func (t *TerraformModuleAttestation) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*TerraformModuleAttestation) Validate

func (t *TerraformModuleAttestation) Validate() error

Validate returns an error if the model is not valid

type TerraformModuleVersion

type TerraformModuleVersion struct {
	CreatedBy              string
	ModuleID               string
	SemanticVersion        string
	Status                 TerraformModuleVersionStatus
	Error                  string
	Diagnostics            string
	UploadStartedTimestamp *time.Time
	Metadata               ResourceMetadata
	SHASum                 []byte
	Submodules             []string
	Examples               []string
	Latest                 bool
}

TerraformModuleVersion represents a terraform module version

func (*TerraformModuleVersion) GetSHASumHex

func (t *TerraformModuleVersion) GetSHASumHex() string

GetSHASumHex returns the SHA checksum as a HEX string

func (*TerraformModuleVersion) ResolveMetadata added in v0.10.0

func (t *TerraformModuleVersion) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type TerraformModuleVersionStatus

type TerraformModuleVersionStatus string

TerraformModuleVersionStatus is the status of the module version upload

const (
	TerraformModuleVersionStatusPending          TerraformModuleVersionStatus = "pending"
	TerraformModuleVersionStatusUploadInProgress TerraformModuleVersionStatus = "upload_in_progress"
	TerraformModuleVersionStatusErrored          TerraformModuleVersionStatus = "errored"
	TerraformModuleVersionStatusUploaded         TerraformModuleVersionStatus = "uploaded"
)

TerraformModuleVersionStatus constants

type TerraformProvider

type TerraformProvider struct {
	CreatedBy     string
	Name          string
	GroupID       string
	RootGroupID   string
	ResourcePath  string
	RepositoryURL string
	Metadata      ResourceMetadata
	Private       bool
}

TerraformProvider represents a terraform provider

func (*TerraformProvider) GetGroupPath

func (t *TerraformProvider) GetGroupPath() string

GetGroupPath returns the group path

func (*TerraformProvider) GetRegistryNamespace

func (t *TerraformProvider) GetRegistryNamespace() string

GetRegistryNamespace returns the provider registry namespace for the terraform provider

func (*TerraformProvider) ResolveMetadata added in v0.10.0

func (t *TerraformProvider) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*TerraformProvider) Validate

func (t *TerraformProvider) Validate() error

Validate returns an error if the model is not valid

type TerraformProviderPlatform

type TerraformProviderPlatform struct {
	ProviderVersionID string
	OperatingSystem   string
	Architecture      string
	SHASum            string
	Filename          string
	CreatedBy         string
	Metadata          ResourceMetadata
	BinaryUploaded    bool
}

TerraformProviderPlatform represents a supported platform for a terraform provider version

func (*TerraformProviderPlatform) ResolveMetadata added in v0.10.0

func (t *TerraformProviderPlatform) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type TerraformProviderPlatformMirror added in v0.12.0

type TerraformProviderPlatformMirror struct {
	OS              string
	Architecture    string
	VersionMirrorID string
	Metadata        ResourceMetadata
}

TerraformProviderPlatformMirror represents the platforms a Terraform provider version mirror supports.

func (*TerraformProviderPlatformMirror) ResolveMetadata added in v0.12.0

func (t *TerraformProviderPlatformMirror) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type TerraformProviderVersion

type TerraformProviderVersion struct {
	GPGASCIIArmor            *string
	GPGKeyID                 *uint64
	CreatedBy                string
	ProviderID               string
	SemanticVersion          string
	Metadata                 ResourceMetadata
	Protocols                []string
	SHASumsUploaded          bool
	SHASumsSignatureUploaded bool
	ReadmeUploaded           bool
	Latest                   bool
}

TerraformProviderVersion represents a version of a terraform provider

func (*TerraformProviderVersion) GetHexGPGKeyID

func (t *TerraformProviderVersion) GetHexGPGKeyID() *string

GetHexGPGKeyID returns the GPG key id in hex format

func (*TerraformProviderVersion) ResolveMetadata added in v0.10.0

func (t *TerraformProviderVersion) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type TerraformProviderVersionMirror added in v0.12.0

type TerraformProviderVersionMirror struct {
	CreatedBy         string
	Type              string
	SemanticVersion   string
	RegistryNamespace string
	RegistryHostname  string
	Digests           map[string][]byte
	GroupID           string
	Metadata          ResourceMetadata
}

TerraformProviderVersionMirror represents a version of a Terraform provider that's mirrored using the Provider Network Mirror Protocol.

func (*TerraformProviderVersionMirror) ResolveMetadata added in v0.12.0

func (t *TerraformProviderVersionMirror) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type User

type User struct {
	Username       string
	Email          string
	SCIMExternalID string
	Metadata       ResourceMetadata
	Admin          bool
	Active         bool
}

User represents a human user account

func (*User) ResolveMetadata added in v0.10.0

func (u *User) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type VCSEvent

type VCSEvent struct {
	ErrorMessage        *string // An error message indicating the reason event failed.
	CommitID            *string // Commit ID associated with this event.
	SourceReferenceName *string // Name of branch or tag that triggered this event.
	WorkspaceID         string
	RepositoryURL       string
	Type                VCSEventType
	Status              VCSEventStatus
	Metadata            ResourceMetadata
}

VCSEvent represents a vcs event that result in configuration changes via Tharsis.

func (*VCSEvent) ResolveMetadata added in v0.10.0

func (v *VCSEvent) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type VCSEventStatus

type VCSEventStatus string

VCSEventStatus defines an enum that represents the status of a VCS event.

const (
	VCSEventPending  VCSEventStatus = "pending"
	VCSEventFinished VCSEventStatus = "finished"
	VCSEventErrored  VCSEventStatus = "errored"
)

VCSEventStatus constants.

type VCSEventType

type VCSEventType string

VCSEventType defines an enum that represents the type of VCS event.

const (
	BranchEventType       VCSEventType = "branch"
	TagEventType          VCSEventType = "tag"
	MergeRequestEventType VCSEventType = "merge_request"
	ManualEventType       VCSEventType = "manual"
)

VCSEventType constants.

func (VCSEventType) Equals

func (have VCSEventType) Equals(want VCSEventType) bool

Equals is a convenience func that returns whether two events are equal.

type VCSProvider

type VCSProvider struct {
	OAuthAccessTokenExpiresAt *time.Time
	CreatedBy                 string
	URL                       url.URL
	Name                      string
	Description               string
	ResourcePath              string
	Type                      VCSProviderType
	GroupID                   string
	OAuthClientSecret         string
	OAuthClientID             string
	OAuthState                *string
	OAuthAccessToken          *string
	OAuthRefreshToken         *string
	Metadata                  ResourceMetadata
	AutoCreateWebhooks        bool
}

VCSProvider represents a version control system provider.

func (*VCSProvider) GetGroupPath

func (v *VCSProvider) GetGroupPath() string

GetGroupPath returns the group path

func (*VCSProvider) ResolveMetadata added in v0.10.0

func (v *VCSProvider) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*VCSProvider) Validate

func (v *VCSProvider) Validate() error

Validate returns an error if the model is not valid

type VCSProviderType

type VCSProviderType string

VCSProviderType defines the type of version control system (VCS) provider.

const (
	GitLabProviderType VCSProviderType = "gitlab"
	GitHubProviderType VCSProviderType = "github"
)

VCSProviderType and OAuthTokenType enums.

type Variable

type Variable struct {
	Value         *string
	Category      VariableCategory
	NamespacePath string
	Key           string
	Metadata      ResourceMetadata
	Hcl           bool
}

Variable resource

func (*Variable) ResolveMetadata added in v0.10.0

func (v *Variable) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

type VariableCategory

type VariableCategory string

VariableCategory specifies if the variable is a terraform or environment variable

const (
	TerraformVariableCategory   VariableCategory = "terraform"
	EnvironmentVariableCategory VariableCategory = "environment"
)

Variable category Status Types

type Workspace

type Workspace struct {
	MaxJobDuration        *int32
	Name                  string
	FullPath              string
	GroupID               string
	Description           string
	CurrentJobID          string
	CurrentStateVersionID string
	CreatedBy             string
	TerraformVersion      string
	Metadata              ResourceMetadata
	DirtyState            bool
	Locked                bool
	PreventDestroyPlan    bool
}

Workspace represents a terraform workspace

func (*Workspace) ExpandPath added in v0.8.0

func (w *Workspace) ExpandPath() []string

ExpandPath returns the expanded path list for the workspace. The expanded path list includes the full path for the workspace in addition to all parent paths

func (*Workspace) GetGroupPath

func (w *Workspace) GetGroupPath() string

GetGroupPath returns the group path

func (*Workspace) IsDescendantOfGroup added in v0.16.0

func (w *Workspace) IsDescendantOfGroup(groupPath string) bool

IsDescendantOfGroup returns true if the workspace is a descendant of the specified ancestor group path.

func (*Workspace) ResolveMetadata added in v0.10.0

func (w *Workspace) ResolveMetadata(key string) (string, error)

ResolveMetadata resolves the metadata fields for cursor-based pagination

func (*Workspace) Validate

func (w *Workspace) Validate() error

Validate returns an error if the model is not valid

type WorkspaceVCSProviderLink struct {
	CreatedBy           string
	WorkspaceID         string
	ProviderID          string
	TokenNonce          string
	RepositoryPath      string
	WebhookID           string   // Webhook ID if Tharsis configured it.
	ModuleDirectory     *string  // Path to Terraform module, otherwise repo root.
	Branch              string   // A branch name to filter on.
	TagRegex            *string  // A tag regex to use as a filter.
	GlobPatterns        []string // Glob patterns to use for monitoring changes.
	Metadata            ResourceMetadata
	AutoSpeculativePlan bool // Whether to create speculative plans automatically for PRs.
	WebhookDisabled     bool
}

WorkspaceVCSProviderLink represents a link for a version control system provider to a workspace.

func (*WorkspaceVCSProviderLink) Validate

func (wpl *WorkspaceVCSProviderLink) Validate() error

Validate verifies a VCS Provider link struct.

Jump to

Keyboard shortcuts

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