include credPairRemoteFields in RemoteConfigParsers

Avoids parse error when the fields are added to RemoteConfig at setup
time and it then gets parsed, also at setup time. After setup time, such
internally added fields are not a problem, because they're Accepted. So
it may not be necessary in all cases to list such internally added
fields, but I think it's a good idea to always do so.
This commit is contained in:
Joey Hess 2020-01-15 10:57:45 -04:00
parent 0706d9d093
commit 7f2bfd41d7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 12 additions and 2 deletions

View file

@ -13,6 +13,7 @@ module Remote.Helper.AWS where
import Annex.Common
import Creds
import Types.ProposedAccepted
import Types.RemoteConfig
import qualified Data.Map as M
import qualified Data.ByteString as B
@ -24,9 +25,12 @@ creds :: UUID -> CredPairStorage
creds u = CredPairStorage
{ credPairFile = fromUUID u
, credPairEnvironment = ("AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY")
, credPairRemoteField = Accepted "s3creds"
, credPairRemoteField = s3credsField
}
s3credsField :: RemoteConfigField
s3credsField = Accepted "s3creds"
data Service = S3 | Glacier
deriving (Eq)