juju: github.com/juju/juju/apiserver/stateauthenticator Index | Files

package stateauthenticator

import "github.com/juju/juju/apiserver/stateauthenticator"


Package Files

auth.go context.go legacy.go locallogin.go modeluser.go


var AgentTags = []string{

AgentTags are those used by any Juju agent.

func LoginRequest Uses

func LoginRequest(req *http.Request) (params.LoginRequest, error)

LoginRequest extracts basic auth login details from an http.Request.

TODO(axw) we shouldn't be using params types here.

type Authenticator Uses

type Authenticator struct {
    // contains filtered or unexported fields

Authenticator is an implementation of httpcontext.Authenticator, using *state.State for authentication.

This Authenticator only works with requests that have been handled by one of the httpcontext.*ModelHandler handlers.

func NewAuthenticator Uses

func NewAuthenticator(statePool *state.StatePool, clock clock.Clock) (*Authenticator, error)

NewAuthenticator returns a new Authenticator using the given StatePool.

func (*Authenticator) AddHandlers Uses

func (a *Authenticator) AddHandlers(mux *apiserverhttp.Mux)

AddHandlers adds the handlers to the given mux for handling local macaroon logins.

func (*Authenticator) Authenticate Uses

func (a *Authenticator) Authenticate(req *http.Request) (httpcontext.AuthInfo, error)

Authenticate is part of the httpcontext.Authenticator interface.

func (*Authenticator) AuthenticateLoginRequest Uses

func (a *Authenticator) AuthenticateLoginRequest(
    ctx context.Context,
    serverHost string,
    modelUUID string,
    req params.LoginRequest,
) (httpcontext.AuthInfo, error)

AuthenticateLoginRequest authenticates a LoginRequest.

TODO(axw) we shouldn't be using params types here.

func (*Authenticator) CreateLocalLoginMacaroon Uses

func (a *Authenticator) CreateLocalLoginMacaroon(ctx context.Context, tag names.UserTag, version bakery.Version) (*macaroon.Macaroon, error)

CreateLocalLoginMacaroon is part of the httpcontext.LocalMacaroonAuthenticator interface.

func (*Authenticator) Maintain Uses

func (a *Authenticator) Maintain(done <-chan struct{})

Maintain periodically expires local login interactions.

type OpenLoginAuthorizer Uses

type OpenLoginAuthorizer struct{}

OpenAuthorizer authorises any login operation presented to it.

func (OpenLoginAuthorizer) AuthorizeOps Uses

func (OpenLoginAuthorizer) AuthorizeOps(ctx context.Context, authorizedOp bakery.Op, queryOps []bakery.Op) ([]bool, []checkers.Caveat, error)

AuthorizeOps implements OpsAuthorizer.AuthorizeOps.

Package stateauthenticator imports 32 packages (graph) and is imported by 14 packages. Updated 2020-07-31. Refresh now. Tools for package owners.