Documentation
¶
Index ¶
- Constants
- func GetAuthType(apiClient *client.HTTP, clusterID string) (authType string, err error)
- func WithXClusterID(ctx context.Context, clusterID string) context.Context
- type Assignment
- type ConfigDomain
- type ConfigProject
- type InMemoryStore
- type Keystone
- func (k *Keystone) CreateTokenAPI(c echo.Context) error
- func (k *Keystone) GetProjectAPI(c echo.Context) error
- func (k *Keystone) ListAuthProjectsAPI(c echo.Context) error
- func (k *Keystone) ListProjectsAPI(c echo.Context) error
- func (k *Keystone) ListUsersAPI(c echo.Context) error
- func (*Keystone) RegisterGRPCAPI(r apiserver.GRPCRouter)
- func (k *Keystone) RegisterHTTPAPI(r apiserver.HTTPRouter)
- func (k *Keystone) ValidateTokenAPI(c echo.Context) error
- type Store
- type UserListResponse
- type VNCAPIAssignment
- func (assignment *VNCAPIAssignment) FetchUser(name, password string) (*keystone.User, error)
- func (assignment *VNCAPIAssignment) Init(configEndpoint string, staticUsers map[string]*keystone.User) error
- func (assignment *VNCAPIAssignment) ListDomains() (domains []*keystone.Domain)
- func (assignment *VNCAPIAssignment) ListProjects() (projects []*keystone.Project)
- func (assignment *VNCAPIAssignment) ListUsers() (users []*keystone.User)
- type VncDomain
- type VncDomainListResponse
- type VncProject
- type VncProjectListResponse
Constants ¶
const (
LocalAuthPath = "/keystone/v3"
)
Keystone constants.
Variables ¶
This section is empty.
Functions ¶
func GetAuthType ¶
GetAuthType from the cluster configuration
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 ¶
Init is used to initialize echo with Keystone capability. This function reads config from viper.
func (*Keystone) CreateTokenAPI ¶
CreateTokenAPI is an API handler for issuing new authentication token.
func (*Keystone) GetProjectAPI ¶
GetProjectAPI is an API handler to list projects.
func (*Keystone) ListAuthProjectsAPI ¶
ListAuthProjectsAPI is an API handler to list projects available to be scoped to based on the token.
func (*Keystone) ListProjectsAPI ¶
ListProjectsAPI is an API handler to list projects.
func (*Keystone) ListUsersAPI ¶
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.
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 ¶
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.