-
Notifications
You must be signed in to change notification settings - Fork 60
feat: sign() on AuthClient #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nt/projectId handling Add `_run` helper method to MessagingHttpClient, SecurityRulesHttpClient, and AppCheckHttpClient that accepts both client and projectId as callback parameters. This eliminates redundant `await app.client` calls and centralizes client/projectId retrieval logic.
…PI, local RSA signing, and service account impersonation
Coverage Report✅ Coverage 57.12% meets 40% threshold Coverage: 57.12% Minimum threshold: 40% |
…2 token retrieval
…feat/sign-auth-client
…e.lcov to .gitignore
| String endpoint, | ||
| String email, | ||
| ) async { | ||
| final url = Uri.parse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this technically not use the googleapis identidy provider api?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes and now that you mention it, seems the IAMCredentialsApi supports a different rootUrl, https://pub.dev/documentation/googleapis/latest/iamcredentials_v1/IAMCredentialsApi-class.html which I would refactor _signBlobWithEndpoint to use instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the nullable endpoint here allows projects to specify a different domain other than the default googleapis.com but I can't seem to find comprehensive docs on this except from here and then used like this to override service endpoints e.g. https://iamcredentials.googleapis.com -> https://iamcredentials.custom-universe-domain-here.com.
Also see how it's used in googleauth.ts
Adds a
sign()extension method toAuthClientthat enables cryptographic signing of data, matching the Node.js Firebase Admin SDK'sGoogleAuth.sign()behavior. The implementation automatically uses local signing when service account credentials with private keys are available, falling back to IAM API signing otherwise.New
sign()Extension MethodSigning behavior:
Implementation
Expando-based credential association:
Integration with Firebase Admin SDK:
Testing