auth

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAPIToken

func CreateAPIToken(ac *client.AlpaconClient, tokenRequest APITokenRequest) (string, error)

func DeleteAPIToken

func DeleteAPIToken(ac *client.AlpaconClient, tokenID string) error

func GetAPITokenIDByName

func GetAPITokenIDByName(ac *client.AlpaconClient, tokenName string) (string, error)

func LoginAndSaveCredentials

func LoginAndSaveCredentials(loginReq *LoginRequest, token string, insecure bool) error

func Logout added in v0.4.4

func Logout(ac *client.AlpaconClient) error

Types

type APITokenAttributes

type APITokenAttributes struct {
	ID        string `json:"id" table:"ID"`
	Name      string `json:"name"`
	Enabled   bool   `json:"enabled"`
	UpdatedAt string `json:"updated_at" table:"Updated At"`
	ExpiresAt string `json:"expires_at" table:"Expires At"`
}

func GetAPITokenList

func GetAPITokenList(ac *client.AlpaconClient) ([]APITokenAttributes, error)

type APITokenRequest

type APITokenRequest struct {
	Name      string  `json:"name"`
	ExpiresAt *string `json:"expires_at"`
}

type APITokenResponse

type APITokenResponse struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Enabled   bool      `json:"enabled"`
	Key       string    `json:"key"`
	UpdatedAt time.Time `json:"updated_at"`
	ExpiresAt time.Time `json:"expires_at"`
}

type LoginRequest

type LoginRequest struct {
	WorkspaceURL string `json:"workspace_url"`
	Username     string `json:"username"`
	Password     string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token     string `json:"token"`
	ExpiresAt string `json:"expires_at"`
}

Jump to

Keyboard shortcuts

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