util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationPrimaryXSUAA = "sme.sap.com/primary-xsuaa"
)

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 GetNamespace

func GetNamespace() string

func GetXSUAAInfo

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

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