Page MenuHomePhabricator

[identity] Support service-to-service token in auth RPCs
ClosedPublic

Authored by bartek on Mar 20 2025, 3:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 18, 2:31 AM
Unknown Object (File)
Fri, Apr 18, 1:04 AM
Unknown Object (File)
Thu, Apr 10, 12:30 AM
Unknown Object (File)
Thu, Apr 3, 7:16 PM
Unknown Object (File)
Wed, Apr 2, 6:54 AM
Unknown Object (File)
Wed, Apr 2, 4:32 AM
Unknown Object (File)
Mon, Mar 31, 7:40 PM
Unknown Object (File)
Sun, Mar 30, 7:32 AM
Subscribers

Details

Summary

To call authenticated RPCs from other services, we have to support providing s2s token.
Modified the interceptor to look for the token, in addition to traditional Auth Metadata (uid + did + csat).

Test Plan

Tested locally, using GUI gRPC client and default localstack-stored service-to-service token.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Mar 23 2025, 11:48 PM
kamil added inline comments.
services/identity/src/grpc_services/authenticated.rs
101–107

Why are we not using verify_auth_credential here? It seems to be doing the same thing as for AuthorizationCredential::UserToken. Maybe this could make the code simpler.

This revision is now accepted and ready to land.Mar 24 2025, 3:13 AM
services/identity/src/grpc_services/authenticated.rs
101–107

verify_auth_credential is for non-Identity services. It calls the VerifyUserAccessToken Identity RPC which does this DDB call internally. It would create an unnecessary network call to self.