git-annex/Remote/Helper
Joey Hess e63dcbf36c
fix embedcreds=yes reversion
Fix bug that made enableremote of S3 and webdav remotes, that have
embedcreds=yes, fail to set up the embedded creds, so accessing the remotes
failed.

(Regression introduced in version 7.20200202.7 in when reworking all the
remote configs to be parsed.)

Root problem is that parseEncryptionConfig excludes all other config keys
except encryption ones, so it is then unable to find the
credPairRemoteField. And since that field is not required to be
present, it proceeds as if it's not, rather than failing in any visible
way.

This causes it to not find any creds, and so it does not cache
them. When when the S3 remote tries to make a S3 connection, it finds no
creds, so assumes it's being used in no-creds mode, and tries to find a
public url. With no public url available, it fails, but the failure doesn't
say a lack of creds is the problem.

Fix is to provide setRemoteCredPair with a ParsedRemoteConfig, so the full
set of configs of the remote can be parsed. A bit annoying to need to
parse the remote config before the full config (as returned by
setRemoteCredPair) is available, but this avoids the problem.

I assume webdav also had the problem by inspection, but didn't try to
reproduce it with it.

Also, getRemoteCredPair used getRemoteConfigValue to get a ProposedAccepted
String, but that does not seem right. Now that it runs that code, it
crashed saying it had just a String.

Remotes that have already been enableremoted, and so lack the cached creds
file will work after this fix, because getRemoteCredPair will extract
the creds from the remote config, writing the missing file.

This commit was sponsored by Ilya Shlyakhter on Patreon.
2020-05-21 14:35:30 -04:00
..
Chunked make storeKey throw exceptions 2020-05-13 14:03:00 -04:00
AWS.hs include credPairRemoteFields in RemoteConfigParsers 2020-01-15 10:57:45 -04:00
Chunked.hs fix embedcreds=yes reversion 2020-05-21 14:35:30 -04:00
Encryptable.hs fix encryption of content to gcrypt and git-lfs 2020-02-26 18:05:36 -04:00
ExportImport.hs convert removeExportDirectory to throw exception 2020-05-15 14:43:18 -04:00
Git.hs convert TopFilePath to use RawFilePath 2019-12-09 15:07:21 -04:00
Hooks.hs make retrieveKeyFile and retrieveKeyFileCheap throw exceptions 2020-05-13 17:07:07 -04:00
Http.hs make storeKey throw exceptions 2020-05-13 14:03:00 -04:00
Messages.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
P2P.hs make removeKey throw exceptions 2020-05-14 14:11:05 -04:00
ReadOnly.hs convert renameExport to throw exception 2020-05-15 15:08:09 -04:00
Special.hs make removeKey throw exceptions 2020-05-14 14:11:05 -04:00
Ssh.hs make removeKey throw exceptions 2020-05-14 14:11:05 -04:00