Skip to content

Remove http2curl dependency #368

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

Closed
wants to merge 2 commits into from
Closed

Remove http2curl dependency #368

wants to merge 2 commits into from

Conversation

nicolai86
Copy link
Contributor

Instead of printing http requests to play around with, the API SDK should be easy to use by itself (expose client use cases) & lightweight so it itself can be easily vendored into 3rd party tools (e.g. terraform).

For now, I'd like to remove seemingly unnecessary dependencies (specifically logrus, http2curl & anonuuid), to ease getting my terraform provider for scaleway merged.

Looking at the AWS SDK itself, introducing a customer logger interface looks like the clean solution, which would allow us to re-introduced the http2curl logging functionality by allowing users of the SDK to inject a custom logger, which has functions to log http requests specifically; the user can then decide to use whatever mechanism he sees fit, which would allow us to push this dependency to the user, which should be preferred for an API SDK.

In this PR I'm just removing the http2curl dependency, without introducing a custom logger interface, to keep the PR small. If you like the idea I'll go ahead to get a proper logger interface setup.
The logger interface is required anyway to get logrus & anonuuid out of the picture, but that's a separate discussion.

Instead of printing http requests to play around with, the API SDK should be
lightweight so it itself can be easily vendored into 3rd party tools (e.g.
terraform).

Similar functionality could be introduced by allowing users of the SDK to inject
a custom logger, which has functions to log http requests specifically; the user
could then decide to use whatever mechanism he sees fit, which would allow us to
push this dependency to the user.
since the http2curl dependency is dropped, we can safely move the
hideAPICredentials to where it is being used.

Looking at similar golang based API SDKs, it might make sense to log sensitive
by default if debug logging is enabled; otherwise we're supporting verbose
logging w & w/o sensitive information, which makes configuration more
complicated.
@moul
Copy link
Contributor

moul commented Jun 20, 2016

👍 for creating logger interfaces and remove all the unnecessary dependencies for the API clients users

but we need to keep anonuuid and http2curl in the cli so we can continue to ask our users some outputs for support

@moul moul self-assigned this Jun 20, 2016
@moul
Copy link
Contributor

moul commented Jun 20, 2016

@QuentinPerez and I would be happy to help you on this point, do not hesitate if you feel it will take too much of your time

@nicolai86
Copy link
Contributor Author

@moul I understand that use case. Introducing a pluggable Logger would allow us to keep the current logging as is, while also being able to use the SDK without anonuuid, logrus and http2curl.

I'll open another PR which will introduce the Logger interface. thanks for the feedback.

@nicolai86 nicolai86 closed this Jun 20, 2016
@moul
Copy link
Contributor

moul commented Jun 20, 2016

Perfect, looking forward for your pull-request

@nicolai86 nicolai86 mentioned this pull request Jun 20, 2016
clement-gilbert pushed a commit to clement-gilbert/scaleway-cli that referenced this pull request Mar 3, 2022
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.

2 participants