service

package
v0.97.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Auth paths
	AuthLoginPath    = "/auth/login"
	AuthCallbackPath = "/auth/callback"
)

The authentication process does the following 1 - Authenticate against a valid OIDC provider, currently only Google is supported 2 - Generate a chainloop signed JWT to be sent to the client

View Source
const (
	// PrometheusMetricsPath is the path for the Prometheus metrics
	PrometheusMetricsPath = "/prom/{org_name}/metrics"
)

Variables

ProviderSet is service providers.

Functions

This section is empty.

Types

type APITokenService added in v0.55.0

type APITokenService struct {
	pb.UnimplementedAPITokenServiceServer

	APITokenUseCase *biz.APITokenUseCase
	// contains filtered or unexported fields
}

func NewAPITokenService added in v0.55.0

func NewAPITokenService(uc *biz.APITokenUseCase, opts ...NewOpt) *APITokenService

func (*APITokenService) Create added in v0.55.0

func (*APITokenService) List added in v0.55.0

func (*APITokenService) Revoke added in v0.55.0

type AttestationService

type AttestationService struct {
	cpAPI.UnimplementedAttestationServiceServer
	// contains filtered or unexported fields
}

func NewAttestationService

func NewAttestationService(opts *NewAttestationServiceOpts) *AttestationService

func (*AttestationService) FindOrCreateWorkflow added in v0.97.0

func (*AttestationService) GetPolicy added in v0.95.7

func (*AttestationService) GetPolicyGroup added in v0.96.14

func (*AttestationService) GetUploadCreds

There is another endpoint to get credentials via casCredentialsService.Get This one is kept since it leverages robot-accounts in the context of a workflow

type AttestationStateService added in v0.60.0

type AttestationStateService struct {
	cpAPI.UnimplementedAttestationStateServiceServer
	// contains filtered or unexported fields
}

func NewAttestationStateService added in v0.60.0

func NewAttestationStateService(opts *NewAttestationStateServiceOpt) *AttestationStateService

func (*AttestationStateService) Read added in v0.60.0

func (*AttestationStateService) Reset added in v0.60.0

func (*AttestationStateService) Save added in v0.60.0

type AuthService

