rbac

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 5 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 {
	AccessToken string
	// contains filtered or unexported fields
}

func (*APIClient) GetPrincipals

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

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
	AccessToken string
}

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) (*PrincipalList, *http.Response, error)
}

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 RbacAPI

type RbacAPI struct {
	PrincipalAPI func() PrincipalAPI
}

Jump to

Keyboard shortcuts

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