identityservice

package
Version: v3.0.0-...-1c69814 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessResponse

type AccessResponse struct {
	Access struct {
		ServiceCatalog []V2Service   `json:"serviceCatalog"`
		Token          TokenResponse `json:"token"`
		User           UserResponse  `json:"user"`
	} `json:"access"`
}

type Endpoint

type Endpoint struct {
	AdminURL    string `json:"adminURL"`
	InternalURL string `json:"internalURL"`
	PublicURL   string `json:"publicURL"`
	Region      string `json:"region"`
}

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
	Title   string `json:"title"`
}

type ErrorWrapper

type ErrorWrapper struct {
	Error ErrorResponse `json:"error"`
}

type IdentityService

type IdentityService interface {
	AddUser(user, secret, tenant, authDomain string) *UserInfo
	FindUser(token string) (*UserInfo, error)
	RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)
	AddService(service Service)
	SetupHTTP(mux *http.ServeMux)
}

An IdentityService provides user authentication for an Openstack instance.

type KeyPair

type KeyPair struct {
	hook.TestService
	Users
	// contains filtered or unexported fields
}

func NewKeyPair

func NewKeyPair() *KeyPair

func (*KeyPair) AddService

func (u *KeyPair) AddService(service Service)

func (*KeyPair) RegisterServiceProvider

func (u *KeyPair) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)

func (*KeyPair) ReturnFailure

func (u *KeyPair) ReturnFailure(w http.ResponseWriter, status int, message string)

func (*KeyPair) ServeHTTP

func (u *KeyPair) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*KeyPair) SetupHTTP

func (u *KeyPair) SetupHTTP(mux *http.ServeMux)

setupHTTP attaches all the needed handlers to provide the HTTP API.

func (*KeyPair) Stop

func (u *KeyPair) Stop()

type KeyPairRequest

type KeyPairRequest struct {
	Auth struct {
		ApiAccessKeyCredentials struct {
			AccessKey string `json:"accessKey"`
			SecretKey string `json:"secretKey"`
		} `json:"apiAccessKeyCredentials"`
		TenantName string `json:"tenantName"`
	} `json:"auth"`
}

type Legacy

type Legacy struct {
	Users
	// contains filtered or unexported fields
}

func NewLegacy

func NewLegacy() *Legacy

func (*Legacy) AddService

func (lis *Legacy) AddService(service Service)

func (*Legacy) RegisterServiceProvider

func (lis *Legacy) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)

func (*Legacy) ServeHTTP

func (lis *Legacy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Legacy) SetManagementURL

func (lis *Legacy) SetManagementURL(URL string)

func (*Legacy) SetupHTTP

func (lis *Legacy) SetupHTTP(mux *http.ServeMux)

setupHTTP attaches all the needed handlers to provide the HTTP API.

func (*Legacy) Stop

func (lis *Legacy) Stop()

type RoleResponse

type RoleResponse struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	TenantId string `json:"tenantId"`
}

type Service

type Service struct {
	V2 V2Service
	V3 V3Service
}

Service wraps two possible Service versions

type ServiceProvider

type ServiceProvider interface {
	// For Keystone V2
	Endpoints() []Endpoint
	// For Keystone V3
	V3Endpoints() []V3Endpoint
}

ServiceProvider is an Openstack module which has service endpoints.

type TokenResponse

type TokenResponse struct {
	Expires string `json:"expires"` // should this be a date object?
	Id      string `json:"id"`      // Actual token string
	Tenant  struct {
		Id          string  `json:"id"`
		Name        string  `json:"name"`
		Description *string `json:"description"`
	} `json:"tenant"`
}

type UserInfo

type UserInfo struct {
	Id       string
	TenantId string
	Token    string
	// contains filtered or unexported fields
}

type UserPass

type UserPass struct {
	hook.TestService
	Users
	// contains filtered or unexported fields
}

func NewUserPass

func NewUserPass() *UserPass

func (*UserPass) AddService

func (u *UserPass) AddService(service Service)

func (*UserPass) RegisterServiceProvider

func (u *UserPass) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)

func (*UserPass) ReturnFailure

func (u *UserPass) ReturnFailure(w http.ResponseWriter, status int, message string)

func (*UserPass) ServeHTTP

func (u *UserPass) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*UserPass) SetupHTTP

func (u *UserPass) SetupHTTP(mux *http.ServeMux)

setupHTTP attaches all the needed handlers to provide the HTTP API.

