projects

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package projects contains utilities for working with projects.

Index

Constants

View Source
const (
	// MinderMetadataVersion is the version of the metadata format.
	MinderMetadataVersion = "v1alpha1"
)

Variables

View Source
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 ProvisionSelfEnrolledProject

func ProvisionSelfEnrolledProject(
	ctx context.Context,
	authzClient authz.Client,
	qtx db.Querier,
	projectName string,
	userSub string,

	marketplace marketplaces.Marketplace,
	profilesCfg server.DefaultProfilesConfig,
) (outproj *pb.Project, projerr error)

ProvisionSelfEnrolledProject creates the default records, such as projects, roles and provider for the organization

func SerializeMetadata added in v0.0.36

func SerializeMetadata(meta *Metadata) ([]byte, error)

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

func NewSelfEnrolledMetadata(projectName string) Metadata

NewSelfEnrolledMetadata returns a new Metadata object with the SelfEnrolled field set to true.

func ParseMetadata added in v0.0.36

func ParseMetadata(proj *db.Project) (*Metadata, error)

ParseMetadata parses the given JSON data into a Metadata object.

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.

Directories

Path Synopsis
Package features provides the features checks for the projects
Package features provides the features checks for the projects

Jump to

Keyboard shortcuts

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