Skip to content
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

Merged

Conversation

stephenplusplus
Copy link
Contributor

Fixes #916

To Dos

  • Support gcloud-level interceptors.

Doc preview:

screen shot 2015-11-30 at 3 19 00 pm

... further down ...

screen shot 2015-11-30 at 8 19 53 pm

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 30, 2015
@callmehiphop
Copy link
Contributor

Do interceptors cascade from services to service objects? I kind of expect that they would because other properties (projectId) do.

@stephenplusplus
Copy link
Contributor Author

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?

@callmehiphop
Copy link
Contributor

Maybe we should support one level up as well? Interceptors on the "require('gcloud')" level, so all Services are affected?

Yes! I love that

@stephenplusplus
Copy link
Contributor Author

@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.

This comment was marked as spam.

callmehiphop added a commit that referenced this pull request Dec 1, 2015
@callmehiphop callmehiphop merged commit 5016ca7 into googleapis:master Dec 1, 2015
sofisl pushed a commit that referenced this pull request Nov 11, 2022
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 474338479

Source-Link: googleapis/googleapis@d5d35e0

Source-Link: googleapis/googleapis-gen@efcd3f9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9
@release-please release-please bot mentioned this pull request Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants