Documentation
¶
Overview ¶
Package upbound implements authentication for xpkg.upbound.io.
Index ¶
Constants ¶
const ( // UserAgent is the default user agent to use to make requests to the // Upbound API. UserAgent = "crossplane-cli" // CookieName is the default cookie name used to identify a session token. CookieName = "SID" )
Variables ¶
This section is empty.
Functions ¶
func JSON ¶
JSON returns a Resolver that retrieves values from a JSON source. Based slightly off of https://github.com/alecthomas/kong/blob/f48da244f54370c0cb63e22b0e500e5459a491bf/resolver.go#L33-L60 Hyphens in flag names are replaced with underscores.
Types ¶
type Context ¶
type Context struct {
ProfileName string
Profile config.Profile
Token string
Account string
Domain *url.URL
InsecureSkipTLSVerify bool
APIEndpoint *url.URL
RegistryEndpoint *url.URL
Cfg *config.Config
CfgSrc config.Source
// contains filtered or unexported fields
}
Context includes common data that Upbound consumers may utilize.
func NewFromFlags ¶
NewFromFlags constructs a new context from flags.
type Flags ¶
type Flags struct {
// Keep sorted alphabetically.
Account string `` /* 133-byte string literal not displayed */
Domain *url.URL `` /* 147-byte string literal not displayed */
InsecureSkipTLSVerify bool `env:"UP_INSECURE_SKIP_TLS_VERIFY" help:"[INSECURE] Skip verifying TLS certificates." json:"insecureSkipTLSVerify,omitempty"`
Profile string `env:"UP_PROFILE" help:"Profile used to execute command." json:"profile,omitempty"`
// Hidden flags.
APIEndpoint *url.URL `` /* 153-byte string literal not displayed */
RegistryEndpoint *url.URL `` /* 158-byte string literal not displayed */
}
Flags are common flags used by commands that interact with Upbound.
func (Flags) MarshalJSON ¶
MarshalJSON marshals the Flags struct, converting the url.URL to strings.
type Option ¶
type Option func(*Context)
Option modifies a Context.
func AllowMissingProfile ¶
func AllowMissingProfile() Option
AllowMissingProfile indicates that Context should still be returned even if a profile name is supplied and it does not exist in config.
type TokenFile ¶
type TokenFile struct {
AccessID string `json:"accessId"` //nolint:tagliatelle // Should be accessID, but keeping accessId for backward compatibility.
Token string `json:"token"`
}
TokenFile is the format in which Upbound tokens are stored on disk.
func TokenFromPath ¶
func TokenFromPath(path string, opts ...TokenOption) (TokenFile, error)
TokenFromPath extracts a token from the provided path.
type TokenOption ¶
type TokenOption func(conf *tokenConf)
TokenOption modifies how a token is obtained.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package config manages the Crossplane CLI configuration.
|
Package config manages the Crossplane CLI configuration. |
|
Package credhelper provides a docker credential helper for the Upbound marketplace.
|
Package credhelper provides a docker credential helper for the Upbound marketplace. |