providers

package
v0.0.51 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package providers contains general utilities for interacting with providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBToPBAuthFlow added in v0.0.35

func DBToPBAuthFlow(t db.AuthorizationFlow) (minderv1.AuthorizationFlow, bool)

DBToPBAuthFlow converts a database authorization flow to a protobuf authorization flow.

func DBToPBType added in v0.0.30

func DBToPBType(t db.ProviderType) (minderv1.ProviderType, bool)

DBToPBType converts a database provider type to a protobuf provider type.

func GetCredentialStateForProvider added in v0.0.37

func GetCredentialStateForProvider(
	ctx context.Context,
	prov db.Provider,
	s db.Store,
	cryptoEngine crypto.Engine,
	provCfg *serverconfig.ProviderConfig,
) (string, error)

GetCredentialStateForProvider returns the credential state for the given provider.

func ListProviderClasses added in v0.0.38

func ListProviderClasses() []string

ListProviderClasses returns a list of provider classes.

Types

type ErrProviderNotFoundBy added in v0.0.43

type ErrProviderNotFoundBy struct {
	Name  string
	Trait string
}

ErrProviderNotFoundBy is an error type which is returned when a provider is not found

func (ErrProviderNotFoundBy) Error added in v0.0.43

func (e ErrProviderNotFoundBy) Error() string

type ProviderClassDefinition added in v0.0.38

type ProviderClassDefinition struct {
	Traits             []db.ProviderType
	AuthorizationFlows []db.AuthorizationFlow
}

ProviderClassDefinition contains the static fields needed when creating a provider

func GetProviderClassDefinition added in v0.0.38

func GetProviderClassDefinition(class string) (ProviderClassDefinition, error)

GetProviderClassDefinition returns the provider definition for the given provider class

type ProviderStore added in v0.0.39

type ProviderStore interface {
	// Create creates a new provider in the database
	Create(
		ctx context.Context, providerClass db.ProviderClass, name string, projectID uuid.UUID, config json.RawMessage,
	) (*db.Provider, error)
	// GetByID returns the provider identified by its UUID primary key.
	// This should only be used in places when it is certain that the requester
	// is authorized to access this provider.
	GetByID(ctx context.Context, providerID uuid.UUID) (*db.Provider, error)
	// GetByIDProject returns the provider identified by its UUID primary key.
	// ProjectID is also used in the query to prevent unauthorized access
	// when used in API endpoints
	GetByIDProject(ctx context.Context, providerID uuid.UUID, projectID uuid.UUID) (*db.Provider, error)
	// GetByName returns the provider instance in the database as
	// identified by its project ID and name. All parent projects of the
	// specified project are included in the search.
	GetByName(ctx context.Context, projectID uuid.UUID, name string) (*db.Provider, error)
	// GetByNameInSpecificProject returns the provider instance in the database as
	// identified by its project ID and name. Unlike `GetByName` it will only
	// search in the specified project, and ignore the project hierarchy.
	GetByNameInSpecificProject(ctx context.Context, projectID uuid.UUID, name string) (*db.Provider, error)
	// GetByTraitInHierarchy returns the providers in the project which match the
	// specified trait. All parent projects of the specified project are
	// included in the search. The providers are optionally filtered by name.
	// Note that if error is nil, there will always be at least one element
	// in the list of providers which is returned.
	GetByTraitInHierarchy(
		ctx context.Context,
		projectID uuid.UUID,
		name string,
		trait db.ProviderType,
	) ([]db.Provider, error)
	// Delete removes the provider configuration from the database
	Delete(ctx context.Context, providerID uuid.UUID, projectID uuid.UUID) error
}

ProviderStore provides methods for retrieving Providers from the database

func NewProviderStore added in v0.0.39

func NewProviderStore(store db.Store) ProviderStore

NewProviderStore returns a new instance of ProviderStore.

Directories

Path Synopsis
Package artifact provides functions and utilities for artifact providers
Package artifact provides functions and utilities for artifact providers
Package credentials provides the implementations for the credentials
Package credentials provides the implementations for the credentials
Package dockerhub provides a client for interacting with Docker Hub
Package dockerhub provides a client for interacting with Docker Hub
Package git provides a client for interacting with Git providers
Package git provides a client for interacting with Git providers
Package github provides a client for interacting with the GitHub API
Package github provides a client for interacting with the GitHub API
clients
Package clients contains github client logic
Package clients contains github client logic
clients/mock
Package mock_clients is a generated GoMock package.
Package mock_clients is a generated GoMock package.
common
Package common provides common utilities for the GitHub provider
Package common provides common utilities for the GitHub provider
ghcr
Package ghcr provides a client for interacting with the GitHub Container Registry
Package ghcr provides a client for interacting with the GitHub Container Registry
installations
Package installations contains logic relating to GitHub provider installations
Package installations contains logic relating to GitHub provider installations
manager
Package manager contains the GitHubProviderClassManager
Package manager contains the GitHubProviderClassManager
mock
Package mock_github is a generated GoMock package.
Package mock_github is a generated GoMock package.
mock/fixtures
Package fixtures contains code for creating ProfileService fixtures and is used in various parts of the code.
Package fixtures contains code for creating ProfileService fixtures and is used in various parts of the code.
service
Package service contains the GitHubProviderService
Package service contains the GitHubProviderService
service/mock
Package mock_service is a generated GoMock package.
Package mock_service is a generated GoMock package.
Package http implements an HTTP client for interacting with an HTTP API.
Package http implements an HTTP client for interacting with an HTTP API.
Package manager contains logic for creating Provider instances
Package manager contains logic for creating Provider instances
mock
Package mock_manager is a generated GoMock package.
Package mock_manager is a generated GoMock package.
mock/fixtures
Package fixtures contains code for creating ProfileService fixtures and is used in various parts of the code.
Package fixtures contains code for creating ProfileService fixtures and is used in various parts of the code.
Package mock_providers is a generated GoMock package.
Package mock_providers is a generated GoMock package.
fixtures
Package fixtures contains code for creating ProviderStore fixtures and is used in various parts of the code.
Package fixtures contains code for creating ProviderStore fixtures and is used in various parts of the code.
Package oci provides a client for interacting with OCI registries
Package oci provides a client for interacting with OCI registries
Package ratecache provides a cache for the REST clients
Package ratecache provides a cache for the REST clients
mock
Package mock_ratecache is a generated GoMock package.
Package mock_ratecache is a generated GoMock package.
Package telemetry provides the telemetry interfaces and implementations for providers
Package telemetry provides the telemetry interfaces and implementations for providers

Jump to

Keyboard shortcuts

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