Conversation
|
There's a (recent) open PR for We're already maintaining our own fork of github.com/smallstep/zcrypto/x509, but it's heavily outdated and it has changed a lot internally. We should be good for now to just make this build with a small patch. We can look into getting closer to upstream later. My PR to the upstream for The hardest to get working correctly is github.com/chzyer/readline. It's possible to stub out the required functions, and that's what I did in my POC, but I don't think that's acceptable to the upstream. |
Changes in this PR include the things I needed to change in the CLI to make it compile to
js/wasm.Had to move around and refactor some code to fix import cycles and such. I'm not completely happy with the structure yet, but it's a start.
The
js/wasmbuild is not fully functional. There are things that are not supported in a browser environment, so these functions can't be used. Using mTLS (easily) is one of them. There are also things that aren't fully implemented yet, like the--offlinemode. Currently this functionality is stubbed, so that thejs/wasmbuild can at least compile. It would be cool to support this in the future, though, as this would allow running an offline instance ofstep-cain memory in a browser.Running
GOOS=js GOARCH=wasm go build -o ./html/test.wasm -tags nobadger,nobbolt cmd/step/main.gowill not result in a Wasm module yet. There are still some changes in dependencies to be completed:In my POC repo, using forks of those with dirty hacks, the Wasm compiles with the changes from this PR.