Documentation ¶
Index ¶
- Constants
- Variables
- func BuildShareURL(serverBaseURL string, passphrase string) string
- func CreateEphemeral(serverBaseURL string, cfg *backend.Config) (shareURL string, err error)
- func EmailFromPassphrase(passphrase string) string
- func Get(cl *Client, path string, keypair *taber.Keys) (*http.Response, error)
- func GetConfigsByInviteURL(url string) ([]*backend.Config, error)
- func GetConfigsByKeypair(cl *Client, keypair *taber.Keys) ([]*backend.Config, error)
- func Login(cl *Client, keypair *taber.Keys) (authToken string, err error)
- func NewKeyPair(passphrase string) (keypair *taber.Keys, err error)
- func ParseInviteURL(url string) (serverBaseURL, passphrase string, err error)
- func Post(cl *Client, urlPath string, filebr io.Reader, headers http.Header) error
- func RandomPassphrase(numWords int) (string, error)
- func ToConfig(share *Share) (*backend.Config, error)
- func ToConfigs(shares []*Share) ([]*backend.Config, error)
- type Client
- type Share
Constants ¶
const ( DefaultServerURL = "https://minishare.cryptag.org" DefaultServerTorURL = "http://ptga662wjtg2cie3.onion" DefaultWordsInPassphrase = 12 )
Variables ¶
var (
ErrInvalidInviteURL = errors.New("share: invalid invite URL")
)
Functions ¶
func BuildShareURL ¶
BuildShareURL builds and returns the final URL at which the Share server at serverBaseURL is hosting Shares for the user whose keypair can be generated with passphrase.
func CreateEphemeral ¶
CreateEphemeral uses passphrase to use miniLock to encrypt JSON-marshaled cfg and store it at the share server at serverBaseURL, returning the location at which the Backend Config (aka invite) can be retrieved.
If serverBaseURL is empty, DefaultServerURL is used.
func EmailFromPassphrase ¶
EmailFromPassphrase generates an "email" suitable for combining with the given passphrase for use in generating a miniLock/session25519 key pair.
func Get ¶
Get does an authenticated GET request to serverBaseURL+path. If authToken is empty or stale, this function will log into the server to get a new auth token, and _then_ execute the GET.
func GetConfigsByKeypair ¶
func NewKeyPair ¶
NewKeyPair generates an "email" from the given passphrase, then uses that email/passphrase pair to generate a new keypair.
func ParseInviteURL ¶
func RandomPassphrase ¶
RandomPassphrase uses a capitalized version of the EFF's user-friendly wordlist (see https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases) to generate a random passphrase consisting of numWords words. Each additional word contributes 10.34 bits of entropy to the overall strength of the resulting passphrase.