Add keyring authentication to ILIAS CLI

This commit is contained in:
I-Al-Istannen 2021-05-23 23:04:18 +02:00
parent be4b1040f8
commit 8dd0689420

View File

@ -36,6 +36,11 @@ GROUP.add_argument(
metavar="USER_NAME", metavar="USER_NAME",
help="user name for authentication" help="user name for authentication"
) )
GROUP.add_argument(
"--keyring",
action=BooleanOptionalAction,
help="use the system keyring to store and retrieve passwords"
)
GROUP.add_argument( GROUP.add_argument(
"--link-file-redirect-delay", "--link-file-redirect-delay",
type=int, type=int,
@ -70,7 +75,11 @@ def load(
parser["auth:kit-ilias-web"] = {} parser["auth:kit-ilias-web"] = {}
auth_section = parser["auth:kit-ilias-web"] auth_section = parser["auth:kit-ilias-web"]
auth_section["type"] = "simple"
if args.keyring:
auth_section["type"] = "keyring"
else:
auth_section["type"] = "simple"
if args.username is not None: if args.username is not None:
auth_section["username"] = str(args.username) auth_section["username"] = str(args.username)