Documentation ¶
Index ¶
- Constants
- func AddSession(httpClient *retryablehttp.Client, snServer, inKey string, k keyring.Keyring, ...) (res string, err error)
- func GetCredentials(inServer string) (email, password, apiServer, errMsg string)
- func GetSessionFromKeyring(k keyring.Keyring) (s string, err error)
- func RemoveSession(k keyring.Keyring) string
- func SessionExists(k keyring.Keyring) error
- func SessionStatus(sKey string, k keyring.Keyring) (msg string, err error)
- func UpdateSession(sess *Session, k keyring.Keyring, debug bool) error
- type MinimalSession
- type Session
- func GetSession(httpClient *retryablehttp.Client, loadSession bool, sessionKey, server string, ...) (session Session, email string, err error)
- func GetSessionFromUser(httpClient *retryablehttp.Client, server string, debug bool) (Session, string, error)
- func ParseSessionString(ss string) (sess Session, err error)
- type SessionItemsKey
Constants ¶
View Source
const ( SNServerURL = "https://api.standardnotes.com" KeyringApplicationName = "Session" KeyringService = "StandardNotesCLI" MsgSessionRemovalSuccess = "session removed successfully" MsgSessionRemovalFailure = "failed to remove session" DefaultSessionExpiryTime = 12 * time.Hour RefreshSessionThreshold = 10 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func AddSession ¶
func GetCredentials ¶
func GetSessionFromKeyring ¶
func RemoveSession ¶
func RemoveSession(k keyring.Keyring) string
RemoveSession removes the SN Session from the keyring.
func SessionExists ¶
func SessionExists(k keyring.Keyring) error
func SessionStatus ¶
func UpdateSession ¶
Types ¶
type MinimalSession ¶
type MinimalSession struct { Server string Token string MasterKey string KeyParams auth.KeyParams `json:"keyParams"` AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` AccessExpiration int64 `json:"access_expiration"` RefreshExpiration int64 `json:"refresh_expiration"` SchemaValidation bool }
type Session ¶
type Session struct { Debug bool HTTPClient *retryablehttp.Client SchemaValidation bool Server string FilesServerUrl string `json:"filesServerUrl"` Token string MasterKey string ItemsKeys []SessionItemsKey // ImporterItemsKeys is the key used to encrypt exported items and set during import only // ImporterItemsKeys []SessionItemsKey DefaultItemsKey SessionItemsKey KeyParams auth.KeyParams `json:"keyParams"` AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` AccessExpiration int64 `json:"access_expiration"` RefreshExpiration int64 `json:"refresh_expiration"` ReadOnlyAccess bool `json:"readonly_access"` PasswordNonce string Schemas map[string]*jsonschema.Schema }
Session holds authentication and encryption parameters required to communicate with the API and process transferred data.
func GetSession ¶
func GetSessionFromUser ¶
func ParseSessionString ¶
Click to show internal directories.
Click to hide internal directories.