Documentation
¶
Index ¶
Constants ¶
View Source
const ( CreateListenEvent = 1 << iota WriteListenEvent )
Variables ¶
This section is empty.
Functions ¶
func JoinCookiesToString ¶
Types ¶
type CookiesSqliteCookieReader ¶
type CookiesSqliteCookieReader struct{}
CookiesSqliteCookieReader reads the Data/profile/cookies.sqlite file
type FirefoxLoadOptions ¶
type FirefoxLoadOptions struct {
// OpenBrowser decides whether the Firefox Portable executable should be launched so that the user can enter their
// credential data manually.
//
// The executable is launched only if there is no authentication token stored locally or if the existing token is
// already expired.
OpenBrowser bool
// Logger is the logger to be used during the load operation.
Logger *log.Logger
// OnStartListening is called when the load operation starts to listen the authentication token file for changes.
//
// If there is an authentication token stored locally, and it's not expired, this callback is never called.
OnStartListening func()
}
type FirefoxPortable ¶
func (FirefoxPortable) ExecutablePath ¶
func (f FirefoxPortable) ExecutablePath() string
func (FirefoxPortable) Load ¶
func (f FirefoxPortable) Load(extractor TokenExtractor, options FirefoxLoadOptions) (string, error)
type Jsonlz4CookieReader ¶
type Jsonlz4CookieReader struct{}
Jsonlz4CookieReader reads the Data/profile/sessionstore-backups/recovery.jsonlz4 file
type TokenExtractor ¶
type TokenExtractor interface {
// GetListenEvent should return to which directory listening event (create or update) the driver should react to.
GetListenEvent() TokenExtractorListenEvent
// GetLoginUrl should return a URL that the user can visit so that they can enter their credential data manually.
GetLoginUrl() *url.URL
// GetFilePath should return the path of the file where the authentication token will be extracted.
//
// The returned path should be relative to the Firefox Portable root directory.
GetFilePath() string
// Parse should, given its path, read a file that has the same format as the file pointed by GetFilePath and return
// the relevant authentication token contained in it.
Parse(path string) (string, error)
// Validate should, given an authentication token, check if it's valid or already expired.
//
// A token is considered expired if using it on a request raises 401 Unauthorized or 403 Forbidden, where it used to
// return a 200-like HTTP code at some point in the past.
Validate(token string) (bool, error)
}
type TokenExtractorListenEvent ¶
type TokenExtractorListenEvent int
Click to show internal directories.
Click to hide internal directories.