tokens

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceOboToken

func ResourceOboToken() common.Resource

func ResourceServicePrincipalSecret added in v1.5.0

func ResourceServicePrincipalSecret() common.Resource

func ResourceToken

func ResourceToken() common.Resource

ResourceToken refreshes token in case it's expired

Types

type ListServicePrincipalSecrets added in v1.5.0

type ListServicePrincipalSecrets struct {
	Secrets []ServicePrincipalSecret `json:"secrets"`
}

type OboToken

type OboToken struct {
	ApplicationID   string `json:"application_id"`
	LifetimeSeconds int32  `json:"lifetime_seconds,omitempty"`
	Comment         string `json:"comment,omitempty"`
}

type ServicePrincipalSecret added in v1.5.0

type ServicePrincipalSecret struct {
	ID     string `json:"id,omitempty"`
	Secret string `json:"secret,omitempty" tf:"computed,sensitive"`
	Status string `json:"status,omitempty" tf:"computed"`
}

type ServicePrincipalSecretAPI added in v1.5.0

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

ServicePrincipalSecretAPI exposes the API to create client secrets

func NewServicePrincipalSecretAPI added in v1.5.0

func NewServicePrincipalSecretAPI(ctx context.Context, m any) ServicePrincipalSecretAPI

NewServicePrincipalSecretAPI creates ServicePrincipalSecretAPI instance from provider meta

type TokenInfo

type TokenInfo struct {
	TokenID      string `json:"token_id,omitempty"`
	CreationTime int64  `json:"creation_time,omitempty"`
	ExpiryTime   int64  `json:"expiry_time,omitempty"`
	Comment      string `json:"comment,omitempty"`
}

TokenInfo is a struct that contains metadata about a given token

type TokenList

type TokenList struct {
	TokenInfos []TokenInfo `json:"token_infos,omitempty"`
}

TokenList ...

type TokenManagementAPI

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

func NewTokenManagementAPI

func NewTokenManagementAPI(ctx context.Context, m any) TokenManagementAPI

func (TokenManagementAPI) CreateTokenOnBehalfOfServicePrincipal

func (a TokenManagementAPI) CreateTokenOnBehalfOfServicePrincipal(request OboToken) (token TokenResponse, err error)

func (TokenManagementAPI) Delete

func (a TokenManagementAPI) Delete(tokenID string) error

func (TokenManagementAPI) Read

func (a TokenManagementAPI) Read(tokenID string) (ti TokenResponse, err error)

type TokenRequest

type TokenRequest struct {
	LifetimeSeconds int32  `json:"lifetime_seconds,omitempty"`
	Comment         string `json:"comment,omitempty"`
}

TokenRequest asks for a token

type TokenResponse

type TokenResponse struct {
	TokenValue string     `json:"token_value,omitempty"`
	TokenInfo  *TokenInfo `json:"token_info,omitempty"`
}

TokenResponse is a struct that contains information about token that is created from the create tokens api

type TokensAPI

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

TokensAPI exposes the Secrets API

func NewTokensAPI

func NewTokensAPI(ctx context.Context, m any) TokensAPI

NewTokensAPI creates TokensAPI instance from provider meta

func (TokensAPI) Create

func (a TokensAPI) Create(tokenLifetime time.Duration, comment string) (r TokenResponse, err error)

Create creates a api token given a expiration duration and a comment

func (TokensAPI) Delete

func (a TokensAPI) Delete(tokenID string) error

Delete will delete the token given a token id

func (TokensAPI) List

func (a TokensAPI) List() ([]TokenInfo, error)

List will list all the token metadata and not the content of the tokens in the workspace

func (TokensAPI) Read

func (a TokensAPI) Read(tokenID string) (TokenInfo, error)

Read will return the token metadata and not the content of the token

Jump to

Keyboard shortcuts

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