rbac

package
v0.51.3-beta1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

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

func (*APIClient) GetPrincipals

func (c *APIClient) GetPrincipals(ctx context.Context, opts ...QueryParam) (*PrincipalList, *http.Response, error)

GetPrincipals returns the list of user's in the current users organization/tenant

type Config

type Config struct {
	// HTTPClient is a custom HTTP client
	HTTPClient *http.Client
	// Debug enables debug-level logging
	Debug bool
	// BaseURL sets a custom API server base URL
	BaseURL *url.URL
}

APIConfig defines the available configuration options to customize the API client settings

type Principal

type Principal struct {
	Username   string `json:"username"`
	Email      string `json:"email"`
	FirstName  string `json:"first_name"`
	LastName   string `json:"last_name"`
	IsActive   bool   `json:"is_active"`
	IsOrgAdmin bool   `json:"is_org_admin"`
}

type PrincipalAPI

type PrincipalAPI interface {
	GetPrincipals(ctx context.Context, opts ...QueryParam) (*PrincipalList, *http.Response, error)
}

PrincipalAPI is the API definition for the RBAC Principal API

func NewPrincipalAPIClient

func NewPrincipalAPIClient(cfg *Config) PrincipalAPI

NewPrincipalAPIClient returns a new v1 API client using a custom config

type PrincipalList

type PrincipalList struct {
	Meta struct {
		Count int `json:"count"`
	} `json:"meta"`
	Links struct {
		First    string `json:"first"`
		Previous string `json:"previous"`
		Next     string `json:"next"`
		Last     string `json:"last"`
	} `json:"links"`
	Data []Principal `json:"data"`
}

type QueryParam added in v0.29.1

type QueryParam func() (key string, value string)

QueryParam is a function defining the query param options return signature

func WithBoolQueryParam added in v0.29.1

func WithBoolQueryParam(key string, value bool) QueryParam

WithIntParam accepts a boolean query parameter and formats it as a string

func WithIntQueryParam added in v0.29.1

func WithIntQueryParam(key string, value int) QueryParam

WithIntQueryParam accepts an integer query parameter and formats it as a string

func WithQueryParam added in v0.29.1

func WithQueryParam(key string, value string) QueryParam

WithQueryParam accepts a string query parameter

type RbacAPI

type RbacAPI struct {
	PrincipalAPI func() PrincipalAPI
}

RbacAPI defines a collection of APIs grouped under the RBAC API

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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