protondrive: make cached keys rclone style and not show with rclone config redacted

This commit is contained in:
Nick Craig-Wood 2023-09-11 15:48:14 +01:00
parent e8879f3e77
commit a5a61f4874
2 changed files with 77 additions and 6 deletions

View File

@ -38,10 +38,10 @@ const (
maxSleep = 2 * time.Second
decayConstant = 2 // bigger for slower decay, exponential
clientUIDKey = "clientUID"
clientAccessTokenKey = "clientAccessToken"
clientRefreshTokenKey = "clientRefreshToken"
clientSaltedKeyPassKey = "clientSaltedKeyPass"
clientUIDKey = "client_uid"
clientAccessTokenKey = "client_access_token"
clientRefreshTokenKey = "client_refresh_token"
clientSaltedKeyPassKey = "client_salted_key_pass"
)
var (
@ -69,7 +69,7 @@ func init() {
Required: true,
IsPassword: true,
}, {
Name: "mailboxPassword",
Name: "mailbox_password",
Help: `The mailbox password of your two-password proton account.
For more information regarding the mailbox password, please check the
@ -87,6 +87,34 @@ The value can also be provided with --protondrive-2fa=000000
The 2FA code of your proton drive account if the account is set up with
two-factor authentication`,
Required: false,
}, {
Name: clientUIDKey,
Help: "Client uid key (internal use only)",
Required: false,
Advanced: true,
Sensitive: true,
Hide: fs.OptionHideBoth,
}, {
Name: clientAccessTokenKey,
Help: "Client access token key (internal use only)",
Required: false,
Advanced: true,
Sensitive: true,
Hide: fs.OptionHideBoth,
}, {
Name: clientRefreshTokenKey,
Help: "Client refresh token key (internal use only)",
Required: false,
Advanced: true,
Sensitive: true,
Hide: fs.OptionHideBoth,
}, {
Name: clientSaltedKeyPassKey,
Help: "Client salted key pass key (internal use only)",
Required: false,
Advanced: true,
Sensitive: true,
Hide: fs.OptionHideBoth,
}, {
Name: config.ConfigEncoding,
Help: config.ConfigEncodingHelp,
@ -161,7 +189,7 @@ then we might have a problem with caching the stale data.`,
type Options struct {
Username string `config:"username"`
Password string `config:"password"`
MailboxPassword string `config:"mailboxPassword"`
MailboxPassword string `config:"mailbox_password"`
TwoFA string `config:"2fa"`
// advanced

View File

@ -0,0 +1,43 @@
---
title: "rclone config redacted"
description: "Print redacted (decrypted) config file, or the redacted config for a single remote."
slug: rclone_config_redacted
url: /commands/rclone_config_redacted/
versionIntroduced: v1.64
# autogenerated - DO NOT EDIT, instead edit the source code in cmd/config/redacted/ and as part of making a release run "make commanddocs"
---
# rclone config redacted
Print redacted (decrypted) config file, or the redacted config for a single remote.
## Synopsis
This prints a redacted copy of the config file, either the
whole config file or for a given remote.
The config file will be redacted by replacing all passwords and other
sensitive info with XXX.
This makes the config file suitable for posting online for support.
It should be double checked before posting as the redaction may not be perfect.
```
rclone config redacted [<remote>] [flags]
```
## Options
```
-h, --help help for redacted
```
See the [global flags page](/flags/) for global options not listed here.
# SEE ALSO
* [rclone config](/commands/rclone_config/) - Enter an interactive configuration session.