From 915b912c2904bd5622d3fe2b0b2d9ca2cac9f4f4 Mon Sep 17 00:00:00 2001 From: Mufeed Ali Date: Sat, 30 Oct 2021 21:01:50 +0530 Subject: [PATCH] Expose require_api_key_origin in frontend settings This is useful for applications that want to know beforehand if an API key is necessary before accessing the running instance. --- app/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/app.py b/app/app.py index 1115808..6561360 100644 --- a/app/app.py +++ b/app/app.py @@ -756,6 +756,9 @@ def create_app(args): frontendTimeout: type: integer description: Frontend translation timeout + keyRequired: + type: boolean + description: Whether an API key is required. suggestions: type: boolean description: Whether submitting suggestions is enabled. @@ -790,6 +793,7 @@ def create_app(args): { "charLimit": args.char_limit, "frontendTimeout": args.frontend_timeout, + "keyRequired": bool(args.api_keys and args.require_api_key_origin), "suggestions": args.suggestions, "filesTranslation": not args.disable_files_translation, "supportedFilesFormat": [] if args.disable_files_translation else frontend_argos_supported_files_format,