1 Configuration
External resources are configured in the configuration files:
Node/etc/conf.d/*.conf
// configure custom resource with key "myresourcekey" $CUSTOM_PROXY["myresourcekey"] = array( "baseUrl" => "http://myresource/basepath/{{param}}", "methods" => array( "GET", "POST" ), "permission" => array( "type" => 90001, "id" => 1 ), "headers" => array( "Authorization" => "Bearer <token>" ), "parameters" => array( "param" => array( "default" => "path", "values" => array("path", "otherpath") ) ) );
Property | Description | Mandatory |
---|---|---|
baseUrl | Base URL of the accessed resource. | yes |
methods | Optional list of allowed HTTP methods. Possible values are DELETE, GET, HEAD, OPTIONS, POST, PUT | no |
permission | GCMS Permission required for accessing the resource. | no |
headers | Optional list of request headers that will be added by the Proxy | no |
parameters | Optional parameters configuration. Parameters can be passed to the proxy as query parameters and will replace {{placeholder}} in the baseUrl. | no |
2 REST Endpoint
The base URL for the proxy is http(s)://[gcms.hostname]/CNPortletapp/rest/proxy/[key]
where [key]
is the configuration key of the resource.
Any path after the [key]
section will be appended to the configured baseUrl
.
All headers and query parameters sent to the proxy endpoints will be forwarded to the external resource.