Documentation
¶
Index ¶
- Constants
- Variables
- func LoadOrCreateDeviceKey() (*ecdh.PrivateKey, error)
- func RemoveConfig() error
- func SaveConfig(cfg *Config) error
- func ServerHash(server store.Server) string
- func UnwrapWorkspaceKey(envelope Envelope, privateKey *ecdh.PrivateKey) ([]byte, error)
- type APIError
- type Client
- func (c *Client) CreateDeviceCode(ctx context.Context, name, platform string, publicKey []byte) (DeviceCode, error)
- func (c *Client) CreateServer(ctx context.Context, orgID string, in EncryptedServer) (EncryptedServer, error)
- func (c *Client) ExchangeDeviceCode(ctx context.Context, code string) (DeviceToken, bool, error)
- func (c *Client) OrganizationDevices(ctx context.Context, orgID string) ([]OrganizationDevice, error)
- func (c *Client) Organizations(ctx context.Context) ([]Organization, error)
- func (c *Client) PutWorkspaceEnvelope(ctx context.Context, orgID, deviceID string, envelope Envelope) error
- func (c *Client) Servers(ctx context.Context, orgID string) ([]EncryptedServer, error)
- func (c *Client) UpdateServer(ctx context.Context, orgID string, in EncryptedServer, expected int64) (EncryptedServer, error)
- func (c *Client) WorkspaceEnvelope(ctx context.Context, orgID, deviceID string) (Envelope, error)
- type Config
- type Device
- type DeviceCode
- type DeviceToken
- type EncryptedServer
- type Envelope
- type Organization
- type OrganizationDevice
- type ServerPayload
- type User
Constants ¶
View Source
const ( DefaultAPIURL = "https://api.getssher.com" DefaultAppURL = "https://cloud.getssher.com" )
Variables ¶
View Source
var ErrNotLoggedIn = errors.New("not signed in to SSHer Cloud; run 'ssher cloud login'")
Functions ¶
func LoadOrCreateDeviceKey ¶
func LoadOrCreateDeviceKey() (*ecdh.PrivateKey, error)
func RemoveConfig ¶
func RemoveConfig() error
func SaveConfig ¶
func ServerHash ¶
func UnwrapWorkspaceKey ¶
func UnwrapWorkspaceKey(envelope Envelope, privateKey *ecdh.PrivateKey) ([]byte, error)
Types ¶
type Client ¶
func (*Client) CreateDeviceCode ¶
func (*Client) CreateServer ¶
func (c *Client) CreateServer(ctx context.Context, orgID string, in EncryptedServer) (EncryptedServer, error)
func (*Client) ExchangeDeviceCode ¶
func (*Client) OrganizationDevices ¶ added in v0.3.3
func (*Client) Organizations ¶
func (c *Client) Organizations(ctx context.Context) ([]Organization, error)
func (*Client) PutWorkspaceEnvelope ¶ added in v0.3.3
func (*Client) UpdateServer ¶
func (c *Client) UpdateServer(ctx context.Context, orgID string, in EncryptedServer, expected int64) (EncryptedServer, error)
type Config ¶
type Config struct {
APIURL string `json:"api_url"`
AppURL string `json:"app_url"`
SessionToken string `json:"session_token"`
ExpiresAt string `json:"expires_at"`
UserID string `json:"user_id"`
UserEmail string `json:"user_email"`
DeviceID string `json:"device_id"`
OrganizationID string `json:"organization_id,omitempty"`
OrganizationName string `json:"organization_name,omitempty"`
}
func LoadConfig ¶
type DeviceCode ¶
type DeviceToken ¶
type EncryptedServer ¶
type EncryptedServer struct {
ID string `json:"id"`
OrganizationID string `json:"organization_id"`
Ciphertext []byte `json:"ciphertext"`
Nonce []byte `json:"nonce"`
Revision int64 `json:"revision"`
TeamIDs []string `json:"team_ids"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func EncryptServer ¶
func EncryptServer(payload ServerPayload, key []byte, orgID, serverID string, revision int64) (EncryptedServer, error)
type Envelope ¶
type Organization ¶
type OrganizationDevice ¶ added in v0.3.3
type ServerPayload ¶
func DecryptServer ¶
func DecryptServer(record EncryptedServer, key []byte) (ServerPayload, error)
func PayloadForServer ¶
func PayloadForServer(server store.Server) ServerPayload
Click to show internal directories.
Click to hide internal directories.