auth

package
v1.4.44-prerelease-v2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config represents authentication configuration.

func GetConfig

func GetConfig(opts ...Option) (*Config, error)

GetConfig returns a configuration object populated with the given options.

func (*Config) GetEmail

func (c *Config) GetEmail() string

GetEmail is the getter for the email.

func (*Config) GetPassword

func (c *Config) GetPassword() string

GetEmail is the getter for the password.

func (*Config) GetTokenStorageFilePath

func (c *Config) GetTokenStorageFilePath() string

GetTokenStorageFilePath is the getter for the token storage file path.

func (*Config) ShouldTryOpeningBrowser

func (c *Config) ShouldTryOpeningBrowser() bool

ShouldTryOpeningBrowser is the getter for the disabled browser boolean.

func (*Config) ShouldUseLegacyAuthentication

func (c *Config) ShouldUseLegacyAuthentication() bool

ShouldUseLegacyAuthentication is the getter for the legacy (programmatic) authentication boolean.

func (*Config) ShouldWriteTokensToDisk

func (c *Config) ShouldWriteTokensToDisk() bool

ShouldWriteTokensToDisk is the getter for the token writing disabled boolean.

type Option

type Option func(*Config)

Option represents an authentication option

func WithLegacyCredentials

func WithLegacyCredentials(email, password string) Option

WithLegacyCredentials is the authentication option to set legacy credentials.

func WithOpenBrowser

func WithOpenBrowser(enabled bool) Option

WithOpenBrowser is the authentication option to toggle whether the browser should be opened for the device authorization flow URL.

func WithTokenStorageFilePath

func WithTokenStorageFilePath(filePath string) Option

WithTokenStorageFilePath is the authentication option to set the token storage file path.

func WithTokenWriting

func WithTokenWriting(enabled bool) Option

WithTokenWritingDisabled is the authentication option to toggle whether tokens acquired through the device authorization flow should be written to disk.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL