syshttp.jar
syshttp.jar
File-backed cookie/token jars, keyed by host.
Jars live under one root, :func:store_root: SYSHTTP_HOME (under the
prefixes of :mod:syshttp.env), else the platform's per-user state
directory. Cookies go under <root>/cookies/<host>.txt (Netscape format),
tokens under <root>/tokens/<host>.token.
Token values are secrets: this module never logs or prints them. Files are
written 0o600 (directories 0o700) and replaced whole, with LF line
ends; a directory is created at the first write, not when a jar is built.
default_root(*, env=None)
The per-user state directory for jars when SYSHTTP_HOME is unset, a
directory syshttp under: %LOCALAPPDATA% on Windows,
~/Library/Application Support on macOS, $XDG_STATE_HOME (else
~/.local/state) elsewhere.
Source code in src/syshttp/jar.py
48 49 50 51 52 53 54 55 56 57 58 59 60 | |
safe_name(key)
A jar file name for a host: characters no filesystem takes (: of an
IPv6 literal on Windows, a /) become _.
Source code in src/syshttp/jar.py
42 43 44 45 | |
store_root(*, env=None)
The jar root: SYSHTTP_HOME, else :func:default_root.
Source code in src/syshttp/jar.py
63 64 65 66 67 | |