func (*UserPass) Stop

func (u *UserPass) Stop()

type UserPassRequest

type UserPassRequest struct {
	Auth struct {
		PasswordCredentials struct {
			Username string `json:"username"`
			Password string `json:"password"`
		} `json:"passwordCredentials"`
		TenantName string `json:"tenantName"`
	} `json:"auth"`
}

type UserResponse

type UserResponse struct {
	Id    string         `json:"id"`
	Name  string         `json:"name"`
	Roles []RoleResponse `json:"roles"`
}

type Users

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

func (*Users) AddUser

func (u *Users) AddUser(user, secret, tenant, authDomain string) *UserInfo

func (*Users) FindUser

func (u *Users) FindUser(token string) (*UserInfo, error)

type V2Service

type V2Service struct {
	Name      string `json:"name"`
	Type      string `json:"type"`
	Endpoints []Endpoint
}

type V3Domain

type V3Domain struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

V3Domain represents an authentication domain.

type V3Endpoint

type V3Endpoint struct {
	Interface string `json:"interface"`
	RegionID  string `json:"region_id"`
	URL       string `json:"url"`
}

V3Endpoint represents endpoints to a Service

func NewV3Endpoints

func NewV3Endpoints(adminURL, internalURL, publicURL, regionID string) []V3Endpoint

NewV3Endpoints returns an array of V3Endpoint for the given Region and the passed admin, internal and public URLs.

type V3Project

type V3Project struct {
	ID string `json:"id,omitempty"`
}

V3Project represent an openstack project, A project is the base unit of ownership. Resources are owned by a specific project. A project is owned by a specific domain.

type V3Service

type V3Service struct {
	ID        string       `json:"id"`
	Name      string       `json:"name"`
	Type      string       `json:"type"`
	Endpoints []V3Endpoint `json:"endpoints"`
}

V3Service represents an OpenStack web service that you can access through a URL.

type V3TokenResponse

type V3TokenResponse struct {
	Expires time.Time   `json:"expires_at"`
	Issued  time.Time   `json:"issued_at"`
	Methods []string    `json:"methods"`
	Catalog []V3Service `json:"catalog,omitempty"`
	Project *V3Project  `json:"project,omitempty"`
	Domain  *V3Domain   `json:"domain,omitempty"`
	User    struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"user"`
}

V3TokenResponse repesent a Token returned as a response to authentication to keystone v3.

type V3UserPass

type V3UserPass struct {
	hook.TestService
	Users
	// contains filtered or unexported fields
}

V3UserPass represents an authenticated user to a service.

func NewV3UserPass

func NewV3UserPass() *V3UserPass

NewV3UserPass returns a new V3UserPass

func (*V3UserPass) AddService

func (u *V3UserPass) AddService(service Service)

AddService adds a service to the current V3UserPass.

func (*V3UserPass) RegisterServiceProvider

func (u *V3UserPass) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)

RegisterServiceProvider registers V3UserPass as a service provider.

func (*V3UserPass) ReturnFailure

func (u *V3UserPass) ReturnFailure(w http.ResponseWriter, status int, message string)

ReturnFailure wraps and returns an error through the http connection.

func (*V3UserPass) ServeHTTP

func (u *V3UserPass) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves V3UserPass for testing purposes.

func (*V3UserPass) SetupHTTP

func (u *V3UserPass) SetupHTTP(mux *http.ServeMux)

SetupHTTP attaches all the needed handlers to provide the HTTP API.

func (*V3UserPass) Stop

func (u *V3UserPass) Stop()

type V3UserPassRequest

type V3UserPassRequest struct {
	Auth struct {
		Identity struct {
			Methods  []string `json:"methods"`
			Password struct {
				User struct {
					Name     string `json:"name"`
					Password string `json:"password"`
					Domain   struct {
						Name string `json:"name,omitempty"`
					} `json:"domain"`
				} `json:"user"`
			} `json:"password"`
		} `json:"identity"`
		Scope struct {
			Project struct {
				Name   string `json:"name"`
				Domain struct {
					Name string `json:"name,omitempty"`
				} `json:"domain,omitempty"`
			} `json:"project"`
			Domain struct {
				Name string `json:"name,omitempty"`
			} `json:"domain"`
		} `json:"scope"`
	} `json:"auth"`
}

V3UserPassRequest Implement the v3 User Pass form of identity (Keystone)

Jump to

Keyboard shortcuts

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