util

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Step          = "step"
	Name          = "name"
	Namespace     = "namespace"
	Kind          = "kind"
	DependentName = "dependentName"
	DependentKind = "dependentKind"
)
View Source
const (
	AnnotationPrimaryXSUAA = "sme.sap.com/primary-xsuaa"
)
View Source
const LabelBTPApplicationIdentifierHash = "sme.sap.com/btp-app-identifier-hash"

Variables

This section is empty.

Functions

func CreateVCAPEntryFromSecret

func CreateVCAPEntryFromSecret(serviceInfo *v1alpha1.ServiceInfo, ns string, kubeClient kubernetes.Interface) (entry map[string]any, err error)

func GetConfig

func GetConfig() *rest.Config

func GetLogger added in v0.5.0

func GetLogger() logr.Logger

func GetNamespace

func GetNamespace() string

func GetXSUAAInfo

func GetXSUAAInfo(consumedServiceInfos []v1alpha1.ServiceInfo, ca *v1alpha1.CAPApplication) *v1alpha1.ServiceInfo

func LogError added in v0.7.0

func LogError(error error, msg string, step string, entity interface{}, child interface{}, args ...interface{})

func LogInfo added in v0.7.0

func LogInfo(msg string, step string, entity interface{}, child interface{}, args ...interface{})

func ParseJSON

func ParseJSON[T any](b []byte) (*T, error)

func ReadServiceCredentialsFromSecret

func ReadServiceCredentialsFromSecret[T any](serviceInfo *v1alpha1.ServiceInfo, ns string, kubeClient kubernetes.Interface) (*T, error)

Types

type CredentialData

type CredentialData struct {
	CredentialType        string `json:"credential-type"`
	ClientId              string `json:"clientid"`
	ClientSecret          string `json:"clientsecret"`
	AuthUrl               string `json:"url"`
	UAADomain             string `json:"uaadomain"`
	ServiceBrokerUrl      string `json:"sburl"`
	CertificateUrl        string `json:"certurl"`
	Certificate           string `json:"certificate"`
	CertificateKey        string `json:"key"`
	VerificationKey       string `json:"verificationkey"`
	CallbackTimeoutMillis string `json:"callbackTimeoutMillis"`
}

type MetadataPropertyDescriptor

type MetadataPropertyDescriptor struct {
	Name       string         `json:"name"`
	SourceName string         `json:"sourceName"`
	Format     PropertyFormat `json:"format"`
	Container  bool           `json:"container"`
}

type PropertyFormat

type PropertyFormat string
const (
	PropertyFormatText PropertyFormat = "text"
	PropertyFormatJSON PropertyFormat = "json"
)

type SaasRegistryCredentials

type SaasRegistryCredentials struct {
	CredentialData `json:",inline"`
	SaasManagerUrl string `json:"saas_registry_url"`
}

type SecretMetadata

type SecretMetadata struct {
	MetadataProperties   []MetadataPropertyDescriptor `json:"metaDataProperties"`
	CredentialProperties []MetadataPropertyDescriptor `json:"credentialProperties"`
}

See Kubernetes-Service-Bindings/doc

type VCAPServiceInstance

type VCAPServiceInstance struct {
	Name         string      `json:"name"` // this attribute holds the binding name if it exists, otherwise, instance name
	BindingGUID  string      `json:"binding_guid,omitempty"`
	BindingName  string      `json:"binding_name,omitempty"`
	InstanceGUID string      `json:"instance_guid,omitempty"`
	InstanceName string      `json:"instance_name,omitempty"`
	Label        string      `json:"label"`
	Plan         string      `json:"plan,omitempty"`
	Credentials  interface{} `json:"credentials"`
	Tags         []string    `json:"tags,omitempty"`
}

type XSUAACredentials

type XSUAACredentials struct {
	CredentialData        `json:",inline"`
	XSAppName             string `json:"xsappname"`
	TrusterClientIDSuffix string `json:"trustedclientidsuffix"`
}

Jump to

Keyboard shortcuts

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