servirtium / servirtium-javascript

Service Virtualized HTTP - to help service test automation stay fast and consistent - for JavaScript/Node projects
https://servirtium.dev
MIT License
5 stars 0 forks source link

Is there support for cert auth against the target service ? #4

Open Nick-Minutello opened 5 months ago

Nick-Minutello commented 5 months ago

There doesn't appear to be. There doesn't appear to be a way to config the http-proxy-middleware...

paul-hammant commented 5 months ago

If the target service is on HTTPS, yes.

servirtium-javascript - might need some small upgrade work, to be honest.

Nick-Minutello commented 5 months ago

FWIW, have hacked the code to add an 'agent' option when creating the http-proxy-middleware - have gotten as far as making a request on the target server, but we are getting a dodgy response body (looks binary).

wickedwukong commented 5 months ago

hi Paul, it's been a long time, hope you are well :). We (I'm working with @Nick-Minutello , see the comment above) need to configure the Http Proxy Middleware so we can handle certificate authentication. We have made the change and it works. We would like to create a pull request. But we don't seem to have the permission to push a branch. Can it be relaxed for us?

Happy to contribute an example of how to set cert auth.

duong-se commented 5 months ago

hi Paul, it's been a long time, hope you are well :). We (I'm working with @Nick-Minutello , see the comment above) need to configure the Http Proxy Middleware so we can handle certificate authentication. We have made the change and it works. We would like to create a pull request. But we don't seem to have the permission to push a branch. Can it be relaxed for us?

Happy to contribute an example of how to set cert auth.

Hi, I hope you are doing well. Could you please fork the repository and clone it from your user branch. So in that case you can create PR from fork repository to main repository

wickedwukong commented 5 months ago

hi, I have create a PR by forking it. Could you please take a look? Thank you

paul-hammant commented 5 months ago

Hi Xuemin - indeed it has!

Thanks everyone for caring about this. I do intend to get back to Servirtium generally, but I have 1000 thinks on my backlog and stupidly think I can multitask.

I'm all for more modes of operation (http-proxy, agent) but one I don't want to lose is invisible service-in-the-middle where other than http (no SSL) the client does not know it is using Servirtium as there's no additional HTTP headers (not CORS added, not nothin). Anyway, I most times say yes to a PR ... my skills have been boosted every year by seeing other people's ideas in code :)

Nick-Minutello commented 5 months ago

Hi Paul, can you elaborate a bit more? Can you give some suggestion how you see this working? Happy to try implement them.

paul-hammant commented 5 months ago

Happy to answer, but I don't fully understand the question

wickedwukong commented 4 months ago

hi Paul, hi Duong, we have done the patching - we had to upgrade Github Actions and Typescript etc to get the build working.

We would like it to be published to NPM JS so we can pull it in as a dependency. We are not sure how we can do that. Can you help?

paul-hammant commented 4 months ago

I've forgotten how to do that. I'm sure I left notes for myself somewhere..

paul-hammant commented 4 months ago

Ugh, NPMJS password reset link email is delayed. After that I have to do 2nd factor, too

duong-se commented 4 months ago

@paul-hammant I saw @wickedwukong published 3 days ago, that's why I didnt do that