Documentation ¶
Index ¶
- Constants
- type ACLConfig
- type BasicAuthPluginConfig
- type DoRequest
- type DocumentObject
- type DocumentObjects
- type KeyAuthPluginConfig
- type KongAPIClient
- type KongClient
- func (k KongClient) AddConsumerACL(ctx context.Context, id string) error
- func (k KongClient) AddQuota(ctx context.Context, routeID, managedAppID, quotaInterval string, ...) error
- func (k KongClient) AddRouteACL(ctx context.Context, routeID, allowedID string) error
- func (k KongClient) CreateAuthKey(ctx context.Context, consumerID string, keyAuth *klib.KeyAuth) (*klib.KeyAuth, error)
- func (k KongClient) CreateConsumer(ctx context.Context, id, name string) (*klib.Consumer, error)
- func (k KongClient) CreateHttpBasic(ctx context.Context, consumerID string, basicAuth *klib.BasicAuth) (*klib.BasicAuth, error)
- func (k KongClient) CreateOauth2(ctx context.Context, consumerID string, oauth2 *klib.Oauth2Credential) (*klib.Oauth2Credential, error)
- func (k KongClient) DeleteAuthKey(ctx context.Context, consumerID, authKey string) error
- func (k KongClient) DeleteConsumer(ctx context.Context, id string) error
- func (k KongClient) DeleteHttpBasic(ctx context.Context, consumerID, username string) error
- func (k KongClient) DeleteOauth2(ctx context.Context, consumerID, clientID string) error
- func (k KongClient) GetKongPlugins() *Plugins
- func (k KongClient) GetSpecForService(ctx context.Context, service *klib.Service) ([]byte, error)
- func (k KongClient) ListRoutesForService(ctx context.Context, serviceId string) ([]*klib.Route, error)
- func (k KongClient) ListServices(ctx context.Context) ([]*klib.Service, error)
- func (k KongClient) RemoveRouteACL(ctx context.Context, routeID, revokedID string) error
- type KongServiceSpec
- type OAuthPluginConfig
- type PluginLister
- type Plugins
Constants ¶
View Source
const ( BasicAuthPlugin = "basic-auth" KeyAuthPlugin = "key-auth" OAuthPlugin = "oauth2" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuthPluginConfig ¶ added in v1.0.2
type BasicAuthPluginConfig struct { Anonymous string `json:"anonymous,omitempty"` HideCredentials bool `json:"hide_credentials,omitempty"` }
func NewBasicAuthPluginConfigFromMap ¶ added in v1.0.2
func NewBasicAuthPluginConfigFromMap(mapData map[string]interface{}) (*BasicAuthPluginConfig, error)
type DocumentObject ¶
type DocumentObjects ¶
type DocumentObjects struct { Data []DocumentObject `json:"data,omitempty"` Next string `json:"next,omitempty"` }
type KeyAuthPluginConfig ¶ added in v1.0.2
type KeyAuthPluginConfig struct { KeyInQuery bool `json:"key_in_query,omitempty"` KeyInHeader bool `json:"key_in_header,omitempty"` KeyNames []string `json:"key_names,omitempty"` Anonymous string `json:"anonymous,omitempty"` RunOnPreflight bool `json:"run_on_preflight,omitempty"` HideCredentials bool `json:"hide_credentials,omitempty"` KeyInBody bool `json:"key_in_body,omitempty"` }
func NewKeyAuthPluginConfigFromMap ¶ added in v1.0.2
func NewKeyAuthPluginConfigFromMap(mapData map[string]interface{}) (*KeyAuthPluginConfig, error)
type KongAPIClient ¶
type KongAPIClient interface { // Provisioning CreateConsumer(ctx context.Context, id, name string) (*klib.Consumer, error) AddConsumerACL(ctx context.Context, id string) error DeleteConsumer(ctx context.Context, id string) error // Credential DeleteOauth2(ctx context.Context, consumerID, clientID string) error DeleteHttpBasic(ctx context.Context, consumerID, username string) error DeleteAuthKey(ctx context.Context, consumerID, authKey string) error CreateHttpBasic(ctx context.Context, consumerID string, basicAuth *klib.BasicAuth) (*klib.BasicAuth, error) CreateOauth2(ctx context.Context, consumerID string, oauth2 *klib.Oauth2Credential) (*klib.Oauth2Credential, error) CreateAuthKey(ctx context.Context, consumerID string, keyAuth *klib.KeyAuth) (*klib.KeyAuth, error) // Access Request AddRouteACL(ctx context.Context, routeID, allowedID string) error RemoveRouteACL(ctx context.Context, routeID, revokedID string) error AddQuota(ctx context.Context, routeID, allowedID, quotaInterval string, quotaLimit int) error ListServices(ctx context.Context) ([]*klib.Service, error) ListRoutesForService(ctx context.Context, serviceId string) ([]*klib.Route, error) GetSpecForService(ctx context.Context, service *klib.Service) ([]byte, error) GetKongPlugins() *Plugins }
type KongClient ¶
func NewKongClient ¶
func NewKongClient(kongConfig *config.KongGatewayConfig) (*KongClient, error)
func (KongClient) AddConsumerACL ¶
func (k KongClient) AddConsumerACL(ctx context.Context, id string) error
func (KongClient) AddRouteACL ¶
func (k KongClient) AddRouteACL(ctx context.Context, routeID, allowedID string) error
func (KongClient) CreateAuthKey ¶
func (KongClient) CreateConsumer ¶
func (KongClient) CreateHttpBasic ¶
func (KongClient) CreateOauth2 ¶
func (k KongClient) CreateOauth2(ctx context.Context, consumerID string, oauth2 *klib.Oauth2Credential) (*klib.Oauth2Credential, error)
func (KongClient) DeleteAuthKey ¶
func (k KongClient) DeleteAuthKey(ctx context.Context, consumerID, authKey string) error
func (KongClient) DeleteConsumer ¶
func (k KongClient) DeleteConsumer(ctx context.Context, id string) error
func (KongClient) DeleteHttpBasic ¶
func (k KongClient) DeleteHttpBasic(ctx context.Context, consumerID, username string) error
func (KongClient) DeleteOauth2 ¶
func (k KongClient) DeleteOauth2(ctx context.Context, consumerID, clientID string) error
func (KongClient) GetKongPlugins ¶
func (k KongClient) GetKongPlugins() *Plugins
func (KongClient) GetSpecForService ¶
func (KongClient) ListRoutesForService ¶
func (KongClient) ListServices ¶
func (KongClient) RemoveRouteACL ¶
func (k KongClient) RemoveRouteACL(ctx context.Context, routeID, revokedID string) error
type KongServiceSpec ¶
type OAuthPluginConfig ¶ added in v1.0.2
type OAuthPluginConfig struct { HideCredentials bool `json:"hide_credentials,omitempty"` PersistentRefreshToken bool `json:"persistent_refresh_token,omitempty"` ProvisionKey string `json:"provision_key,omitempty"` RefreshTokenTTL int64 `json:"refresh_token_ttl,omitempty"` TokenExpiration int64 `json:"token_expiration,omitempty"` AcceptHTTPIfAlreadyTerminated bool `json:"accept_http_if_already_terminated,omitempty"` AuthHeaderName string `json:"auth_header_name,omitempty"` MandatoryScope bool `json:"mandatory_scope,omitempty"` Scopes []string `json:"scopes,omitempty"` PKCE string `json:"pkce,omitempty"` ReuseRefreshToken bool `json:"reuse_refresh_token,omitempty"` EnablePasswordGrant bool `json:"enable_password_grant,omitempty"` EnableClientCredentials bool `json:"enable_client_credentials,omitempty"` GlobalCredentials bool `json:"global_credentials,omitempty"` Anonymous string `json:"anonymous,omitempty"` EnableImplicitGrant bool `json:"enable_implicit_grant,omitempty"` EnableAuthorizationCode bool `json:"enable_authorization_code,omitempty"` }
func NewOAuthPluginConfigFromMap ¶ added in v1.0.2
func NewOAuthPluginConfigFromMap(mapData map[string]interface{}) (*OAuthPluginConfig, error)
type PluginLister ¶
type Plugins ¶
type Plugins struct {
PluginLister
}
func (*Plugins) GetEffectivePlugins ¶
GetEffectivePlugins determines the effective plugin configuration for the route/service combination. Returns a map containing effective Plugin configuration grouped by plugin type.
Click to show internal directories.
Click to hide internal directories.