Documentation
¶
Overview ¶
Package projects contains utilities for working with projects.
Index ¶
- Constants
- Variables
- func CleanUpUnmanagedProjects(ctx context.Context, proj uuid.UUID, querier db.Querier, ...) error
- func DeleteProject(ctx context.Context, proj uuid.UUID, querier db.Querier, ...) error
- func ProvisionSelfEnrolledOAuthProject(ctx context.Context, authzClient authz.Client, qtx db.Querier, ...) (outproj *db.Project, projerr error)
- func ProvisionSelfEnrolledProject(ctx context.Context, authzClient authz.Client, qtx db.Querier, ...) (outproj *db.Project, projerr error)
- func SerializeMetadata(meta *Metadata) ([]byte, error)
- type Metadata
- type PublicMetadataV1
Constants ¶
const (
// MinderMetadataVersion is the version of the metadata format.
MinderMetadataVersion = "v1alpha1"
)
Variables ¶
var ( // ErrProjectAlreadyExists is returned when a project with the same name already exists ErrProjectAlreadyExists = errors.New("project already exists") )
Functions ¶
func CleanUpUnmanagedProjects ¶
func CleanUpUnmanagedProjects( ctx context.Context, proj uuid.UUID, querier db.Querier, authzClient authz.Client, l zerolog.Logger, ) error
CleanUpUnmanagedProjects deletes a project if it has no role assignments left
func DeleteProject ¶
func DeleteProject(ctx context.Context, proj uuid.UUID, querier db.Querier, authzClient authz.Client, l zerolog.Logger) error
DeleteProject deletes a project and authorization relationships
func ProvisionSelfEnrolledOAuthProject ¶ added in v0.0.39
func ProvisionSelfEnrolledOAuthProject( ctx context.Context, authzClient authz.Client, qtx db.Querier, projectName string, userSub string, marketplace marketplaces.Marketplace, profilesCfg server.DefaultProfilesConfig, ) (outproj *db.Project, projerr error)
ProvisionSelfEnrolledOAuthProject creates the default records, such as projects, roles and provider for the organization
func ProvisionSelfEnrolledProject ¶
func ProvisionSelfEnrolledProject( ctx context.Context, authzClient authz.Client, qtx db.Querier, projectName string, userSub string, marketplace marketplaces.Marketplace, profilesCfg server.DefaultProfilesConfig, ) (outproj *db.Project, projerr error)
ProvisionSelfEnrolledProject creates the core default components of the project (project, marketplace subscriptions, etc.) but *does not* create a project.
func SerializeMetadata ¶ added in v0.0.36
SerializeMetadata serializes the given Metadata object into JSON.
Types ¶
type Metadata ¶
type Metadata struct {
Version string `json:"version"`
SelfEnrolled bool `json:"self_enrolled"`
// This will be deprecated in favor of PublicMetadataV1.
Description string `json:"description"`
// Public is a field that is meant to be read by other systems.
// It will be exposed to the public, e.g. via a UI.
Public PublicMetadataV1 `json:"public"`
}
Metadata contains metadata relevant for a project.
func NewSelfEnrolledMetadata ¶
NewSelfEnrolledMetadata returns a new Metadata object with the SelfEnrolled field set to true.
type PublicMetadataV1 ¶ added in v0.0.36
type PublicMetadataV1 struct {
Description string `json:"description"`
DisplayName string `json:"display_name"`
}
PublicMetadataV1 contains public metadata relevant for a project.