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

fix: quarantine axios config #62

Merged
merged 7 commits into from
Jul 11, 2018
Merged

fix: quarantine axios config #62

merged 7 commits into from
Jul 11, 2018

Conversation

JustinBeckwith
Copy link
Contributor

@JustinBeckwith JustinBeckwith commented Jul 5, 2018

BREAKING CHANGE: The instance() and project() methods are much more selective about which properties they will accept. The only accepted properties are params and properties.

The instance() and project() methods also now directly return the data instead of a response object.


I am trying to quarantine the types for Axios. This makes it so we don't expose the underlying http client library. I am also making the set of acceptable properties you can pass into the options config an allow-list instead of an open obj, and checking it at runtime. This is potentially very breaking, so I want thoughts here from @stephenplusplus and @ofrobots :)

@codecov-io
Copy link

codecov-io commented Jul 5, 2018

Codecov Report

Merging #62 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #62   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          49     48    -1     
  Branches        9     12    +3     
=====================================
- Hits           49     48    -1
Impacted Files Coverage Δ
src/index.ts 100% <100%> (ø) ⬆️

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 5e74a0e...0a9ba18. Read the comment docs.

@JustinBeckwith
Copy link
Contributor Author

@ofrobots @stephenplusplus bumpity bumble bump

Copy link
Contributor

@ofrobots ofrobots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me, and quarantining axios sounds like the right thing to do. It would be good if @stephenplusplus can take a look too.

README.md Outdated
const res = await gcpMetadata.instance('hostname');
console.log(res.data) // ...All metadata properties
const data = await gcpMetadata.instance('hostname');
console.log(data) // ...All metadata properties

This comment was marked as spam.

pair.invalid}' is not a valid configuration option. Please use '${
pair.expected}' instead. This library is using Axios for requests. Please see https://github.com/axios/axios to learn more about the valid request options.`;
throw new Error(e);
Object.keys(options).forEach(key => {

This comment was marked as spam.

@JustinBeckwith JustinBeckwith merged commit 6a3b041 into googleapis:master Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants