I'm following this Google tutorial to access my KMS public key value in Nodejs app, apparently I have an error due to missing permissions (because I can read the value from the console gcloud kms keys versions get-public-key). The error :
Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.
at GoogleAuth.getApplicationDefaultAsync
I created a service account with the required permissions (to read), how can I instantiate a KMS client with it ? (const client = new KeyManagementServiceClient();)
Thanks
EDIT 1 : I can get the key when I set an env var with the location of the SA : export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json"
How can I use the file itself (service-account-file.json) instead of env var ?