keystone

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

View Source
const (
	TypeUser    string = "user"
	TypeGroup   string = "group"
	TypeProject string = "project"
	TypeRole    string = "role"
)

Supported types for policy match.

Variables

This section is empty.

Functions

func GetToken

func GetToken(options gophercloud.AuthOptions) (*tokens3.Token, error)

GetToken creates a token by authenticate with keystone.

Types

type Authenticator

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

Authenticator contacts openstack keystone to validate user's token passed in the request. The keystone endpoint is passed during apiserver startup

func NewKeystoneAuthenticator

func NewKeystoneAuthenticator(authURL string, caFile string) (*Authenticator, error)

NewKeystoneAuthenticator returns a password authenticator that validates credentials using openstack keystone

func (*Authenticator) AuthenticateToken

func (a *Authenticator) AuthenticateToken(token string) (user.Info, bool, error)

AuthenticateToken checks the token via Keystone call

type Authorizer

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

Authorizer contacts openstack keystone to check whether the user can perform requested operations. The keystone endpoint and policy list are passed during apiserver startup

func NewKeystoneAuthorizer

func NewKeystoneAuthorizer(authURL string, caFile string, policyFile string) (*Authorizer, error)

NewKeystoneAuthorizer returns a password authorizer that checks whether the user can perform an operation

func (*Authorizer) Authorize

func (a *Authorizer) Authorize(attributes authorizer.Attributes) (authorized authorizer.Decision, reason string, err error)

Authorize checks whether the user can perform an operation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