management

package
v0.0.0-...-b7f4efd Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

+kubebuilder:object:generate=true

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// The bearer token used to authenticate against the API Management instance
	// (must be generated from an admin account)
	// +kubebuilder:validation:Optional
	BearerToken string `json:"bearerToken,omitempty"`
	// The Basic credentials used to authenticate against the API Management instance.
	Credentials *BasicAuth `json:"credentials,omitempty"`
	// A secret reference holding either a "bearerToken" key for bearer token authentication
	// or "username" and "password" keys for basic authentication
	SecretRef *refs.NamespacedName `json:"secretRef,omitempty"`
}

func (*Auth) DeepCopy

func (in *Auth) DeepCopy() *Auth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Auth.

func (*Auth) DeepCopyInto

func (in *Auth) DeepCopyInto(out *Auth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Auth) GetBearerToken

func (in *Auth) GetBearerToken() string

GetBearerToken implements custom.Auth.

func (*Auth) GetCredentials

func (in *Auth) GetCredentials() core.BasicAuth

GetCredentials implements custom.Auth.

func (*Auth) GetSecretRef

func (in *Auth) GetSecretRef() core.ObjectRef

GetSecretRef implements custom.Auth.

func (*Auth) HasCredentials

func (in *Auth) HasCredentials() bool

HasCredentials implements custom.Auth.

func (*Auth) SetCredentials

func (in *Auth) SetCredentials(username string, password string)

SetCredentials implements custom.Auth.

func (*Auth) SetSecretRef

func (in *Auth) SetSecretRef(ref core.ObjectRef)

SetSecretRef implements custom.Auth.

func (*Auth) SetToken

func (in *Auth) SetToken(token string)

SetToken implements custom.Auth.

type BasicAuth

type BasicAuth struct {
	// +kubebuilder:validation:Required
	Username string `json:"username,omitempty"`
	// +kubebuilder:validation:Required
	Password string `json:"password,omitempty"`
}

func (*BasicAuth) DeepCopy

func (in *BasicAuth) DeepCopy() *BasicAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth.

func (*BasicAuth) DeepCopyInto

func (in *BasicAuth) DeepCopyInto(out *BasicAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BasicAuth) GetPassword

func (in *BasicAuth) GetPassword() string

GetPassword implements custom.BasicAuth.

func (*BasicAuth) GetUsername

func (in *BasicAuth) GetUsername() string

GetUsername implements custom.BasicAuth.

type Cloud

type Cloud struct {
	// Token plain text Gravitee cloud token (JWT)
	// +kubebuilder:validation:Optional
	Token string `json:"token,omitempty"`
	// SecretRef secret reference holding the Gravitee cloud token in the "cloudToken" key
	// +kubebuilder:validation:Optional
	SecretRef *refs.NamespacedName `json:"secretRef,omitempty"`
}

func (*Cloud) DeepCopy

func (in *Cloud) DeepCopy() *Cloud

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cloud.

func (*Cloud) DeepCopyInto

func (in *Cloud) DeepCopyInto(out *Cloud)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Cloud) GetSecretRef

func (c *Cloud) GetSecretRef() core.ObjectRef

func (*Cloud) GetToken

func (c *Cloud) GetToken() string

func (*Cloud) HasSecretRef

func (c *Cloud) HasSecretRef() bool

func (*Cloud) IsEnabled

func (c *Cloud) IsEnabled() bool

type Context

type Context struct {
	// The URL of a management API instance.
	// This is optional when this context targets Gravitee Cloud otherwise it is required.
	// +kubebuilder:validation:Optional
	BaseUrl string `json:"baseUrl,omitempty"`
	// Allows to override the context path that will be appended to the baseURL.
	// This can be used when reverse proxying APIM with URL rewrite
	// +kubebuilder:validation:Optional
	Path *string `json:"path,omitempty"`
	// An existing organization id targeted by the context on the management API instance.
	// This is optional when this context targets Gravitee Cloud otherwise it is required.
	// +kubebuilder:validation:Optional
	OrgID string `json:"organizationId,omitempty"`
	// An existing environment id targeted by the context within the organization.
	// This is optional when this context targets Gravitee Cloud
	// and your cloud token contains only one environment ID, otherwise it is required.
	// +kubebuilder:validation:Optional
	EnvID string `json:"environmentId,omitempty"`
	// Auth defines the authentication method used to connect to the API Management.
	// Can be either basic authentication credentials, a bearer token
	// or a reference to a kubernetes secret holding one of these two configurations.
	// This is optional when this context targets Gravitee Cloud.
	Auth *Auth `json:"auth,omitempty"`
	// Cloud when set (token or secretRef) this context will target Gravitee Cloud.
	// BaseUrl will be defaulted from token data if not set,
	// Auth is defaulted to use the token (bearerToken),
	// OrgID is extracted from the token,
	// EnvID is defaulted when the token contains exactly one environment.
	Cloud *Cloud `json:"cloud,omitempty"`
}

func (*Context) ConfigureCloud

func (c *Context) ConfigureCloud(url string, orgID string, envID string)

func (*Context) DeepCopy

func (in *Context) DeepCopy() *Context

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Context.

func (*Context) DeepCopyInto

func (in *Context) DeepCopyInto(out *Context)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Context) GetAuth

func (c *Context) GetAuth() core.Auth

GetAuth implements custom.Context.

func (*Context) GetCloud

func (c *Context) GetCloud() core.Cloud

GetCloud implements custom.Context.

func (*Context) GetEnvID

func (c *Context) GetEnvID() string

GetEnvID implements custom.Context.

func (*Context) GetOrgID

func (c *Context) GetOrgID() string

GetOrgID implements custom.Context.

func (*Context) GetPath

func (c *Context) GetPath() *string

GetPath implements custom.Context.

func (*Context) GetSecretRef

func (c *Context) GetSecretRef() core.ObjectRef

GetSecretRef implements custom.Context.

func (*Context) GetURL

func (c *Context) GetURL() string

GetURL implements custom.Context.

func (*Context) HasAuthentication

func (c *Context) HasAuthentication() bool

func (*Context) HasCloud

func (c *Context) HasCloud() bool

HasCloud implements custom.Context.

func (*Context) HasSecretRef

func (c *Context) HasSecretRef() bool

func (*Context) SecretRef

func (c *Context) SecretRef() *refs.NamespacedName

func (*Context) SetCredentials

func (c *Context) SetCredentials(username, password string)

func (*Context) SetToken

func (c *Context) SetToken(token string)

Jump to

Keyboard shortcuts

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