providers

package
v0.0.74 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 21 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

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

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

func DBToPBType

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

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

func GetCredentialStateForProvider

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

func ListProviderClasses() []string

ListProviderClasses returns a list of provider classes.

Types

type ErrProviderInvalidConfig

type ErrProviderInvalidConfig struct {
	Details string
}

ErrProviderInvalidConfig is an error type which is returned when a provider configuration is invalid

func NewErrProviderInvalidConfig

func NewErrProviderInvalidConfig(details string) ErrProviderInvalidConfig

NewErrProviderInvalidConfig returns a new instance of ErrProviderInvalidConfig with details about the invalid configuration. This is meant for user-facing errors so that the only thing displayed to the user is the details of the error.

func (ErrProviderInvalidConfig) Error

func (e ErrProviderInvalidConfig) Error() string

type ErrProviderNotFoundBy

type ErrProviderNotFoundBy struct {
	Name  string
	Trait string
}

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

func (ErrProviderNotFoundBy) Error

func (e ErrProviderNotFoundBy) Error() string

type ProviderClassDefinition

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

ProviderClassDefinition contains the static fields needed when creating a provider

func GetProviderClassDefinition

func GetProviderClassDefinition(class string) (ProviderClassDefinition, error)

GetProviderClassDefinition returns the provider definition for the given provider class

type ProviderStore

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
	// Update updates the provider configuration in the database
	Update(ctx context.Context, providerID uuid.UUID, projectID uuid.UUID, config json.RawMessage) error
}

ProviderStore provides methods for retrieving Providers from the database

func NewProviderStore

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
git
Package git provides a client for interacting with Git providers
Package git provides a client for interacting with Git providers
memboxfs
Package memboxfs provides a billy.Fs-compatible filesystem implementation which limits the maxiumum size of the in-memory filesystem.
Package memboxfs provides a billy.Fs-compatible filesystem implementation which limits the maxiumum size of the in-memory filesystem.
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.
properties
Package properties provides utility functions for fetching and managing properties
Package properties provides utility functions for fetching and managing properties
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.
webhook
Package webhook implements github webhook handlers for the github provider
Package webhook implements github webhook handlers for the github provider
Package gitlab provides the GitLab OAuth provider implementation
Package gitlab provides the GitLab OAuth provider implementation
manager
Package manager contains the GitLabProviderClassManager
Package manager contains the GitLabProviderClassManager
webhooksecret
Package webhooksecret provides a way to generate and verify secrets for GitLab webhooks.
Package webhooksecret provides a way to generate and verify secrets for GitLab webhooks.
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 noop provides a no-op provider implementation.
Package noop provides a no-op provider implementation.
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 selectors provides the conversion of entities to SelectorEntities
Package selectors provides the conversion of entities to SelectorEntities
Package session contains the business logic for creating providers from session state.
Package session contains the business logic for creating providers from session state.
mock
Package mock_session is a generated GoMock package.
Package mock_session 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
Package testproviders provides test implementations of the provider interfaces.
Package testproviders provides test implementations of the provider interfaces.

Jump to

Keyboard shortcuts

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