Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions core/lib/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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",
Expand Down
27 changes: 26 additions & 1 deletion proxy_backends/client/form/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,34 @@
{{_ "proxyBackendForm_apiPort_helpText" }}
</p>
</div>

<!-- Advanced settings -->
<div class="form-group col-md-12" id="advanced-settings">

<!-- Advanced settings block title -->
<h3>
{{_ "proxyBackendForm_advancedSettings_title" }}
</h3>

<!-- field input -->
{{> afQuickField
name="apiUmbrella.settings.disable_api_key"
type="boolean-checkbox"
}}

<!-- help text -->
<p class="help-block">
{{_ "proxyBackendForm_disableApiKey_helpText" }}
</p>
</div>
</div>

<!-- submit button -->
<button type="submit" class="btn btn-primary pull-right">Save proxy settings</button>
<button
type="submit"
class="btn btn-success pull-left"
id="save-proxy-button">
{{_ "proxyBackendForm_saveButton" }}
</button>
{{/ autoForm }}
</template>
24 changes: 24 additions & 0 deletions proxy_backends/client/form/form.less
Original file line number Diff line number Diff line change
@@ -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;
}
13 changes: 13 additions & 0 deletions proxy_backends/collection/apiUmbrellaSchema.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -64,6 +73,10 @@ const ApiUmbrellaSchema = new SimpleSchema({
optional: true,
label: 'API port',
},
settings: {
type: Settings,
optional: true,
},
});

export { ApiUmbrellaSchema };