licensebootstrap

package
v2.948.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0 modules, 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

View Source
const DefaultServerURL = "https://app.speakeasy.com"

Variables

View Source
var ErrAccessTokenMissing = errors.New("the platform allowed generation but issued no token")
View Source
var ErrInsecureServerURL = errors.New("the Speakeasy server URL must use https (plain http is allowed for loopback addresses only)")
View Source
var ErrNoAPIKey = errors.New("no Speakeasy API key: set SPEAKEASY_API_KEY or run `speakeasy auth login`")
View Source
var ErrNotEntitled = errors.New("workspace has no commercial entitlement; no license token was issued")
View Source
var ErrUnauthorized = errors.New("the Speakeasy API key was rejected; run `speakeasy auth login` again")

Functions

func ReadEnvValue

func ReadEnvValue(path, key string) (string, error)

func ResolveAPIKey

func ResolveAPIKey(getenv func(string) string, homeDir string) (string, error)

func ResolveServerURL

func ResolveServerURL(flagValue string, getenv func(string) string) string

func SetEnvValue

func SetEnvValue(path, key, value string) error

func UnsetEnvValue

func UnsetEnvValue(path, key string) error

func WriteElection

func WriteElection(path, key, value string, unsetKeys ...string) error

Types

type AccessResponse

type AccessResponse struct {
	GenerationAllowed bool    `json:"generation_allowed"`
	Message           string  `json:"message"`
	Level             string  `json:"level"`
	LicenseJWT        *string `json:"license_jwt"`
}

func FetchAccessLicenseToken

func FetchAccessLicenseToken(ctx context.Context, client *http.Client, serverURL, apiKey, target string) (string, AccessResponse, error)

type ValidateResponse

type ValidateResponse struct {
	WorkspaceID   string  `json:"workspace_id"`
	WorkspaceSlug string  `json:"workspace_slug"`
	OrgSlug       string  `json:"org_slug"`
	AccountType   string  `json:"account_type_v2"`
	LicenseJWT    *string `json:"license_jwt"`
}

func FetchLicenseToken

func FetchLicenseToken(ctx context.Context, client *http.Client, serverURL, apiKey string) (string, ValidateResponse, error)

Jump to

Keyboard shortcuts

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