Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyPassOrSaltedKeyPassMustBeNotNil = errors.New("either keyPass or saltedKeyPass must be not nil") ErrFailedToUnlockUserKeys = errors.New("failed to unlock user keys") ErrUsernameAndPasswordRequired = errors.New("username and password are required") Err2FACodeRequired = errors.New("this account requires a 2FA code. Can be provided with --protondrive-2fa=000000") ErrMailboxPasswordRequired = errors.New("this account requires a mailbox password") )
Functions ¶
Types ¶
type Config ¶
type Config struct { /* Constants */ AppVersion string UserAgent string /* Login */ FirstLoginCredential *FirstLoginCredentialData ReusableCredential *ReusableCredentialData UseReusableLogin bool CredentialCacheFile string // If CredentialCacheFile is empty, no credential will be logged /* Setting */ DestructiveIntegrationTest bool // CAUTION: the integration test requires a clean proton drive EmptyTrashAfterIntegrationTest bool // CAUTION: the integration test will clean up all the data in the trash ReplaceExistingDraft bool // for the file upload replace or keep it as-is option EnableCaching bool // link node caching ConcurrentBlockUploadCount int ConcurrentFileCryptoCount int /* Drive */ DataFolderName string }
func NewConfigForIntegrationTests ¶
func NewConfigForIntegrationTests() *Config
func NewConfigWithDefaultValues ¶
func NewConfigWithDefaultValues() *Config
type ProtonDriveCredential ¶
type ProtonDriveCredential struct { UID string AccessToken string RefreshToken string SaltedKeyPass string }
func Login ¶
func Login(ctx context.Context, config *Config, authHandler proton.AuthHandler, deAuthHandler proton.Handler) (*proton.Manager, *proton.Client, *ProtonDriveCredential, *crypto.KeyRing, map[string]*crypto.KeyRing, map[string]proton.Address, error)
Log in methods - username and password to log in - UID and refresh token
Keyring decryption The password will be salted, and then used to decrypt the keyring. The salted password needs to be and can be cached, so the keyring can be re-decrypted when needed
Click to show internal directories.
Click to hide internal directories.