HomePhabricator
Diffusion Comm dbed4bc20c94

[identity] check that incoming requests contain valid auth token

Description

[identity] check that incoming requests contain valid auth token

Summary:

  • statically initialize config so that we can access it from request interceptor
  • write interceptor function that compares authorization key from request metadata with the config token value
  • remove config param from other functions now that the config is static

Test Plan:

  • first, ran the server and verified that the process exits if the AUTH_TOKEN variable is not present
  • then, set the env var and attempted to send requests to the server without any metadata; they were rejected as expected
  • lastly, sent a request with authorization key set in the metadata and received a successful response

Reviewers: jon, bartek, tomek

Reviewed By: jon

Subscribers: ashoat, atul

Differential Revision: https://phab.comm.dev/D6824

Details

Provenance
varunAuthored on Feb 21 2023, 3:31 PM
Reviewer
jon
Differential Revision
D6824: [identity] check that incoming requests contain valid auth token
Parents
rCOMMf55dc60eb786: [native] handle database operations errors in reducer
Branches
Unknown
Tags
Unknown