keystone

package
v0.0.0-...-8bfe3b3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalAuthPath = "/keystone/v3"
)

Keystone constants.

Variables

This section is empty.

Functions

func GetAuthType

func GetAuthType(apiClient *client.HTTP, clusterID string) (authType string, err error)

GetAuthType from the cluster configuration

func WithXClusterID

func WithXClusterID(ctx context.Context, clusterID string) context.Context

WithXClusterID creates child context with cluster ID

Types

type Assignment

type Assignment interface {
	FetchUser(id, password string) (*keystone.User, error)
	ListProjects() []*keystone.Project
	ListDomains() []*keystone.Domain
	ListUsers() []*keystone.User
}

Assignment is used to manage domain, project and user information.

type ConfigDomain

type ConfigDomain struct {
	UUID string `json:"uuid,omitempty"`
	Name string `json:"name,omitempty"`
}

ConfigDomain represents domain object.

type ConfigProject

type ConfigProject struct {
	UUID   string   `json:"uuid,omitempty"`
	Name   string   `json:"name,omitempty"`
	FQName []string `json:"fq_name,omitempty"`
}

ConfigProject represents project object.

type InMemoryStore

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

InMemoryStore is an implementation of Store based on in-memory synced map.

func MakeInMemoryStore

func MakeInMemoryStore(expire time.Duration) *InMemoryStore

MakeInMemoryStore is used to make a in memory store.

func (*InMemoryStore) CreateToken

func (store *InMemoryStore) CreateToken(user *keystone.User, project *keystone.Project) (string, *keystone.Token)

CreateToken is used to create a token for a user. This method also persists a token.

func (*InMemoryStore) RetrieveToken

func (store *InMemoryStore) RetrieveToken(tokenID string) (*keystone.Token, error)

RetrieveToken is used to retrieve a token, and return a token body.

func (*InMemoryStore) ValidateToken

func (store *InMemoryStore) ValidateToken(tokenID string) (*keystone.Token, bool)

ValidateToken is used to validate a token, and return a token body.

type Keystone

type Keystone struct {
	Assignment Assignment
	// contains filtered or unexported fields
}

Keystone is used to represents Keystone Controller.

func Init

func Init(es endpointStore) (*Keystone, error)

Init is used to initialize echo with Keystone capability. This function reads config from viper.

func (*Keystone) CreateTokenAPI

func (k *Keystone) CreateTokenAPI(c echo.Context) error

CreateTokenAPI is an API handler for issuing new authentication token.

func (*Keystone) GetProjectAPI

func (k *Keystone) GetProjectAPI(c echo.Context) error

GetProjectAPI is an API handler to list projects.

func (*Keystone) ListAuthProjectsAPI

func (k *Keystone) ListAuthProjectsAPI(c echo.Context) error

ListAuthProjectsAPI is an API handler to list projects available to be scoped to based on the token.

func (*Keystone) ListProjectsAPI

func (k *Keystone) ListProjectsAPI(c echo.Context) error

ListProjectsAPI is an API handler to list projects.

func (*Keystone) ListUsersAPI

func (k *Keystone) ListUsersAPI(c echo.Context) error

ListUsersAPI is an API handler to list users.

func (*Keystone) RegisterGRPCAPI

func (*Keystone) RegisterGRPCAPI(r apiserver.GRPCRouter)

RegisterGRPCAPI does nothing, as Keystone has no GRPC API.

func (*Keystone) RegisterHTTPAPI

func (k *Keystone) RegisterHTTPAPI(r apiserver.HTTPRouter)

RegisterHTTPAPI registers local Keystone endpoints.

func (*Keystone) ValidateTokenAPI

func (k *Keystone) ValidateTokenAPI(c echo.Context) error

ValidateTokenAPI is an API token for validating Token.

type Store

type Store interface {
	CreateToken(*keystone.User, *keystone.Project) (string, *keystone.Token)
	ValidateToken(string) (*keystone.Token, bool)
	RetrieveToken(string) (*keystone.Token, error)
}

Store is used to provide a persistence layer for tokens.

type UserListResponse

type UserListResponse struct {
	Users []*keystone.User `json:"users"`
}

UserListResponse represents a user list response.

type VNCAPIAssignment

type VNCAPIAssignment struct {
	Domains  map[string]*keystone.Domain  `json:"domains"`
	Projects map[string]*keystone.Project `json:"projects"`
	Users    map[string]*keystone.User    `json:"users"`
	// contains filtered or unexported fields
}

VNCAPIAssignment is an implementation of Assignment based on vnc api-server.

func (*VNCAPIAssignment) FetchUser

func (assignment *VNCAPIAssignment) FetchUser(name, password string) (*keystone.User, error)

FetchUser is used to fetch a user by ID and Password.

func (*VNCAPIAssignment) Init

func (assignment *VNCAPIAssignment) Init(configEndpoint string, staticUsers map[string]*keystone.User) error

Init the VNCAPI assignment with vnc api-server projects/domains

func (*VNCAPIAssignment) ListDomains

func (assignment *VNCAPIAssignment) ListDomains() (domains []*keystone.Domain)

ListDomains is used to list domains

func (*VNCAPIAssignment) ListProjects

func (assignment *VNCAPIAssignment) ListProjects() (projects []*keystone.Project)

ListProjects is used to list projects

func (*VNCAPIAssignment) ListUsers

func (assignment *VNCAPIAssignment) ListUsers() (users []*keystone.User)

ListUsers is used to list users

type VncDomain

type VncDomain struct {
	Domain *ConfigDomain `json:"domain"`
}

VncDomain represents a vnc config domain object.

type VncDomainListResponse

type VncDomainListResponse struct {
	Domains []*VncDomain `json:"domains"`
}

VncDomainListResponse represents a domain list response.

type VncProject

type VncProject struct {
	Project *ConfigProject `json:"project"`
}

VncProject represents a vnc config project object.

type VncProjectListResponse

type VncProjectListResponse struct {
	Projects []*VncProject `json:"projects"`
}

VncProjectListResponse represents a project list response.

Jump to

Keyboard shortcuts

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