/
endpoints.go
37 lines (33 loc) · 1.23 KB
/
endpoints.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package store
// StoreEndpoints represents the the base and storage URLs for a given environment/store.
type StoreEndpoints struct {
BaseURL string
StorageURL string
}
// SNAP_STORE_ENDPOINTS represents the set of endpoints used when interacting with
// the production Snap store.
var SNAP_STORE_ENDPOINTS = StoreEndpoints{
BaseURL: "https://dashboard.snapcraft.io",
StorageURL: "https://upload.apps.staging.ubuntu.com",
}
// StoreAuthEndpoints represents the authn/authz endpoints to use for a given environment/store.
type StoreAuthEndpoints struct {
AuthURL string
Namespace string
Whoami string
Tokens string
TokensExchange string
TokensRefresh string
ValidPackageTypes []string
}
// UBUNTU_ONE_SNAP_STORE_AUTH_ENDPOINTS represents the set of endpoints used to authenticate
// against the Snap Store using Ubuntu One credentials.
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"},
}