Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

chore: deprecate getRequestMetadata#414

Merged
JustinBeckwith merged 3 commits intogoogleapis:masterfrom
JustinBeckwith:deprecate-getRequestMetadata
Jul 12, 2018
Merged

chore: deprecate getRequestMetadata#414
JustinBeckwith merged 3 commits intogoogleapis:masterfrom
JustinBeckwith:deprecate-getRequestMetadata

Conversation

@JustinBeckwith
Copy link
Contributor

BREAKING CHANGE: The getRequestMetadata method has been deprecated on the IAM, OAuth2, JWT, and JWTAccess classes. The getRequestHeaders method should be used instead. The methods have a subtle difference: the getRequestMetadata method returns an object with a headers property, which contains the authorization header. The getRequestHeaders method simply returns the headers.

Old code

const client = await auth.getClient();
const res = await client.getRequestMetadata();
const headers = res.headers;

New code

const client = await auth.getClient();
const headers = await client.getRequestHeaders();

@JustinBeckwith JustinBeckwith requested review from a team and ofrobots July 7, 2018 19:34
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 7, 2018
@codecov-io
Copy link

codecov-io commented Jul 7, 2018

Codecov Report

Merging #414 into master will decrease coverage by 0.14%.
The diff coverage is 92.15%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #414      +/-   ##
========================================
- Coverage   95.15%    95%   -0.15%     
========================================
  Files          15     15              
  Lines         970    981      +11     
  Branches      217    217              
========================================
+ Hits          923    932       +9     
- Misses         47     49       +2
Impacted Files Coverage Δ
src/messages.ts 100% <100%> (ø) ⬆️
src/auth/iam.ts 100% <100%> (ø) ⬆️
src/auth/googleauth.ts 94.28% <100%> (ø) ⬆️
src/auth/oauth2client.ts 94.03% <80%> (-0.6%) ⬇️
src/auth/refreshclient.ts 90.47% <87.5%> (-0.23%) ⬇️
src/auth/jwtclient.ts 95.04% <90%> (ø) ⬆️
src/auth/jwtaccess.ts 98.24% <94.44%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63f4b38...f18c4bd. Read the comment docs.

This comment was marked as spam.

This comment was marked as spam.

@JustinBeckwith
Copy link
Contributor Author

gentle ping @google/google-node-team @google/yoshi-nodejs

@JustinBeckwith JustinBeckwith changed the title fix: deprecate getRequestMetadata chore: deprecate getRequestMetadata Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants