Proxy and Echo¶
Proxy¶
The proxy resource allows logged in users to fetch resources from other servers that do not support JSONP or CORS.
No conversion takes place, the content is fetched from the provided URL and relayed to the client: the status, the body and the headers Content-Type, Content-Length, Content-Encoding, Content-Language, Content-Disposition, Last-Modified, ETag and Expires of the upstream response are passed through, and the client's Accept header is forwarded. The response carries the header Content-Security-Policy: script-src 'none'; form-action 'none';. Redirects are followed, and every redirect target is checked in the same way as the original URL.
Usage¶
GET {base}/proxy?url={url}
GET {base}/{context-id}/proxy?url={url}
The context-scoped variant additionally requires read access to the context's resource. Only http and https URLs without embedded credentials are accepted, other URLs are answered with 400.
Anonymous requests¶
A whitelist consisting of domain names can be specified in the configuration file to allow anonymous user to fetch data from certain domains. The host names are specified as list with the property name entrystore.proxy.whitelist.anonymous. Host names are matched exactly (case-insensitive), i.e. subdomains have to be listed separately. Anonymous requests to other hosts are answered with 401. This applies to both /proxy and /{context-id}/proxy, and to redirect targets.
Whitelist example¶
entrystore.proxy.whitelist.anonymous.1=wikidata.org
entrystore.proxy.whitelist.anonymous.2=www.wikidata.org
entrystore.proxy.whitelist.anonymous.3=geonames.org
See Value syntax for how indexed lists are read.
Local sources¶
Due to security reasons any requests (both authorized or anonymous) to hosts matching any of the following regular expressions are blocked:
^localhost$(.+)\.local$^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$^\d+$:(IPv6 addresses)
In addition, any hosts that do not resolve into a "regular" public Unicast address, this means that any local, site local, loopback, link local, and multicast addresses are blocked. Hosts that cannot be resolved are blocked as well. Blocked requests are answered with 403.
Whitelisting local sources¶
To bypass this restrictive blacklist for local requests, it is possible to specify specific local hostnames in a whitelist:
entrystore.proxy.whitelist.local.1=specialserver.local
entrystore.proxy.whitelist.local.2=...
A whitelisted host is exempt from the hostname blacklist and from the loopback, site local and link local checks. In 6.x wildcard and multicast addresses remain blocked.
Limits (6.x)¶
entrystore.proxy.max-response-size=100MB
entrystore.proxy.max-redirects=15
entrystore.proxy.connect-timeout=30s
entrystore.proxy.read-timeout=60s
The values above are the defaults.
max-response-sizecaps the upstream body. A negative value removes the limit. An upstream response with a largerContent-Lengthis answered with 502; a body withoutContent-Lengthis cut off once it exceeds the limit.max-redirectsis the maximum number of redirects that are followed (0 to 50; with 0 any redirect is answered with 502). Exceeding it is answered with 502.- The timeouts apply per connection,
read-timeoutper socket read. A timeout or a refused connection is answered with 504, other failures to fetch the URL with 502.
max-redirects and the timeouts also apply to the resource DELETE with proxy described below.
EntryStore 5.x
In 5.x the response size is not limited and the other limits are not configurable (15 redirects, 30 s connect and 60 s read timeout). Anonymous requests to hosts that are not whitelisted are answered with 403.
Resource DELETE with proxy¶
For entries with type Link, Reference, or LinkReference, issuing DELETE /{context-id}/resource/{entry-id}?proxy=true sends a DELETE request to the entry's external resource URI. The entry itself is not removed; delete it separately with DELETE /{context-id}/entry/{entry-id}. The typical use case is removing a RowStore dataset that is tracked as a Reference entry: first delete the dataset with ?proxy=true, then the entry.
The request requires write access to the entry's resource. It is answered with 204 if the external server answers with a 2xx status, and with 502 otherwise (504 on a timeout); the body of the external response is not passed on.
EntryStore 5.x
In 5.x the status and body of the external server's response are passed on to the client.
SSRF protection¶
The proxied DELETE goes through the same URL-scheme allowlist (http, https only), private-network blacklist, DNS-resolution check, and DNS-pinned connection as the proxy GET endpoint above. Redirects are re-validated on every hop. Embedded credentials in the URL are rejected.
Whitelisting targets¶
Unlike the proxy GET whitelist (which is host-only), the DELETE whitelist is origin-based (scheme://host:port). Entries must specify the scheme and explicit port (or rely on the scheme's default port). This prevents an admin from accidentally trusting every port on a host with sensitive co-located services.
Example¶
entrystore.proxy.remote-resource.delete.whitelist.1=http://rowstore.internal:8282
entrystore.proxy.remote-resource.delete.whitelist.2=https://other-rowstore.example.com
http://x and http://x:80 are treated as the same origin (HTTP default port is normalised); the same holds for https:// and port 443.
Automatic trust for RowStore¶
When entrystore.rowstore.url is set, its origin is implicitly added to the DELETE trust set — no admin configuration needed to delete RowStore datasets in standard deployments. For split-host deployments where RowStore runs on a different origin than the one in entrystore.rowstore.url, add it explicitly to entrystore.proxy.remote-resource.delete.whitelist.
Echo¶
Usage¶
POST {base}/echo
Request body must be multipart form data.
The server replies with a <textarea> containing the contents of the submitted file (HTML escaped). The first line is always status:{statusCode} for easier client access to the HTTP status code from within a web browser. Errors are answered in the same way, with the error message after the status line.
The echo resource requires a logged in user (403 for guests). Requests that are not multipart/form-data are answered with 415. The file part may carry any name; a part named file is preferred.
The maximum payload is configured with entrystore.echo.max-file-size (6.x, default: 10MB, at most 64MB). Larger files are answered with 413. Keep spring.servlet.multipart.max-file-size at or above this value.