mappings

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List enumerates the Groups to which the current token has access.

Types

type CreateOpts

type CreateOpts struct {
	// Rules used to map federated users to local users.
	Rules []RuleOpts `json:"rules" required:"true"`
}

CreateOpts provides options used to create a mapping.

func (CreateOpts) ToMappingCreateMap

func (opts CreateOpts) ToMappingCreateMap() (map[string]interface{}, error)

ToMappingCreateMap formats a CreateOpts into a create request.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToMappingCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult is the response from a Create operation. Call its Extract method to interpret it as a Mapping.

func Create

func Create(client *golangsdk.ServiceClient, mappingID string, opts CreateOptsBuilder) (r CreateResult)

Create creates a new Mapping, by ID.

func (CreateResult) Extract

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

Extract interprets any group results as a Mapping.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult is the response from a Delete operation. Call its ExtractErr to determine if the request succeeded or failed.

func Delete

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

Delete deletes a mapping, by ID.

type Domain

type Domain struct {
	Name string `json:"name,omitempty"`
	ID   string `json:"id,omitempty"`
}

type GetResult

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

GetResult is the response from a Get operation. Call its Extract method to interpret it as a Mapping.

func Get

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

Get retrieves details on a single Mapping, by ID.

func (GetResult) Extract

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

Extract interprets any group results as a Mapping.

type GroupOpts

type GroupOpts struct {
	Name   string  `json:"name" required:"true"`
	Domain *Domain `json:"domain,omitempty"`
}

type LocalRuleOpts

type LocalRuleOpts struct {
	User   *UserOpts  `json:"user,omitempty"`
	Group  *GroupOpts `json:"group,omitempty"`
	Groups string     `json:"groups,omitempty"`
}

type Mapping

type Mapping struct {
	// ID is the unique ID of the mapping.
	ID string `json:"id"`

	// Resource Links of mappings.
	Links map[string]interface{} `json:"links"`

	// Rules used to map federated users to local users
	Rules []Rule `json:"rules"`
}

Mapping helps manage mapping rules.

func ExtractMappings

func ExtractMappings(r pagination.Page) ([]Mapping, error)

ExtractMappings returns a slice of Mappings contained in a linked page of results.

type MappingPage

type MappingPage struct {
	pagination.LinkedPageBase
}

MappingPage is a single page of Mapping results.

func (MappingPage) IsEmpty

func (r MappingPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a page of Mappings contains any results.

type RemoteRule

type RemoteRule struct {
	Type     string   `json:"type"`
	NotAnyOf []string `json:"not_any_of,omitempty"`
	AnyOneOf []string `json:"any_one_of,omitempty"`
	Regex    bool     `json:"regex,omitempty"`
}

type RemoteRuleOpts

type RemoteRuleOpts struct {
	Type     string   `json:"type" required:"true"`
	NotAnyOf []string `json:"not_any_of,omitempty"`
	AnyOneOf []string `json:"any_one_of,omitempty"`
	Regex    *bool    `json:"regex,omitempty"`
}

type Rule

type Rule struct {
	Local  []LocalRuleOpts `json:"local"`
	Remote []RemoteRule    `json:"remote"`
}

type RuleOpts

type RuleOpts struct {
	Local  []LocalRuleOpts  `json:"local" required:"true"`
	Remote []RemoteRuleOpts `json:"remote" required:"true"`
}

type UpdateOpts

type UpdateOpts struct {
	// Rules used to map federated users to local users.
	Rules []RuleOpts `json:"rules" required:"true"`
}

UpdateOpts provides options for updating a mapping.

func (UpdateOpts) ToMappingUpdateMap

func (opts UpdateOpts) ToMappingUpdateMap() (map[string]interface{}, error)

ToMappingUpdateMap formats a UpdateOpts into an update request.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToMappingUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult is the response from an Update operation. Call its Extract method to interpret it as a Mapping.

func Update

func Update(client *golangsdk.ServiceClient, mappingID string, opts UpdateOptsBuilder) (r UpdateResult)

Update updates an existing Mapping, by ID.

func (UpdateResult) Extract

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

Extract interprets any group results as a Mapping.

type UserOpts

type UserOpts struct {
	Name string `json:"name" required:"true"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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