-
Notifications
You must be signed in to change notification settings - Fork 639
Description
When using keyFilename upon initialization to specify the filename of JSON credentials, the .json extension seems to be required, otherwise the file will be interpreted as of another format.
My use case was when storing the gcp-keyfile.json in a Kubernetes secret:
apiVersion: v1
kind: Secret
metadata:
name: some-secret
type: Opaque
data:
# will be available as a file /path/to/secret/gcp-keyfile
gcp-keyfile: d2hhdGV2ZXIK...When using that keyFilename, an error would be thrown: Error: could not authorize request email is required, because google-cloud did not recognize the key as being of JSON type (I guess). Is that right?
The only way of solving the problem was to change the gcp-keyfile to gcp-keyfile.json
Now that I've solved my issues with that it seems quite intuitive (almost obvious I'd say) that the .json extension is important, but I've wasted some hours not understanding why the error was happening.
I think it might be important to make this clearer in the documentation in some way (I'd make a pr but do not understand the auth process so well..)
Might be related to #768