Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SNAP_STORE_ENDPOINTS = StoreEndpoints{
BaseURL: "https://dashboard.snapcraft.io",
StorageURL: "https://upload.apps.staging.ubuntu.com",
}
SNAP_STORE_ENDPOINTS represents the set of endpoints used when interacting with the production Snap store.
var UBUNTU_ONE_SNAP_STORE_AUTH_ENDPOINTS = StoreAuthEndpoints{ AuthURL: "https://login.ubuntu.com", Namespace: "snap", Whoami: "/api/v2/tokens/whoami", Tokens: "/dev/api/acl/", TokensExchange: "/api/v2/tokens/discharge", TokensRefresh: "/api/v2/tokens/refresh", ValidPackageTypes: []string{"snap"}, }
UBUNTU_ONE_SNAP_STORE_AUTH_ENDPOINTS represents the set of endpoints used to authenticate against the Snap Store using Ubuntu One credentials.
Functions ¶
This section is empty.
Types ¶
type Package ¶
Package is a generic representation of a package in a Canonical store. This could be a snap, a charm, a rock, etc.
func NewSnapPackage ¶
NewSnapPackage constructs and returns a new package of type "snap".
type StoreAuthEndpoints ¶
type StoreAuthEndpoints struct { AuthURL string Namespace string Whoami string Tokens string TokensExchange string TokensRefresh string ValidPackageTypes []string }
StoreAuthEndpoints represents the authn/authz endpoints to use for a given environment/store.
type StoreClient ¶
type StoreClient struct {
// contains filtered or unexported fields
}
StoreClient is a wrapper around http.Client for logging into a Canonical store.
func NewSnapStoreClient ¶
func NewSnapStoreClient(credentials config.LoginCredentials) *StoreClient
NewSnapStoreClient constructs a new StoreClient for interacting with the snap store.
func (*StoreClient) GenerateStoreToken ¶
func (sc *StoreClient) GenerateStoreToken(snap, track, channel string) (string, error)
GenerateStoreToken takes a snap, track and channel and returns a token with a TTL of 1 year, with default permissions for the given channel.
type StoreEndpoints ¶
StoreEndpoints represents the the base and storage URLs for a given environment/store.
type UbuntuOneToken ¶
type UbuntuOneToken struct { TokenType string `json:"t"` UbuntuOneMacaroons ubuntuOneMacaroons `json:"v"` }
UbuntuOneToken represents the top-level token object that is returned to the client encoded in base64 for use with CLI tools.
func NewUbuntuOneToken ¶
func NewUbuntuOneToken(rootMacaroon *macaroon.Macaroon, dischargedMacaroon *macaroon.Macaroon) (*UbuntuOneToken, error)
NewUbuntuOneToken constructs a valid UbuntuOneToken given a input root token, and discharged token.