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

ziti-edge-tunnel: enroll should not overwrite json file on failure #268

Closed
dovholuknf opened this issue Jan 10, 2022 · 3 comments · Fixed by #533
Closed

ziti-edge-tunnel: enroll should not overwrite json file on failure #268

dovholuknf opened this issue Jan 10, 2022 · 3 comments · Fixed by #533
Assignees

Comments

@dovholuknf
Copy link
Member

right now issuing ziti-edge-tunnel enroll -j jwt.file -i identity.file twice will work the first time, then fail the second time. if you make this mistake you MUST recreate your identity file. it would be much better to not overwrite this file if the command is run twice

qrkourier added a commit to qrkourier/ziti-tunnel-sdk-c that referenced this issue Jan 12, 2022
@qrkourier qrkourier self-assigned this Jan 12, 2022
@qrkourier
Copy link
Member

Similarly, enroll token is used if output file is not writeable.

@qrkourier
Copy link
Member

@dovholuknf Is this a good first issue?

@qrkourier
Copy link
Member

This issue is valid and reproducible in 0.19.6.

❯ ./ziti-edge-tunnel version
v0.19.6

❯ ./ziti-edge-tunnel enroll -j ./client4.jwt -i ./client4.json

❯ ll client4.j*
-rw-rw-r-- 1 kbingham kbingham 955 Jul 28 09:44 client4.jwt
-rw-rw-r-- 1 kbingham kbingham 24K Jul 28 09:45 client4.json

❯ ./ziti-edge-tunnel enroll -j ./client4.jwt -i ./client4.json
[        0.320]   ERROR ziti-sdk:ziti_enroll.c:228 enroll_cb() failed to enroll with controller: https://7ce7e424-6a92-4ff2-9459-ebbba32346fa.production.netfoundry.io:443 INVALID_ENROLLMENT_TOKEN (The supplied token is not valid)
[        0.320]   ERROR ziti-edge-tunnel:ziti-edge-tunnel.c:1973 enroll_cb() enrollment failed: INVALID_ENROLLMENT_TOKEN(-3)

❯ ll client4.j*                                               
-rw-rw-r-- 1 kbingham kbingham 955 Jul 28 09:44 client4.jwt
-rw-rw-r-- 1 kbingham kbingham   0 Jul 28 09:45 client4.json

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

Successfully merging a pull request may close this issue.

2 participants