Documentation ¶
Index ¶
- Constants
- func NewTenantManager(storage TenantStorage, lmsClient TenantCreator, log logrus.FieldLogger) *manager
- type Client
- type ClusterType
- type Config
- type CreateTenantInput
- type CreateTenantOutput
- type Environment
- type FakeClient
- func (f *FakeClient) CreateTenant(input CreateTenantInput) (o CreateTenantOutput, err error)
- func (f *FakeClient) GetCACertificate(tenantID string) (cert string, found bool, err error)
- func (f *FakeClient) GetCertificateByURL(url string) (cert string, found bool, err error)
- func (f *FakeClient) GetTenantInfo(tenantID string) (status TenantInfo, err error)
- func (f *FakeClient) GetTenantStatus(tenantID string) (status TenantStatus, err error)
- func (f *FakeClient) IsCertRequestedForTenant(tenantID string) bool
- func (f *FakeClient) RequestCertificate(tenantID string, subj pkix.Name) (id string, privateKey []byte, err error)
- type TenantCreator
- type TenantInfo
- type TenantStatus
- type TenantStorage
Constants ¶
View Source
const ( EnvironmentDev Environment = "dev" EnvironmentProd Environment = "prod" ClusterTypeHA ClusterType = "ha" ClusterTypeSingleNode ClusterType = "single-node" )
View Source
const ( FakeCaCertificate = "cert-ca-payload" FakeSignedCertificate = "signed-cert-payload" FakeLmsHost = "lms.localhost" FakePrivateKey = "private-key" )
Variables ¶
This section is empty.
Functions ¶
func NewTenantManager ¶
func NewTenantManager(storage TenantStorage, lmsClient TenantCreator, log logrus.FieldLogger) *manager
Types ¶
type Client ¶
type Client interface { CreateTenant(input CreateTenantInput) (o CreateTenantOutput, err error) GetTenantStatus(tenantID string) (status TenantStatus, err error) GetTenantInfo(tenantID string) (status TenantInfo, err error) GetCACertificate(tenantID string) (cert string, found bool, err error) GetCertificateByURL(url string) (cert string, found bool, err error) RequestCertificate(tenantID string, subject pkix.Name) (string, []byte, error) }
type Config ¶
type Config struct { URL string // tenant predefined values ClusterType ClusterType // ha or single-node Environment Environment Token string SamlTenant string Region string `envconfig:"optional"` Disabled bool }
type CreateTenantInput ¶
type CreateTenantOutput ¶
type CreateTenantOutput struct {
ID string `json:"id"`
}
type Environment ¶
type Environment string
type FakeClient ¶
type FakeClient struct {
// contains filtered or unexported fields
}
FakeClient implements the lms client interface but does not call real external system
func NewFakeClient ¶
func NewFakeClient(timeToReady time.Duration) *FakeClient
NewFakeClient creates lms fake client which response tenant ready after timeToReady duration
func (*FakeClient) CreateTenant ¶
func (f *FakeClient) CreateTenant(input CreateTenantInput) (o CreateTenantOutput, err error)
func (*FakeClient) GetCACertificate ¶
func (f *FakeClient) GetCACertificate(tenantID string) (cert string, found bool, err error)
func (*FakeClient) GetCertificateByURL ¶
func (f *FakeClient) GetCertificateByURL(url string) (cert string, found bool, err error)
func (*FakeClient) GetTenantInfo ¶
func (f *FakeClient) GetTenantInfo(tenantID string) (status TenantInfo, err error)
func (*FakeClient) GetTenantStatus ¶
func (f *FakeClient) GetTenantStatus(tenantID string) (status TenantStatus, err error)
func (*FakeClient) IsCertRequestedForTenant ¶
func (f *FakeClient) IsCertRequestedForTenant(tenantID string) bool
assert methods
func (*FakeClient) RequestCertificate ¶
type TenantCreator ¶
type TenantCreator interface {
CreateTenant(input CreateTenantInput) (o CreateTenantOutput, err error)
}
type TenantInfo ¶
type TenantStatus ¶
Click to show internal directories.
Click to hide internal directories.