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

chore: deprecate getRequestMetadata #414

Merged
merged 3 commits into from
Jul 12, 2018
Merged

chore: deprecate getRequestMetadata #414

merged 3 commits into from
Jul 12, 2018

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 ofrobots and a team 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.

@@ -14,19 +14,25 @@
* limitations under the License.
*/

import {IncomingHttpHeaders} from 'http';

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
@JustinBeckwith JustinBeckwith merged commit f105d3a into googleapis:master Jul 12, 2018
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants