ziti-tunnel-sdk-c
ziti-tunnel-sdk-c copied to clipboard
jwt is burned if context already loaded
The app doesn't allow loading an identity with the same name, but it will start enrollment and consume the JWT before it errors. It would be better if it checked for the colliding name first or just allowed two identities with the same name.
Please provide steps to reproduce
- In console, create identity "testid" and download "testid.jwt"
- In app, add identity "testid.jwt"
- In console, delete identity "testid"
- In console, create identity "testid" and download "testid.jwt"
- In app, add identity "testid.jwt"
- In app, observe error "context already loaded"
- In app, forget identity "testid"
- In app, add identity "testid.jwt"
- In app, observe error "enrollment failed" (because JWT was already burned)
- In console, re-create identity "testid" and download "testid.jwt"
- In app, add identitity "testid" SUCCESS
This is a service thing, should be in the tunnel repo.
@scareything I reproduced this with 0.22.19. ZET enrolls the new identity successfully before refusing to load the identity with a colliding context name. I think it should check for a collision before enrolling to avoid burning the token.
❯ ziti-edge-tunnel add --jwt "$(< /tmp/jwt)" --identity miniziti-client
received response <{"Success":false,"Error":"context already loaded","Code":500}
>