opiproject / sztp

Secure Zero Touch Provisioning (sZTP) in OPI
Apache License 2.0
20 stars 14 forks source link

refactor: unify http client creation #448

Open h0lyalg0rithm opened 1 month ago

h0lyalg0rithm commented 1 month ago

Proposed changes

Unifies the httpclient used across the application. No validation of server certificate

Types of changes

What types of changes does your code introduce to the repo? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

h0lyalg0rithm commented 1 month ago

maybe i miss something.... why not just daemon.downloadAndValidateImage() call to utils.doTLSRequest() ?

the method post vs get can be an argument

happy to discuss ....

@glimchb I kept them seperate because there were some extra http headers (basic auth etc) being passed in the post request, no sure if that was needed in the get version. I had to change inject the http client to enable testing for the caching feature.

glimchb commented 1 month ago

I had to change inject the http client to enable testing for the caching feature.

so this should be separate PR or separate commit just for injection

glimchb commented 2 weeks ago

@h0lyalg0rithm I wanna merge this

This branch cannot be rebased due to conflicts

please rebase ?