-
Notifications
You must be signed in to change notification settings - Fork 598
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
core: introduce interceptors #979
core: introduce interceptors #979
Conversation
Do interceptors cascade from services to service objects? I kind of expect that they would because other properties ( |
Yep, all service object requests go through the parent service. So if you set an interceptor on a service (Storage), all requests made from child service objects (Bucket, File) will have be affected. Maybe we should support one level up as well? Interceptors on the "require('gcloud')" level, so all Services are affected? |
Yes! I love that |
1b5905a
to
e9a8eeb
Compare
@callmehiphop updated the heck out of this one. There was some rethinking involved. PTAL. |
@@ -48,6 +50,8 @@ function Service(config, options) { | |||
this.authClient = this.makeAuthenticatedRequest.authClient; | |||
this.baseUrl = config.baseUrl; | |||
this.getCredentials = this.makeAuthenticatedRequest.getCredentials; | |||
this.globalInterceptors = arrify(options.interceptors_); |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
core: introduce interceptors
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: googleapis/googleapis@d5d35e0 Source-Link: googleapis/googleapis-gen@efcd3f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9
Fixes #916
To Dos
Doc preview:
... further down ...