library icon indicating copy to clipboard operation
library copied to clipboard

Datastore authentication for workload identity

Open RohanM opened this issue 6 months ago • 0 comments

Description of Change

Fix authentication compatibility for datastore when using workload identity rather than manual credentials.

Related Issue

N/A

Motivation and Context

When using workload identity, getAuth() will return an object without email or key fields. If we provide null values when initialising the datastore client, this breaks authentication:

error: Serving an error page for /reading-history/teams.json?limit=5
message: 'The incoming JSON object does not contain a client_email field',

If instead we leave out any authentication details, the client will default to using the workload identity and successfully connect.

Checklist

  • [x] Ran npm run lint and updated code style accordingly
  • [x] npm run test passes
  • [x] PR has a description and all contributors/stakeholder are noted/cc'ed
  • [ ] tests are updated and/or added to cover new code
  • [ ] relevant documentation is changed and/or added

RohanM avatar Aug 16 '24 01:08 RohanM