type AuthService struct {
	pb.UnimplementedAuthServiceServer

	AuthURLs *AuthURLs
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService(userUC *biz.UserUseCase, orgUC *biz.OrganizationUseCase, mUC *biz.MembershipUseCase, inviteUC *biz.OrgInvitationUseCase, authConfig *conf.Auth, serverConfig *conf.Server, opts ...NewOpt) (*AuthService, error)

func (*AuthService) DeleteAccount

DeleteAccount deletes an account

func (*AuthService) RegisterCallbackHandler

func (svc *AuthService) RegisterCallbackHandler() http.Handler

func (*AuthService) RegisterLoginHandler

func (svc *AuthService) RegisterLoginHandler() http.Handler

type AuthURLs

type AuthURLs struct {
	Login string
	// contains filtered or unexported fields
}

type CASBackendService added in v0.14.0

type CASBackendService struct {
	pb.UnimplementedCASBackendServiceServer
	// contains filtered or unexported fields
}

func NewCASBackendService added in v0.14.0

func NewCASBackendService(uc *biz.CASBackendUseCase, providers backend.Providers, opts ...NewOpt) *CASBackendService

func (*CASBackendService) Create added in v0.14.0

func (*CASBackendService) Delete added in v0.14.0

Delete the CAS backend

func (*CASBackendService) List added in v0.14.0

func (*CASBackendService) Update added in v0.14.0

type CASCredentialsService

type CASCredentialsService struct {
	pb.UnimplementedCASCredentialsServiceServer
	// contains filtered or unexported fields
}

func NewCASCredentialsService

func NewCASCredentialsService(casUC *biz.CASCredentialsUseCase, casmUC *biz.CASMappingUseCase, casBUC *biz.CASBackendUseCase, authz *authz.Enforcer, opts ...NewOpt) *CASCredentialsService

func (*CASCredentialsService) Get

Get will generate temporary credentials to be used against the CAS service for the current organization

type CASRedirectService added in v0.16.0

type CASRedirectService struct {
	pb.UnimplementedCASRedirectServiceServer
	// contains filtered or unexported fields
}

func NewCASRedirectService added in v0.16.0

func NewCASRedirectService(casmUC *biz.CASMappingUseCase, casCredsUC *biz.CASCredentialsUseCase, conf *conf.Bootstrap_CASServer, opts ...NewOpt) (*CASRedirectService, error)

func (*CASRedirectService) GetDownloadURL added in v0.16.0

GetDownloadURL returns a signed URL to download the artifact from the CAS backend The URL includes a JWT token that is used to authenticate the request, this token has all the information required to validate the request The result would look like "https://cas.chainloop.dev/download/sha256:[DIGEST]?t=tokenJWT

func (*CASRedirectService) HTTPDownload added in v0.16.0

func (s *CASRedirectService) HTTPDownload(ctx khttp.Context) error

Custom HTTP handler that handles redirect to the CAS download URL This handler does 1 - Force the user to do an oauth login dance 2 - calls GetDownloadURL to generate a proper URL 3 - redirects to the generated URL NOTE: This code is similar to the one that gets autogenerated if we happened to use proto.http but we can't use it because we need custom redirection

type ContextService

type ContextService struct {
	pb.UnimplementedContextServiceServer
	// contains filtered or unexported fields
}

func NewContextService

func NewContextService(repoUC *biz.CASBackendUseCase, uUC *biz.UserUseCase, opts ...NewOpt) *ContextService

type IntegrationsService

type IntegrationsService struct {
	pb.UnimplementedIntegrationsServiceServer
	// contains filtered or unexported fields
}

func NewIntegrationsService

func NewIntegrationsService(uc *biz.IntegrationUseCase, wuc *biz.WorkflowUseCase, integrations sdk.AvailablePlugins, opts ...NewOpt) *IntegrationsService

func (*IntegrationsService) Deregister added in v0.11.1

func (*IntegrationsService) ListAttachments

func (*IntegrationsService) ListAvailable added in v0.11.1

func (*IntegrationsService) Register added in v0.11.1

type NewAttestationServiceOpts

type NewAttestationServiceOpts struct {
	WorkflowRunUC      *biz.WorkflowRunUseCase
	WorkflowUC         *biz.WorkflowUseCase
	WorkflowContractUC *biz.WorkflowContractUseCase
	OCIUC              *biz.CASBackendUseCase
	CredsReader        credentials.Reader
	IntegrationUseCase *biz.IntegrationUseCase
	CasCredsUseCase    *biz.CASCredentialsUseCase
	AttestationUC      *biz.AttestationUseCase
	FanoutDispatcher   *dispatcher.FanOutDispatcher
	CASMappingUseCase  *biz.CASMappingUseCase
	ReferrerUC         *biz.ReferrerUseCase
	OrgUC              *biz.OrganizationUseCase
	PromUC             *biz.PrometheusUseCase
	Opts               []NewOpt
}

type NewAttestationStateServiceOpt added in v0.90.0

type NewAttestationStateServiceOpt struct {
	AttestationStateUseCase *biz.AttestationStateUseCase
	WorkflowUseCase         *biz.WorkflowUseCase
	WorkflowRunUseCase      *biz.WorkflowRunUseCase
	Opts                    []NewOpt
}

type NewOpt

type NewOpt func(s *service)

func WithLogger

func WithLogger(logger log.Logger) NewOpt

type NewWorkflowRunServiceOpts

type NewWorkflowRunServiceOpts struct {
	WorkflowRunUC      *biz.WorkflowRunUseCase
	WorkflowUC         *biz.WorkflowUseCase
	WorkflowContractUC *biz.WorkflowContractUseCase
	CredsReader        credentials.Reader
	Opts               []NewOpt
}

type OrgInvitationService added in v0.25.0

type OrgInvitationService struct {
	pb.UnimplementedOrgInvitationServiceServer
	// contains filtered or unexported fields
}

func NewOrgInvitationService added in v0.25.0

func NewOrgInvitationService(uc *biz.OrgInvitationUseCase, opts ...NewOpt) *OrgInvitationService

func (*OrgInvitationService) Create added in v0.25.0

func (*OrgInvitationService) ListSent added in v0.25.0

func (*OrgInvitationService) Revoke added in v0.25.0

type OrgMetricsService

type OrgMetricsService struct {
	pb.UnimplementedOrgMetricsServiceServer
	// contains filtered or unexported fields
}

func NewOrgMetricsService

func NewOrgMetricsService(uc *biz.OrgMetricsUseCase, opts ...NewOpt) *OrgMetricsService

func (*OrgMetricsService) DailyRunsCount added in v0.80.0

func (*OrgMetricsService) TopWorkflowsByRunsCount

type OrganizationService

type OrganizationService struct {
	pb.UnimplementedOrganizationServiceServer
	// contains filtered or unexported fields
}

func NewOrganizationService

func NewOrganizationService(muc *biz.MembershipUseCase, ouc *biz.OrganizationUseCase, opts ...NewOpt) *OrganizationService

func (*OrganizationService) Create added in v0.50.0

Create persists an organization with a given name and associate it to the current user.

func (*OrganizationService) DeleteMembership added in v0.50.0

func (*OrganizationService) UpdateMembership added in v0.75.0

type PrometheusService added in v0.94.0

type PrometheusService struct {
	// contains filtered or unexported fields
}

PrometheusService is the prometheus service

func NewPrometheusService added in v0.94.0

func NewPrometheusService(orgUseCase *biz.OrganizationUseCase, prometheusUseCase *biz.PrometheusUseCase, opts ...NewOpt) *PrometheusService

NewPrometheusService creates a new prometheus service

func (*PrometheusService) ServeHTTP added in v0.94.0

func (p *PrometheusService) ServeHTTP(w http.ResponseWriter, r *http.Request)

MetricsRequestHandler is the handler for the metrics request. It fetches the Prometheus registry and if found, retrieves all metrics in Prometheus format.

type ReferrerService added in v0.30.0

type ReferrerService struct {
	pb.UnimplementedReferrerServiceServer
	// contains filtered or unexported fields
}

func NewReferrerService added in v0.30.0

func NewReferrerService(uc *biz.ReferrerUseCase, opts ...NewOpt) *ReferrerService

func (*ReferrerService) DiscoverPrivate added in v0.40.0

func (*ReferrerService) DiscoverPublicShared added in v0.40.0

type RobotAccountService

type RobotAccountService struct {
	pb.UnimplementedRobotAccountServiceServer
	// contains filtered or unexported fields
}

func NewRobotAccountService

func NewRobotAccountService(uc *biz.RobotAccountUseCase, opts ...NewOpt) *RobotAccountService

type SigningService added in v0.90.0

type SigningService struct {
	v1.UnimplementedSigningServiceServer
	// contains filtered or unexported fields
}

func NewSigningService added in v0.90.0

func NewSigningService(signing *biz.SigningUseCase, opts ...NewOpt) *SigningService

func (*SigningService) GenerateSigningCert added in v0.90.0

type StatusService

type StatusService struct {
	pb.UnimplementedStatusServiceServer
	// contains filtered or unexported fields
}

func NewStatusService

func NewStatusService(logingURL, version string, casClient *biz.CASClientUseCase) *StatusService

func (*StatusService) Infoz

func (*StatusService) Statusz

Only on readiness probes we check this service external dependencies

type UserService added in v0.75.0

type UserService struct {
	pb.UnimplementedUserServiceServer
	// contains filtered or unexported fields
}

func NewUserService added in v0.75.0

func NewUserService(muc *biz.MembershipUseCase, ouc *biz.OrganizationUseCase, opts ...NewOpt) *UserService

func (*UserService) DeleteMembership added in v0.75.0

func (*UserService) ListMemberships added in v0.75.0

func (*UserService) SetCurrentMembership added in v0.75.0

type WorkflowRunService

type WorkflowRunService struct {
	pb.UnimplementedWorkflowRunServiceServer
	// contains filtered or unexported fields
}

func NewWorkflowRunService

func NewWorkflowRunService(opts *NewWorkflowRunServiceOpts) *WorkflowRunService

type WorkflowService

type WorkflowService struct {
	pb.UnimplementedWorkflowServiceServer
	// contains filtered or unexported fields
}

func NewWorkflowService

func NewWorkflowService(uc *biz.WorkflowUseCase, wfuc *biz.WorkflowContractUseCase, opts ...NewOpt) *WorkflowService

func (*WorkflowService) Update added in v0.40.0

func (*WorkflowService) View added in v0.80.0

Jump to

Keyboard shortcuts

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