diff --git a/core/lib/i18n/en.i18n.json b/core/lib/i18n/en.i18n.json index 2f81936481..7aa9ddaac1 100644 --- a/core/lib/i18n/en.i18n.json +++ b/core/lib/i18n/en.i18n.json @@ -268,10 +268,13 @@ "proxies_pageHeader": "Proxies", "proxies_addProxy": "Add proxy", "proxies_noProxiesFound": "No proxies found.", + "proxyBackendForm_advancedSettings_title": "Advanced settings", "proxyBackendForm_apiBasePath_helpText": "Base path added to all API requests. Example:", "proxyBackendForm_apiPort_helpText": "Port number on API server", + "proxyBackendForm_disableApiKey_helpText": "Optionally you can allow users to use your API without API key.", "proxyBackendForm_proxyBasePath_helpText": "Base path added to all Proxy requests. Example:", "proxyBackendForm_successMessage": "Settings saved.", + "proxyBackendForm_saveButton": "Save proxy settings", "proxyItem_editProxy": "Edit", "proxyItem_removeProxy": "Remove", "publishApiBackendOnApiUmbrella_successMessage": "API Backend successfully published.", @@ -446,6 +449,15 @@ "label": "Host" } } + }, + "ProxyBackends": { + "apiUmbrella": { + "settings": { + "disable_api_key": { + "label": "Disable API key" + } + } + } } }, "sdkCodeGeneratorModal_errorText": "Your file is not supported by the generator. Please upload the correct file", diff --git a/proxy_backends/client/form/form.html b/proxy_backends/client/form/form.html index a55052b55a..38b902a375 100644 --- a/proxy_backends/client/form/form.html +++ b/proxy_backends/client/form/form.html @@ -120,9 +120,34 @@ {{_ "proxyBackendForm_apiPort_helpText" }}

+ + +
+ + +

+ {{_ "proxyBackendForm_advancedSettings_title" }} +

+ + + {{> afQuickField + name="apiUmbrella.settings.disable_api_key" + type="boolean-checkbox" + }} + + +

+ {{_ "proxyBackendForm_disableApiKey_helpText" }} +

+
- + {{/ autoForm }} diff --git a/proxy_backends/client/form/form.less b/proxy_backends/client/form/form.less new file mode 100644 index 0000000000..a90b3e8220 --- /dev/null +++ b/proxy_backends/client/form/form.less @@ -0,0 +1,24 @@ +#advanced-settings { + margin-bottom: 0; + + .form-group { + margin-bottom: 0; + + .checkbox { + margin-bottom: 0.3em; + } + } + + .help-block { + margin-bottom: 0; + margin-top: 0; + + label { + margin-bottom: 0; + } + } +} + +#save-proxy-button { + margin-top: 1em; +} diff --git a/proxy_backends/collection/apiUmbrellaSchema.js b/proxy_backends/collection/apiUmbrellaSchema.js index 4e07cacf47..ec6ecd978e 100644 --- a/proxy_backends/collection/apiUmbrellaSchema.js +++ b/proxy_backends/collection/apiUmbrellaSchema.js @@ -1,6 +1,15 @@ // Utility import import { proxyBasePathRegEx, apiBasePathRegEx } from './regex'; + +const Settings = new SimpleSchema({ + 'disable_api_key': { + type: Boolean, + optional: true, + defaultValue: false + } +}); + const ApiUmbrellaSchema = new SimpleSchema({ id: { type: String, @@ -64,6 +73,10 @@ const ApiUmbrellaSchema = new SimpleSchema({ optional: true, label: 'API port', }, + settings: { + type: Settings, + optional: true, + }, }); export { ApiUmbrellaSchema };