openstack

package
v0.4.26 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const OpenrcPath = "/etc/admin-openrc.sh"

OpenrcPath is CubeCOS's admin credential file.

Variables

View Source
var ErrUnknownService = errors.New("no such service in the catalogue")

ErrUnknownService is returned for a service type the catalogue lacks.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	Path string
	// contains filtered or unexported fields
}

Admin holds a token for the node's admin credential and the catalogue it came with. The openrc file is re-read on each authentication.

func NewAdmin

func NewAdmin(path string) *Admin

NewAdmin reads credentials from path on first use.

func (*Admin) Endpoint

func (a *Admin) Endpoint(ctx context.Context, service string) (string, string, error)

Endpoint returns the service's endpoint (internal before public) and a token to call it with.

func (*Admin) HTTP

func (a *Admin) HTTP() *http.Client

HTTP returns a client trusting the openrc's CA, if it names one.

func (*Admin) Invalidate

func (a *Admin) Invalidate()

Invalidate drops the cached token, e.g. after a 401.

type Openrc

type Openrc struct {
	AuthURL, Username, Password, Project, UserDomain, ProjectDomain, CACert string
}

Openrc is the admin credential an openrc file exports.

func ReadOpenrc

func ReadOpenrc(path string) (Openrc, error)

ReadOpenrc reads the `export OS_*=value` lines of an openrc file. It does not run the file.

func (Openrc) GoString

func (o Openrc) GoString() string

GoString redacts under %#v too.

func (Openrc) String

func (o Openrc) String() string

String redacts the password.

Jump to

Keyboard shortcuts

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