Documentation ¶
Index ¶
- func GenerateAuthData(ct, uuid string, kp KeyParams) string
- type AuthParamsOutput
- type ErrorResponse
- type ErrorResponseData
- type KeyParams
- type RefreshSessionInput
- type RefreshSessionOutput
- type RefreshSessionResponse
- type RegisterInput
- type RequestRefreshTokenOutput
- type SignInInput
- type SignInOutput
- type SignInResponseDataSession
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAuthData ¶
Types ¶
type AuthParamsOutput ¶
type ErrorResponse ¶
type ErrorResponse struct { Meta signInResponseMeta `json:"meta"` Data ErrorResponseData `json:"data"` }
type ErrorResponseData ¶
type RefreshSessionInput ¶
type RefreshSessionOutput ¶
type RefreshSessionOutput struct { Session SignInResponseDataSession KeyParams KeyParams User User TokenName string }
type RefreshSessionResponse ¶
type RefreshSessionResponse struct { Meta struct { Auth interface{} `json:"auth"` Server struct { FilesServerURL string `json:"filesServerUrl"` } `json:"server"` } `json:"meta"` Data struct { Session struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` AccessExpiration int64 `json:"access_expiration"` RefreshExpiration int64 `json:"refresh_expiration"` ReadOnlyAccess int `json:"readonly_access"` } `json:"session"` } `json:"data"` }
func RequestRefreshToken ¶
func RequestRefreshToken(client *retryablehttp.Client, url, accessToken, refreshToken string, debug bool) (output RefreshSessionResponse, err error)
type RegisterInput ¶
type RegisterInput struct { Client *retryablehttp.Client Password string Email string PWNonce string Version string Origination string Created int64 APIServer string Debug bool }
func (RegisterInput) Register ¶
func (input RegisterInput) Register() (token string, err error)
Register creates a new user token Params: email, password, pw_cost, pw_nonce, version.
type SignInInput ¶
type SignInOutput ¶
type SignInOutput struct { Session SignInResponseDataSession KeyParams KeyParams User User TokenName string }
func SignIn ¶
func SignIn(input SignInInput) (output SignInOutput, err error)
SignIn authenticates with the server using credentials and optional MFA in order to obtain the data required to interact with Standard Notes.
type SignInResponseDataSession ¶
type SignInResponseDataSession struct { Debug bool HTTPClient *retryablehttp.Client SchemaValidation bool Server string FilesServerUrl string `json:"filesServerUrl"` Token string MasterKey string // ImporterItemsKeys is the key used to encrypt exported items and set during import only KeyParams 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 }
func CliSignIn ¶
func CliSignIn(email, password, server string, debug bool) (session SignInResponseDataSession, err error)
CliSignIn takes the server URL and credentials and sends them to the API to get a response including an authentication token plus the keys required to encrypt and decrypt SN items.
Click to show internal directories.
Click to hide internal directories.