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

RPC calls and Axios #435

Open
wmoussa-gc opened this issue Aug 2, 2024 · 2 comments
Open

RPC calls and Axios #435

wmoussa-gc opened this issue Aug 2, 2024 · 2 comments

Comments

@wmoussa-gc
Copy link

It's odd that a package using RPC calls (HTTP/2 only) includes Axios (HTTP/1) in its logic. How do you recommend making this work?

@tafaust
Copy link

tafaust commented Sep 29, 2024

@wmoussa-gc There is only a single usage of axios in this repository here with the authenticate method to invoke the token endpoint.

I have implemented the same thing on my end before I discovered this library and the post request with HTTP/1 works because Zitadel *supports HTTP/2 but does not enforce it and will default to its REST API (afaiu). See the official docs here: https://zitadel.com/docs/self-hosting/manage/http2

However, I want to stress that axios does not support HTTP/2 and is therefore not a good choice. There exists alternatives (see this comparison from one of the alternatives). I would not recommend to use Ky because "zitadel-node" is (as the name suggests) not to be used in the browser because there is a high likelihood of leaking secrets.

@buehler FYI :)

@tafaust
Copy link

tafaust commented Sep 30, 2024

@wmoussa-gc I've seen this commit in a fork of this repo: 7d5dee8#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R7 which uses got. I think you could easily apply the patch through

git apply https://github.com/primerouting/zitadel-node/commit/7d5dee89db3b6f2629695f3160af8f592daf3cf8.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants