CLI
authkeys.cli
Command line, built on duho.
authkeys [-c FILE] resolve [user] prints a user's authorized keys (the
AuthorizedKeysCommand entry point); resolve is the default command, so
authkeys %u works in sshd_config. check, serve, cache and
completion are the other commands.
__all__ = ['AuthKeysCLI', 'Cache', 'Check', 'Resolve', 'Serve', 'main']
module-attribute
AuthKeysCLI
Bases: ConfigArgs, LoggingArgs, Cli
Pluggable AuthorizedKeysCommand provider for OpenSSH.
Cache
Bases: LoggingArgs, Cmd
Inspect, purge, or warm the resolved-keys cache.
action = 'show'
class-attribute
instance-attribute
One of: show, purge, warm
all = False
class-attribute
instance-attribute
purge: remove every entry
dry_run = False
class-attribute
instance-attribute
purge: list what would be removed, remove nothing
expired = False
class-attribute
instance-attribute
purge: only remove expired entries
source = None
class-attribute
instance-attribute
Limit purge to this source
user = None
class-attribute
instance-attribute
Limit purge to this user (uid), or warm this user
users = []
class-attribute
instance-attribute
warm: users to pre-resolve into the cache
__call__()
Source code in src/authkeys/cli/cache.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
Check
Bases: Resolve
Resolve a user's keys with per-source tracing on stderr (debugging).
__call__()
Source code in src/authkeys/cli/resolve.py
50 51 52 53 54 | |
Resolve
Bases: LoggingArgs, Cmd
Print the authorized SSH keys for a user (AuthorizedKeysCommand).
format = 'authorized_keys'
class-attribute
instance-attribute
Output format: authorized_keys (default, sshd wire format) or json
username = None
class-attribute
instance-attribute
User to resolve (defaults to the current user)
__call__()
Source code in src/authkeys/cli/resolve.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
Serve
Bases: LoggingArgs, Cmd
Run the unattended HTTP key server.
Every option may also be set in the [serve] table of the configuration or through AUTHKEYS_SERVE_
certificate = None
class-attribute
instance-attribute
PEM certificate (chain) to serve HTTPS with
key = None
class-attribute
instance-attribute
PEM private key for --certificate
listen = '127.0.0.1:8090'
class-attribute
instance-attribute
Where to listen: host:port, [v6]:port or :port, comma-separated (port 8090 by default)
max_connections = 64
class-attribute
instance-attribute
Most requests served at once (more get 503)
max_usernames = 16
class-attribute
instance-attribute
Most username parameters one request may carry
path = '/keys'
class-attribute
instance-attribute
URL path that serves keys
request_timeout = 10.0
class-attribute
instance-attribute
Seconds a connection may stay idle
__call__()
Source code in src/authkeys/cli/serve.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
main(argv=None)
Run the CLI with argv (default sys.argv[1:]) and return the status.
Source code in src/authkeys/cli/__init__.py
47 48 49 50 51 | |