federationmgmt

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FederationTypeProvider = "provider"
	FederationTypeConsumer = "consumer"
)
View Source
const (
	ApiRoot      = "operatorplatform/federation/v1"
	CallbackRoot = "operatorplatform/fedcallbacks/v1"

	// callback urls, used by both MC and FRM
	PartnerStatusEventPath           = CallbackRoot + "/onPartnerStatusEvent"
	PartnerZoneResourceUpdatePath    = CallbackRoot + "/onZoneResourceUpdateEvent"
	PartnerAppOnboardStatusEventPath = CallbackRoot + "/onApplicationOnboardStatusEvent"
	PartnerInstanceStatusEventPath   = CallbackRoot + "/onInstanceStatusEvent"
	PartnerResourceStatusChangePath  = CallbackRoot + "/onResourceStatusChangeEvent"

	PathVarAppInstUniqueId = "appInstUniqueId"

	CallbackNotSupported  = "NOT_SUPPORTED"
	NoCallbackApiKey      = "NO_CALLBACK_API_KEY"
	NoCallbackApiKeyError = "no callback API key"
)

Variables

This section is empty.

Functions

func DeleteAPIKeyFromVault

func DeleteAPIKeyFromVault(ctx context.Context, vaultConfig *vault.Config, fedKey *FedKey) error

func GetFedApiKeyUser

func GetFedApiKeyUser(ownerType string, id uint) string

Get the username to associate with the api key. The username uniquely identifies the federation provider or consumer, so we can lookup the provider/consumer based on the username.

func ParseFedKeyUser

func ParseFedKeyUser(username string) (string, uint, error)

func PathCreateAppInst

func PathCreateAppInst(fedCtxId string) (string, string)

func PathGetAppInst

func PathGetAppInst(fedCtxId, appId, appInstId, zoneId string) (string, string)

func PutAPIKeyToVault

func PutAPIKeyToVault(ctx context.Context, vaultConfig *vault.Config, fedKey *FedKey, apiKey *ApiKey) error

Types

type ApiKey

type ApiKey struct {
	Id       string `json:"id"`
	Key      string `json:"key"`
	TokenUrl string `json:"tokenurl"`
}

func GetFederationAPIKey

func GetFederationAPIKey(ctx context.Context, vaultConfig *vault.Config, fedKey *FedKey) (*ApiKey, error)

type FedKey

type FedKey struct {
	OperatorId string
	Name       string
	FedType    string
	ID         uint
}

FedKey uniquely identifies a federation provider or consumer. We include the ID generated by postgres to avoid aliasing in caches if a provider is deleted and recreated with the same name.

Jump to

Keyboard shortcuts

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