Documentation
¶
Overview ¶
Package auth provides an auto managed token client, capable of monitoring token expiration and refresh access token automatically without any intervention of the user.
It defines a type, Handler, wich provides several methods (such as Handler.GetToken, Handler.Start and Handler.Stop) to enable the interaction with the token client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶ added in v0.0.8
type ManagedToken ¶
type ManagedToken struct {
// contains filtered or unexported fields
}
ManagedToken gerencia o ciclo de vida do token STS
func (*ManagedToken) GetToken ¶
func (tm *ManagedToken) GetToken() (string, error)
GetToken retorna o token atual, garantindo que seja válido
func (*ManagedToken) Start ¶
func (tm *ManagedToken) Start() error
Start inicio o gerenciador de token e faz a primeira requisição para obter o token Retorna erro se não conseguir obter o token inicial
type TokenRequest ¶ added in v0.0.8
type TokenRequest struct {
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
}
TokenRequest representa os dados enviados para a API de autenticação