juju

package
v0.0.0-...-511b1a1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalAccounts

func MarshalAccounts(controller, user, password string) ([]byte, error)

MarshalAccounts encodes the given credentials information so that they are suitable for being used as the content of the Juju accounts.yaml file.

func MarshalControllers

func MarshalControllers(info *Info) ([]byte, error)

MarshalControllers encodes the given controller information so that it is suitable for being used as the content of the Juju controllers.yaml file.

func SetMacaroons

func SetMacaroons(jar http.CookieJar, macaroons map[string]macaroon.Slice) error

SetMacaroons sets the given macaroons as cookies in the given jar.

Types

type Credentials

type Credentials struct {
	// Username and Password hold traditional Juju credentials for local users.
	Username string
	Password string
	// Macaroons, alternatively, maps cookie URLs to macaroons used for
	// authenticating as external users. An identity manager URL/token pair is
	// usually provided.
	Macaroons map[string]macaroon.Slice
}

Credentials holds credentials for logging into a Juju controller.

type Info

type Info struct {
	// User holds the name of the current local or external user.
	User string
	// ControllerName holds the name of the controller.
	ControllerName string
	// ControllerUUID holds the unique identifier for the Juju controller.
	ControllerUUID string
	// CACert is a security certificate for this controller.
	CACert string
	// Endpoints holds the addresses to use to connect to the Juju controller.
	Endpoints []string
}

Info holds information about the Juju controller.

func Authenticate

func Authenticate(addrs []string, creds *Credentials, cert string) (*Info, error)

Authenticate logs the current user into the Juju controller at the given addresses with the given credentials. It returns information about the Juju controller or an error.

Jump to

Keyboard shortcuts

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