[identity] Add HTTP function to verify CSAT
Summary:
Added function that verifies Authorization header for valid CSAT.
The header format is compliant with what we have for HTTP services (blob, backup): Authorization: Bearer [base64-encoded JSON] - I could reuse some utils from comm-lib to easily achieve that.
Depends on D12302
Test Plan:
Created a dummy endpoint that calls verify_csat()? and returns HTTP 200. Verified the following:
- Missing Authorization header returns HTTP 401 Unauthorized
- Invalid header format returns HTTP 400 Bad request
- Missing "Bearer " prefix
- Invalid base64
- Invalid JSON - e.g. missing one of required fields
- Invalid credentials return HTTP 403 Forbidden
- HTTP 200 (func returns Ok(())) for valid credentials taken from identity-tokens table
Reviewers: varun, will, marcin
Reviewed By: varun
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D12303