-
Notifications
You must be signed in to change notification settings - Fork 388
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
feat: add sign method to JWT #375
Conversation
src/auth/jwtclient.ts
Outdated
@@ -16,7 +16,7 @@ | |||
|
|||
import {GoogleToken} from 'gtoken'; | |||
import * as stream from 'stream'; | |||
|
|||
import * as crypto from 'crypto'; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Ah, this is the grand ole SignBlob API. This was a heavily-requested feature that originated from the Storage API. It's used for
While we're using this exclusively in Storage, I don't think it's only a Storage thing. If we follow the hierarchy of the API endpoint, I guess it's an "IAM" thing. That could go in common, but I think it's closer to an auth thing.
I'm not exactly sure about the different types. If you can find a |
Codecov Report
@@ Coverage Diff @@
## master #375 +/- ##
==========================================
- Coverage 94.76% 94.75% -0.02%
==========================================
Files 14 14
Lines 956 972 +16
Branches 198 201 +3
==========================================
+ Hits 906 921 +15
- Misses 50 51 +1
Continue to review full report at Codecov.
|
This all makes a lot more sense. Given that context, it can be used from the Compute client, or a JWT client, or whatever. I decided to just hang it off Thoughts? |
LGTM! |
@@ -16,7 +16,6 @@ | |||
|
|||
import {GoogleToken} from 'gtoken'; | |||
import stream from 'stream'; | |||
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@alexander-fenster @ofrobots this is ready for a good look over :) |
[sorry, I can only talk about browser stuff now] I'm fine if you merge it, I'll just move the |
@alexander-fenster this actually shouldn't matter! Since this change only works for Compute and JWT clients, it should have no bearing on a browser implementation. You should probably be stripping out everything but OAuth2Client in your webpack bundle come to think of it. |
The idea is to replicate what's available here. It's used in nodejs-storage, and is blocking the integration of the new
nodejs-common
intonodejs-storage
.@stephenplusplus I will admit that I don't entirely know what this is trying to do. Can you walk us through the scenarios in how this is used?
After we figure out where to stick this thing, I'll write tests 😆
FYI @alexander-fenster @callmehiphop