juju: github.com/juju/juju/apiserver/facades/agent/credentialvalidator Index | Files

package credentialvalidator

import "github.com/juju/juju/apiserver/facades/agent/credentialvalidator"

Index

Package Files

backend.go credentialvalidator.go state.go

type Backend Uses

type Backend interface {
    // ModelUsesCredential determines if the model uses given cloud credential.
    ModelUsesCredential(tag names.CloudCredentialTag) (bool, error)

    // ModelCredential retrieves the cloud credential that a model uses.
    ModelCredential() (*ModelCredential, error)

    // WatchCredential returns a watcher that is keeping an eye on all changes to
    // a given cloud credential.
    WatchCredential(names.CloudCredentialTag) state.NotifyWatcher

    // InvalidateModelCredential marks the cloud credential that a current model
    // uses as invalid.
    InvalidateModelCredential(reason string) error

    // WatchModelCredential returns a watcher that is keeping an eye on what cloud credential a model uses.
    WatchModelCredential() (state.NotifyWatcher, error)
}

Backend defines behavior that credential validator needs.

func NewBackend Uses

func NewBackend(st StateAccessor) Backend

type CredentialValidatorAPI Uses

type CredentialValidatorAPI struct {
    *credentialcommon.CredentialManagerAPI
    // contains filtered or unexported fields
}

func NewCredentialValidatorAPI Uses

func NewCredentialValidatorAPI(ctx facade.Context) (*CredentialValidatorAPI, error)

NewCredentialValidatorAPI creates a new CredentialValidator API endpoint on server-side.

func (*CredentialValidatorAPI) ModelCredential Uses

func (api *CredentialValidatorAPI) ModelCredential() (params.ModelCredential, error)

ModelCredential returns cloud credential information for a model.

func (*CredentialValidatorAPI) WatchCredential Uses

func (api *CredentialValidatorAPI) WatchCredential(tag params.Entity) (params.NotifyWatchResult, error)

WatchCredential returns a NotifyWatcher that observes changes to a given cloud credential.

func (*CredentialValidatorAPI) WatchModelCredential Uses

func (api *CredentialValidatorAPI) WatchModelCredential() (params.NotifyWatchResult, error)

WatchModelCredential returns a NotifyWatcher that watches what cloud credential a model uses.

type CredentialValidatorAPIV1 Uses

type CredentialValidatorAPIV1 struct {
    *CredentialValidatorAPI
}

func NewCredentialValidatorAPIv1 Uses

func NewCredentialValidatorAPIv1(ctx facade.Context) (*CredentialValidatorAPIV1, error)

NewCredentialValidatorAPIv1 creates a new CredentialValidator API endpoint on server-side.

func (*CredentialValidatorAPIV1) WatchModelCredential Uses

func (*CredentialValidatorAPIV1) WatchModelCredential(_, _ struct{})

Mask out new methods from the old API versions. The API reflection code in rpc/rpcreflect/type.go:newMethod skips 2-argument methods, so this removes the method as far as the RPC machinery is concerned.

WatchModelCredential did not exist prior to v2.

type CredentialValidatorV1 Uses

type CredentialValidatorV1 interface {
    InvalidateModelCredential(params.InvalidateCredentialArg) (params.ErrorResult, error)
    ModelCredential() (params.ModelCredential, error)
    WatchCredential(params.Entity) (params.NotifyWatchResult, error)
}

CredentialValidatorV1 defines the methods on version 1 facade for the credentialvalidator API endpoint.

type CredentialValidatorV2 Uses

type CredentialValidatorV2 interface {
    InvalidateModelCredential(params.InvalidateCredentialArg) (params.ErrorResult, error)
    ModelCredential() (params.ModelCredential, error)
    WatchCredential(params.Entity) (params.NotifyWatchResult, error)
    WatchModelCredential() (params.NotifyWatchResult, error)
}

CredentialValidatorV2 defines the methods on version 2 facade for the credentialvalidator API endpoint.

type ModelAccessor Uses

type ModelAccessor interface {
    CloudCredential() (names.CloudCredentialTag, bool)
    ModelTag() names.ModelTag
    Cloud() string
    WatchModelCredential() state.NotifyWatcher
}

ModelAccessor exposes Model methods needed by credential validator.

type ModelCredential Uses

type ModelCredential struct {
    // Model is a model tag.
    Model names.ModelTag

    // Exists indicates whether the model has  a cloud credential.
    // On some clouds, that only require "empty" auth, cloud credential
    // is not needed for the models to function properly.
    Exists bool

    // Credential is a cloud credential tag.
    Credential names.CloudCredentialTag

    // Valid indicates that this model's cloud authentication is valid.
    //
    // If this model has a cloud credential setup,
    // then this property indicates that this credential itself is valid.
    //
    // If this model has no cloud credential, then this property indicates
    // whether or not it is valid for this model to have no credential.
    // There are some clouds that do not require auth and, hence,
    // models on these clouds do not require credentials.
    //
    // If a model is on the cloud that does require credential and
    // the model's credential is not set, this property will be set to 'false'.
    Valid bool
}

ModelCredential stores model's cloud credential information.

type StateAccessor Uses

type StateAccessor interface {
    Model() (ModelAccessor, error)
    CloudCredential(tag names.CloudCredentialTag) (state.Credential, error)
    WatchCredential(names.CloudCredentialTag) state.NotifyWatcher
    InvalidateModelCredential(reason string) error
    Cloud(name string) (cloud.Cloud, error)
}

StateAccessor exposes State methods needed by credential validator.

func NewStateShim Uses

func NewStateShim(st *state.State) StateAccessor

NewStateShim creates new state shim to be used by credential validator Facade.

Package credentialvalidator imports 10 packages (graph) and is imported by 3 packages. Updated 2019-08-23. Refresh now. Tools for package owners.