adafruit_jwt
¶
JSON Web Token Authentication
Author(s): Brent Rubell
Implementation Notes¶
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s RSA library: https://github.com/adafruit/Adafruit_CircuitPython_RSA
Adafruit’s binascii library: https://github.com/adafruit/Adafruit_CircuitPython_RSA
- class adafruit_jwt.JWT¶
JSON Web Token helper for CircuitPython. Warning: JWTs are credentials, which can grant access to resources. Be careful where you paste them!
- Parameters:
algo (str) – Encryption algorithm used for claims. Can be None.
- class adafruit_jwt.STRING_TOOLS¶
Tools and helpers for URL-safe string encoding.
- static translate(s: str, table: dict) str ¶
Return a copy of the string in which each character has been mapped through the given translation table.
- Parameters:
s (string) – String to-be-character-table.
table (dict) – Translation table.
- static urlsafe_b64decode(payload: array | bytearray | bytes | memoryview | rgbmatrix.RGBMatrix | ulab.numpy.ndarray | str) str ¶
Decode bytes-like object or ASCII string using the URL and filesystem-safe alphabet
- Parameters:
payload (bytes) – bytes-like object or ASCII string
- static urlsafe_b64encode(payload: array | bytearray | bytes | memoryview | rgbmatrix.RGBMatrix | ulab.numpy.ndarray) str ¶
Encode bytes-like object using the URL- and filesystem-safe alphabet, which substitutes - instead of + and _ instead of / in the standard Base64 alphabet, and return the encoded bytes.
- Parameters:
payload (bytes) – bytes-like object.