-
Notifications
You must be signed in to change notification settings - Fork 227
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(subscription): support oidcToken #865
Conversation
@bcoe Code review wise this looks fine to me, but I don't know all the inner workings enough to give a yay/nay on the functionality. Do you mind taking a quick look tomorrow? (Or tag someone who would know...) |
Codecov Report
@@ Coverage Diff @@
## master #865 +/- ##
======================================
Coverage 83.5% 83.5%
======================================
Files 31 31
Lines 11269 11269
Branches 333 333
======================================
Hits 9410 9410
Misses 1858 1858
Partials 1 1 Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #865 +/- ##
==========================================
+ Coverage 83.46% 83.50% +0.03%
==========================================
Files 31 31
Lines 11246 11269 +23
Branches 332 333 +1
==========================================
+ Hits 9387 9410 +23
Misses 1858 1858
Partials 1 1 Continue to review full report at Codecov.
|
@stayradiated have you tested end to end with your branch against the actual service? |
...formatted.pushConfig, | ||
oidcToken: metadata.oidcToken, | ||
}; | ||
delete formatted.oidcToken; |
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.
I'm relatively green in this codebase, but mind clarifying why we need to delete the key off the formatted
object?
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.
It does seem to already be happening above it for formatted.pushEndpoint
and as well...
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.
Yeah, that was my take as well, oidcToken is just being treated like what's above. My main question is on the sort of systemic goodness of the patch - I don't understand the gestalt of the library enough to say yay or nay yet.
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.
I believe the changes here just expose access to the underlying API call, and is already exposed in other client libraries. With the exception of deleting the key (is this for memory management?) this is LGTM.
🤖 I have created a release \*beep\* \*boop\* --- ## [1.6.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.5.0...v1.6.0) (2020-03-04) ### Features * **subscription:** support oidcToken ([#865](https://www.github.com/googleapis/nodejs-pubsub/issues/865)) ([a786ca0](https://www.github.com/googleapis/nodejs-pubsub/commit/a786ca00bd27a6e098125d6b7b87edb11ea6ea0f)) * export protos in src/index.ts ([f32910c](https://www.github.com/googleapis/nodejs-pubsub/commit/f32910c3a7da5ce268084d7294094912ab696034)) ### Bug Fixes * **deps:** update to the latest google-gax to pull in grpc-js 0.6.18 ([#903](https://www.github.com/googleapis/nodejs-pubsub/issues/903)) ([78bd9e9](https://www.github.com/googleapis/nodejs-pubsub/commit/78bd9e97a913b5e2aa457c2a28fd849f67bf225e)) * send the ITimestamp protobuf to Pub/Sub for seeking, not JavaScript Date() ([#908](https://www.github.com/googleapis/nodejs-pubsub/issues/908)) ([0c1d711](https://www.github.com/googleapis/nodejs-pubsub/commit/0c1d711854d7397a0fc4d6e84ed090984a6e05dc)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Issue
It is currently not possible to create a new Subscription with the Service Account Email or Audience properties configured. These properties are part of the
PushConfig.oidcToken
field which is not being formatted correctly.Changes
Similar to the
pushEndpoint
option, when formatting the metadata of a Subscription, the property needs to be moved into thepushConfig
object.I have added tests and updated documentation for
PubSub.createSubscription
andSubscription.modifyPushConfig
.