client

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserAgent is the default user agent to use to make requests to the
	// Upbound API.
	UserAgent = "provider-upbound"
	// CookieName is the default cookie name used to identify a session token.
	CookieName = "SID"
)

Variables

View Source
var (
	DefaultAPIEndpoint, _ = url.Parse("https://api.upbound.io")
)

Functions

func ExtractUserIDFromToken added in v0.3.0

func ExtractUserIDFromToken(sToken string) (string, error)

ExtractUserIDFromToken extracts userId from SessionToken

func ParseID added in v0.6.0

func ParseID(token string) (string, error)

parseID gets a user ID by either parsing a token.

Types

type CLIConfig

type CLIConfig struct {
	Upbound Upbound `json:"upbound"`
}

CLIConfig is format for the up configuration file.

type Profile

type Profile struct {
	// ID is either a username, email, or token.
	ID string `json:"id"`

	// Type is the type of the profile.
	Type ProfileType `json:"type"`

	// Session is a session token used to authenticate to Upbound.
	Session string `json:"session,omitempty"`

	// Account is the default account to use when this profile is selected.
	Account string `json:"account,omitempty"`

	// BaseConfig represent persisted settings for this profile.
	// For example:
	// * flags
	// * environment variables
	BaseConfig map[string]string `json:"base,omitempty"`
}

A Profile is a set of credentials

func NewConfig

func NewConfig(ctx context.Context, kube client.Client, mg resource.Managed) (*up.Config, Profile, error)

type ProfileType

type ProfileType string

ProfileType is a type of Upbound profile.

const (
	UserProfileType  ProfileType = "user"
	TokenProfileType ProfileType = "token"
)

Types of profiles.

type Upbound

type Upbound struct {
	// Default indicates the default profile.
	Default string `json:"default"`

	// Profiles contain sets of credentials for communicating with Upbound. Key
	// is name of the profile.
	Profiles map[string]Profile `json:"profiles,omitempty"`
}

Upbound contains configuration information for Upbound.

Jump to

Keyboard shortcuts

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