Documentation ¶
Index ¶
- Constants
- func ConfigOut(ctx context.Context, state string, creds *Credentials, opts ...Option) (*fs.ConfigOut, error)
- func StartServer(codeVerifier pkce.Code, mapper configmap.Mapper, client *models.Client) error
- func StopServer() error
- func UsingChrome(ctx context.Context, creds *Credentials, opts ...Option) (*oauth2.Token, []*http.Cookie, error)
- type Credentials
- type ErrorType
- type HTTPError
- type InvalidTokenError
- type MissingOptionError
- type NilTokenError
- type Option
- type RequiredFieldError
- type Screen
- type Screens
- type UnsupportedTokenError
- type WithScreenshotError
Constants ¶
View Source
const ( ConfigURL = "url" ConfigCookieJar = "cookie" )
View Source
const ( // DefaultTimeout is the default timeout for the login process. DefaultTimeout = 30 * time.Second // DefaultRefreshFrequency is the default refresh frequency for the login process. DefaultRefreshFrequency = 1500 * time.Millisecond )
View Source
const ( // ReconnectURL is redirect to local webserver when active. ReconnectURL = "http://" + bindAddress + "/" // ReconnectPublicURL is redirect to local webserver when active with public name. ReconnectPublicURL = "http://localhost.rclone.org:" + bindPort + "/" // ReconnectLocalhostURL is redirect to local webserver when active with localhost. ReconnectLocalhostURL = "http://localhost:" + bindPort + "/" TokenPath = "token" AuthorizePath = "authorize" )
View Source
const ( UsernameParam = "username" PasswordParam = "password" OTPSecretParam = "otp_secret" )
View Source
const LogPrefix = "digiposte-login"
Variables ¶
This section is empty.
Functions ¶
func StartServer ¶
StartServer starts a local webserver to receive the auth.
func StopServer ¶
func StopServer() error
Types ¶
type Credentials ¶
func (*Credentials) Valid ¶
func (c *Credentials) Valid() error
type ErrorType ¶
type ErrorType int
const ( InternalError ErrorType = 500 // internal_error InvalidRequestError ErrorType = 400 // invalid_request InvalidClientError ErrorType = 400 // invalid_client InvalidGrantError ErrorType = 400 // invalid_grant InvalidScopeError ErrorType = 400 // invalid_scope UnsupportedGrantTypeError ErrorType = 400 // unsupported_grant_type CancelledRequestError ErrorType = 499 // reauest_cancelled )
https://www.oauth.com/oauth2-servers/access-tokens/access-token-response/#error
type InvalidTokenError ¶
func (*InvalidTokenError) Error ¶
func (e *InvalidTokenError) Error() string
type MissingOptionError ¶
func (*MissingOptionError) Error ¶
func (e *MissingOptionError) Error() string
func (*MissingOptionError) Is ¶
func (e *MissingOptionError) Is(target error) bool
type NilTokenError ¶
type NilTokenError struct{}
func (*NilTokenError) Error ¶
func (e *NilTokenError) Error() string
type Option ¶
type Option func(*chromeLogin)
func WithCookies ¶
func WithRefreshFrequency ¶
func WithScreenShortOnError ¶
type RequiredFieldError ¶
type RequiredFieldError struct {
Field string
}
func (*RequiredFieldError) Error ¶
func (e *RequiredFieldError) Error() string
type UnsupportedTokenError ¶
type UnsupportedTokenError struct {
Token interface{}
}
func (*UnsupportedTokenError) Error ¶
func (e *UnsupportedTokenError) Error() string
type WithScreenshotError ¶
func (*WithScreenshotError) Error ¶
func (e *WithScreenshotError) Error() string
func (*WithScreenshotError) Unwrap ¶
func (e *WithScreenshotError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.