[services-lib] Support auth token in HTTP middleware
Summary:
Modified auth middleware to support both new auth token enum and existing UserIdentity (as a case of that enum). The whole credential enum is now parsed and stored in the extension.
The UserIdentity case is now handled by accessing the token enum first.
Depends on D9242
Test Plan:
Created test endpoint in reports service:
- Argument of type UserIdentity still works as before
- Argument of type AuthorizationCredential works the same way too - we're able to read UserIdentity from it
- If we pass services token where we expect UserIdentity, a HTTP 403 is returned
- Middleware gate (validation function) works for both
Reviewers: michal, varun, jon
Reviewed By: michal
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D9243