login

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AcrRegistrySuffix suffix for ACR registry images
	AcrRegistrySuffix = ".azurecr.io"
)

go login process, derived from code sample provided by MS at https://github.com/devigned/go-az-cli-stuff

Variables

This section is empty.

Functions

func GetTokenStorePath

func GetTokenStorePath() string

GetTokenStorePath the path for token store

func NewAuthorizerFromLogin

func NewAuthorizerFromLogin() (autorest.Authorizer, error)

NewAuthorizerFromLogin creates an authorizer based on login access token

func NewContainerClient

func NewContainerClient(subscriptionID string) (containerinstance.ContainerClient, error)

NewContainerClient get client to manipulate containers

func NewContainerGroupsClient

func NewContainerGroupsClient(subscriptionID string) (containerinstance.ContainerGroupsClient, error)

NewContainerGroupsClient get client toi manipulate containerGrouos

func NewFileShareClient added in v0.1.15

func NewFileShareClient(subscriptionID string) (storage.FileSharesClient, error)

NewFileShareClient get client to manipulate file shares

func NewGroupsClient

func NewGroupsClient(subscriptionID string) (resources.GroupsClient, error)

NewGroupsClient get client to manipulate groups

func NewStorageAccountsClient

func NewStorageAccountsClient(subscriptionID string) (storage.AccountsClient, error)

NewStorageAccountsClient get client to manipulate storage accounts

func NewSubscriptionsClient

func NewSubscriptionsClient() (subscription.SubscriptionsClient, error)

NewSubscriptionsClient get subscription client

Types

type AzureLoginService

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

AzureLoginService Service to log into azure and get authentifier for azure APIs

func NewAzureLoginService

func NewAzureLoginService() (*AzureLoginService, error)

NewAzureLoginService creates a NewAzureLoginService

func (AzureLoginService) GetTenantID

func (login AzureLoginService) GetTenantID() (string, error)

GetTenantID returns tenantID for current login

func (*AzureLoginService) GetValidToken

func (login *AzureLoginService) GetValidToken() (oauth2.Token, error)

GetValidToken returns an access token. Refresh token if needed

func (*AzureLoginService) Login

func (login *AzureLoginService) Login(ctx context.Context, requestedTenantID string) error

Login performs an Azure login through a web browser

func (*AzureLoginService) LoginServicePrincipal

func (login *AzureLoginService) LoginServicePrincipal(clientID string, clientSecret string, tenantID string) error

LoginServicePrincipal login with clientId / clientSecret from a service principal. The resulting token does not include a refresh token

func (*AzureLoginService) Logout

func (login *AzureLoginService) Logout(ctx context.Context) error

Logout remove azure token data

type AzureLoginServiceAPI

type AzureLoginServiceAPI interface {
	LoginServicePrincipal(clientID string, clientSecret string, tenantID string) error
	Login(ctx context.Context, requestedTenantID string) error
	Logout(ctx context.Context) error
}

AzureLoginServiceAPI interface for Azure login service

type LocalServer

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

LocalServer is an Azure login server

func NewLocalServer

func NewLocalServer(queryCh chan localResponse) (*LocalServer, error)

NewLocalServer creates an Azure login server

func (*LocalServer) Addr

func (s *LocalServer) Addr() string

Addr returns the address that the local Azure server is service to

func (*LocalServer) Close

func (s *LocalServer) Close()

Close stops the local Azure login server

func (*LocalServer) Serve

func (s *LocalServer) Serve()

Serve starts the local Azure login server

type StorageLogin added in v0.1.15

type StorageLogin interface {
	// GetAzureStorageAccountKey retrieves the storage account ket from the current azure login
	GetAzureStorageAccountKey(ctx context.Context, accountName string) (string, error)
}

StorageLogin helper for Azure Storage Login

type StorageLoginImpl added in v0.1.17

type StorageLoginImpl struct {
	AciContext store.AciContext
}

StorageLoginImpl implementation of StorageLogin

func (StorageLoginImpl) GetAzureStorageAccountKey added in v0.1.17

func (helper StorageLoginImpl) GetAzureStorageAccountKey(ctx context.Context, accountName string) (string, error)

GetAzureStorageAccountKey retrieves the storage account ket from the current azure login

type TokenInfo

type TokenInfo struct {
	Token    oauth2.Token `json:"oauthToken"`
	TenantID string       `json:"tenantId"`
}

TokenInfo data stored in tokenStore

Jump to

Keyboard shortcuts

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