openziti / ziti

The parent project for OpenZiti. Here you will find the executables for a fully zero trust, application embedded, programmable network @OpenZiti
https://openziti.io
Apache License 2.0
2.67k stars 153 forks source link

CLI - create identity - diplay token QR code #2418

Open qrkourier opened 7 hours ago

qrkourier commented 7 hours ago

It'd be convenient for adding identity to mobile edge app if ziti CLI could display the token as a QR code.

qrkourier commented 7 hours ago

Py analog w/ (L)ow error correction to minimize the resolution of the ascii-art so it will fit a more diverse set of terminals and displays. Still, due to the byte count of the raw token, it will be impossible to scan without zooming out to a font size that smaller than most terminals are typically displaying.

import sys
import pyqrcode
code = pyqrcode.create(sys.argv[1], error='L')
text = code.terminal()
print(text)