api: implement automatic ssh key fetching from keycloak
All checks were successful
Build Container / Build Container (push) Successful in 1m26s
All checks were successful
Build Container / Build Container (push) Successful in 1m26s
This commit is contained in:
parent
279a45a9e8
commit
914a4497c7
6 changed files with 111 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from contextvars import ContextVar
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
|
|
@ -80,6 +81,18 @@ def main():
|
|||
action="append",
|
||||
default=[i for i in os.environ.get("DOORIS_STATIC_API_TOKENS", "").split(",") if bool(i)],
|
||||
)
|
||||
argp.add_argument(
|
||||
"--kc-ssh-attr-group",
|
||||
required=False,
|
||||
default=os.environ.get("DOORIS_KC_SSH_ATTR_GROUP", "dooris-ssh-keys"),
|
||||
)
|
||||
argp.add_argument(
|
||||
"--authorized-keys-file",
|
||||
required="DOORIS_AUTHORIZED_KEYS_FILE" not in os.environ,
|
||||
default=os.environ.get("DOORIS_AUTHORIZED_KEYS_FILE", None),
|
||||
type=Path,
|
||||
help="A file to which ssh authorized keys fetched from keycloak will be written",
|
||||
)
|
||||
args = argp.parse_args()
|
||||
|
||||
# setup logging
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue