service

package
v0.0.0-...-81cdc2d Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyTypeForPCKS1 = "PKCS#1"
	KeyTypeForPCKS8 = "PKCS#8"
)
View Source
const (
	GroupKuscia = "kuscia"
)

Variables

This section is empty.

Functions

func InitServiceHolder

func InitServiceHolder(config *cmconfig.ConfManagerConfig) error

Types

type CertConfig

type CertConfig struct {
	CertValue  *atomic.Value
	PrivateKey *rsa.PrivateKey
}

type Holder

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

func (*Holder) CertificateService

func (s *Holder) CertificateService() ICertificateService

CertificateService exports CertificateService instance.

func (*Holder) ConfigurationService

func (s *Holder) ConfigurationService() IConfigurationService

ConfigurationService exports ConfigurationService instance.

func (*Holder) Ready

func (s *Holder) Ready() bool

Ready means whether holder available.

type HolderExporter

type HolderExporter interface {
	ConfigurationService() IConfigurationService
	CertificateService() ICertificateService
	Ready() bool
}
var Exporter HolderExporter = &serviceHolderInstance

type ICertificateService

type ICertificateService interface {
	// ValidateGenerateKeyCertsRequest check request.
	ValidateGenerateKeyCertsRequest(ctx context.Context, request *confmanager.GenerateKeyCertsRequest) *errorcode.Errs
	// GenerateKeyCerts create a pair of x509 key and cert with domain ca cert.
	GenerateKeyCerts(context.Context, *confmanager.GenerateKeyCertsRequest) *confmanager.GenerateKeyCertsResponse
}

ICertificateService is service which manager x509 keys and certificates. It can be used by grpc-mtls/https/process-call.

func NewCertificateService

func NewCertificateService(config CertConfig) (ICertificateService, error)

type IConfigurationService

type IConfigurationService interface {
	// CreateConfiguration create a configuration with confID/content/cn.
	CreateConfiguration(context.Context, *confmanager.CreateConfigurationRequest, string) confmanager.CreateConfigurationResponse
	// QueryConfiguration query a configuration with confIDs/cn.
	QueryConfiguration(context.Context, *confmanager.QueryConfigurationRequest, string) confmanager.QueryConfigurationResponse
}

IConfigurationService is service which manager conf from/to secret backend. It can be used by grpc-mtls/https/process-call.

func NewConfigurationService

func NewConfigurationService(backend secretbackend.SecretDriver, enableAuth bool) (IConfigurationService, error)

Jump to

Keyboard shortcuts

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