authorizers

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *golangsdk.ServiceClient, instanceId string, opts ListOptsBuilder) pagination.Pager

List is a method to obtain an array of one or more custom authorizers for the instance according to the query parameters.

Types

type AuthCreateIdentitiesReq

type AuthCreateIdentitiesReq struct {
	// Parameter name.
	Name string `json:"name" required:"true"`
	// Parameter location, which support 'HEADER' and 'QUERY'.
	Location string `json:"location" required:"true"`
	// Parameter verification expression. The default value is null, indicating that no verification is performed.
	Validation *string `json:"validation,omitempty"`
}

AuthCreateIdentitiesReq is an object which will be build up a indentities list.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents a result of the Create method.

func Create

func Create(client *golangsdk.ServiceClient, instanceId string, opts CustomAuthOptsBuilder) (r CreateResult)

Create is a method to create a new custom authorizer.

func (CreateResult) Extract

func (r CreateResult) Extract() (*CustomAuthorizer, error)

type CustomAuthOpts

type CustomAuthOpts struct {
	// Custom authorizer name, which can contain 3 to 64 characters, starting with a letter.
	// Only letters, digits, and underscores (_) are allowed.
	Name string `json:"name" required:"true"`
	// Custom authorizer type, which support 'FRONTEND' and 'BACKEND'.
	Type string `json:"type" required:"true"`
	// Authorizer type, and the value is 'FUNC'.
	AuthorizerType string `json:"authorizer_type" required:"true"`
	// Function URN.
	AuthorizerURI string `json:"authorizer_uri" required:"true"`
	// Indicates whether to send the body.
	IsBodySend *bool `json:"need_body,omitempty"`
	// Identity source.
	Identities []AuthCreateIdentitiesReq `json:"identities,omitempty"`
	// Maximum cache age. The maximum value is 3,600.
	// The maximum length of time that authentication results can be cached for.
	// A value of 0 means that results are not cached.
	TTL *int `json:"ttl,omitempty"`
	// User data.
	UserData *string `json:"user_data,omitempty"`
}

CustomAuthOpts is a struct which will be used to create a new custom authorizer or update an existing custom authorizer.

func (CustomAuthOpts) ToCustomAuthOptsMap

func (opts CustomAuthOpts) ToCustomAuthOptsMap() (map[string]interface{}, error)

ToCustomAuthOptsMap is a method which to build a request body by the CustomAuthOpts.

type CustomAuthOptsBuilder

type CustomAuthOptsBuilder interface {
	ToCustomAuthOptsMap() (map[string]interface{}, error)
}

CustomAuthOptsBuilder is an interface which to support request body build of the custom authorizer creation and updation.

type CustomAuthPage

type CustomAuthPage struct {
	pagination.SinglePageBase
}

CustomAuthPage represents the response pages of the List method.

type CustomAuthorizer

type CustomAuthorizer struct {
	// Custom authorizer name., which can contain 3 to 64 characters, starting with a letter.
	// Only letters, digits, and underscores (_) are allowed.
	Name string `json:"name"`
	// Custom authorizer type, which support 'FRONTEND' and 'BACKEND'.
	Type string `json:"type"`
	// Authorizer type, and the value is 'FUNC'.
	AuthorizerType string `json:"authorizer_type"`
	// Function URN.
	AuthorizerURI string `json:"authorizer_uri"`
	// Identity source.
	Identities []Identity `json:"identities"`
	// Maximum cache age.
	TTL int `json:"ttl"`
	// User data.
	UserData string `json:"user_data"`
	// Indicates whether to send the body.
	IsBodySend bool `json:"need_body"`
	// Custom authorizer ID
	ID string `json:"id"`
	// Creation time.
	CreateTime string `json:"create_time"`
}

CustomAuthorizer is a struct that represents the result of Create, Update and Get methods.

func ExtractCustomAuthorizers

func ExtractCustomAuthorizers(r pagination.Page) ([]CustomAuthorizer, error)

ExtractCustomAuthorizers is a method which to extract the response to a custom authorizer list.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents a result of the Delete method.

func Delete

func Delete(client *golangsdk.ServiceClient, instanceId, authId string) (r DeleteResult)

Delete is a method to delete an existing custom authorizer.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents a result of the Update method.

func Get

func Get(client *golangsdk.ServiceClient, instanceId, authId string) (r GetResult)

Get is a method to obtain an existing custom authorizer.

func (GetResult) Extract

func (r GetResult) Extract() (*CustomAuthorizer, error)

type Identity

type Identity struct {
	// Parameter name.
	Name string `json:"name"`
	// Parameter location, which support 'HEADER' and 'QUERY'.
	Location string `json:"location"`
	// Parameter verification expression.
	// The default value is null, indicating that no verification is performed.
	Validation string `json:"validation"`
}

Identity is an object struct that represents the elements of the Identities parameter.

type ListOpts

type ListOpts struct {
	// ID.
	ID string `q:"id"`
	// Name.
	Name string `q:"name"`
	// Custom authorizer type.
	Type string `q:"type"`
	// Offset from which the query starts.
	// If the offset is less than 0, the value is automatically converted to 0. Default to 0.
	Offset int `q:"offset"`
	// Number of items displayed on each page. The valid values are range form 1 to 500, default to 20.
	Limit int `q:"limit"`
}

ListOpts allows to filter list data using given parameters.

func (ListOpts) ToListQuery

func (opts ListOpts) ToListQuery() (string, error)

ToListQuery is a method which to build a request query by the ListOpts.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToListQuery() (string, error)
}

ListOptsBuilder is an interface which to support request query build of the custom authorizer search.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents a result of the Update method.

func Update

func Update(client *golangsdk.ServiceClient, instanceId, authId string, opts CustomAuthOptsBuilder) (r UpdateResult)

Update is a method to update an existing custom authorizer.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*CustomAuthorizer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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