Skip to content

Commit

Permalink
[comm-lib] Let BlobServiceClient accept service-to-service token
Browse files Browse the repository at this point in the history
Summary:
Updated `BlobServiceClient` to accept service-to-service token requests. This means HTTP services that rely on this Blob client, can accept service-to-service token and pass it through to Blob Service.

In short, previously:
- `client -[CSAT]-> backup -[S2SToken]-> blob` was possible
- `identity -[S2SToken]-> backup -[S2SToken]-> blob` wasn't possible

This diff makes the latter possible too, by overriding the [[ https://github.com/CommE2E/comm/blob/d6b19bfe9914869e4eb8b2a99d6cb9fc0afb6686/shared/comm-lib/src/http/auth_service.rs#L31 | accepts_services_token() ]] for BlobServiceClient.

Test Plan: Ran Backup and Blob locally, supplied Backup request with service-to-service token instead of CSAT, made sure the `COMM_SERVICES_DISABLE_CSAT_VERIFICATION` is disabled. Request succeeded.

Reviewers: kamil, will, varun

Reviewed By: kamil

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D13318
  • Loading branch information
barthap committed Sep 13, 2024
1 parent 0192849 commit 8f96090
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shared/comm-lib/src/blob/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,8 @@ impl crate::http::auth_service::HttpAuthenticatedService for BlobServiceClient {
) -> Self {
self.with_authentication(auth_credential)
}

fn accepts_services_token(&self, _req: &actix_web::HttpRequest) -> bool {
true
}
}

0 comments on commit 8f96090

Please sign in to comment.