Merge pull request #165 from fushinari/key-support-frontend

Expose api_keys in frontend settings
This commit is contained in:
Piero Toffanin 2021-11-07 15:09:47 -05:00 committed by GitHub
commit ffc0c1dcda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -764,6 +764,9 @@ def create_app(args):
frontendTimeout: frontendTimeout:
type: integer type: integer
description: Frontend translation timeout description: Frontend translation timeout
apiKeys:
type: boolean
description: Whether the API key database is enabled.
keyRequired: keyRequired:
type: boolean type: boolean
description: Whether an API key is required. description: Whether an API key is required.
@ -801,6 +804,7 @@ def create_app(args):
{ {
"charLimit": args.char_limit, "charLimit": args.char_limit,
"frontendTimeout": args.frontend_timeout, "frontendTimeout": args.frontend_timeout,
"apiKeys": args.api_keys,
"keyRequired": bool(args.api_keys and args.require_api_key_origin), "keyRequired": bool(args.api_keys and args.require_api_key_origin),
"suggestions": args.suggestions, "suggestions": args.suggestions,
"filesTranslation": not args.disable_files_translation, "filesTranslation": not args.disable_files_translation,