Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphqlClient ¶
type GraphqlData ¶
type GraphqlData struct {
TenantInfo TenantResponse
}
type TenantIdReader ¶
type TenantResponse ¶
type TenantResponse struct {
TenantId string
}
type TenantRetriever ¶
TenantRetriever Retrieves a tenant by a issuer/audiences from the context. It uses the iam service's graphql endpoint. The responses are cached in memory because tenant mappings do not change frequently It uses the tenantInfo query internally.
type TenantRetrieverService ¶
type TenantRetrieverService struct {
// contains filtered or unexported fields
}
func NewCustomTenantRetriever ¶
func NewCustomTenantRetriever(tr TenantIdReader) *TenantRetrieverService
NewCustomTenantRetriever Creates a tenant retriever that has a custom implementation of the TenantIdReader interface. The result of the reader will be cached. A local and a graphql tenant Reader are already contained in this package.
func NewLocalTenantRetriever ¶
func NewLocalTenantRetriever(tenantId string) *TenantRetrieverService
NewLocalTenantRetriever Creates a Tenant reader that returns a hardcoded tenant id for local testing. The idea is to use a tenant id that can be set to the environment, so you do not need an iam service running locally
func NewTenantRetriever ¶
func NewTenantRetriever(ctx context.Context, iamUrl string, timeout *time.Duration) *TenantRetrieverService
NewTenantRetriever Creates a retriever to get tenant ids from the iam service. The iamUrl parameter should be the graphql endpoint of the iam-service.
func (*TenantRetrieverService) RetrieveOrAdd ¶
func (*TenantRetrieverService) RetrieveTenant ¶
func (tenantRetriever *TenantRetrieverService) RetrieveTenant(ctx context.Context) (string, error)