subnet

package
v0.0.0-...-435c516 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SubnetURL url
	SubnetURL = "CONSOLE_SUBNET_URL"
)

Variables

View Source
var OfflinePublicKeys = []string{
	`-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEaK31xujr6/rZ7ZfXZh3SlwovjC+X8wGq
qkltaKyTLRENd4w3IRktYYCRgzpDLPn/nrf7snV/ERO5qcI7fkEES34IVEr+2Uff
JkO2PfyyAYEO/5dBlPh1Undu9WQl6J7B
-----END PUBLIC KEY-----`,
}

OfflinePublicKeys is the public key for subnet

Functions

func GenerateRegToken

func GenerateRegToken(clusterRegInfo mc.ClusterRegistrationInfo) (string, error)

GenerateRegToken generate a token

func GetAPIKey

func GetAPIKey(client http.ClientI, token string) (string, error)

GetAPIKey returns the API for a token

func GetClusterRegInfo

func GetClusterRegInfo(admInfo madmin.InfoMessage) mc.ClusterRegistrationInfo

GetClusterRegInfo returns cluster info

func GetLicenseInfoFromJWT

func GetLicenseInfoFromJWT(license string, publicKeys []string) (*licverifier.LicenseInfo, error)

GetLicenseInfoFromJWT will return license metadata from a jwt string license

Types

type LicenseTokenConfig

type LicenseTokenConfig struct {
	APIKey  string
	License string
	Proxy   string
}

LicenseTokenConfig holds registration cfg

func Register

func Register(client http.ClientI, admInfo madmin.InfoMessage, apiKey, token, accountID string) (*LicenseTokenConfig, error)

Register starts a registration flow

type LoginResp

type LoginResp struct {
	AccessToken string
	MfaToken    string
}

LoginResp response for MFA login attempt

func Login

func Login(client http.ClientI, username, password string) (*LoginResp, error)

Login starts a login request

func LoginWithMFA

func LoginWithMFA(client http.ClientI, username, mfaToken, otp string) (*LoginResp, error)

LoginWithMFA starts a login request with MFA

type MfaReq

type MfaReq struct {
	Username string `json:"username"`
	OTP      string `json:"otp"`
	Token    string `json:"token"`
}

MfaReq - JSON payload of the SUBNET mfa api

Jump to

Keyboard shortcuts

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