- JavaScript 88%
- HTML 12%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| config | ||
| doc/img | ||
| examples | ||
| proxy | ||
| webgui | ||
| LICENSE | ||
| LICENSE-3RD-PARTY.md | ||
| README.md | ||
ld-prototype-proxy
This repository contains an example implementation of a SPARQL proxy, which can be used to restrict access to any SPARQL endpoint.
More information can be found at:
- Prototyp «Linked Data» natürliche Personen (Bundeskanzlei DTI)
- Dezentrale Personenstammdaten mit Linked Data (Bern University of Applied Sciences)
Overview
The following describes the structure and usage of the authorization proxy.
Architecture
Installation
Install the necessary dependencies using Node Package Manager.
cd ld-prototype-proxy/proxy
npm install
Usage
Start the proxy using Node, by providing a configuration and a port (default is 3000).
cd ld-prototype-proxy/proxy
node ./main.js ../config/upi --port 3001
Alternatively a preconfigured proxy for the EWR and UPI endpoints can be started via Node Package Manager.
cd ld-prototype-proxy/proxy
npm run proxy-ewr
npm run proxy-upi
-
The provided configuration expects the EWR and UPI endpoints to be running under
http://localhost:8000/andhttp://localhost:8001/respectively. -
The proxy endpoints are published under
http://localhost:3000/sparqlandhttp://localhost:3001/sparql. -
Additionally the proxy provides a web interface under
http://localhost:3000/to issue SPARQL requests to itself.
Authentication & Authorization
The current version of the proxy does not yet feature any authentication methods.
For demonstration purposes a user's role can be provided directly in the following two ways.
- By specifying a default role on start-up with the
--roleoption. e.g.node ../config/upi --port 3001 --role admin - By specifying the
roleheader of the request.
Logging
The logging output is disabled by default. To enable it, set the following environment variable before starting the proxy.
Powershell:
$env:DEBUG='proxy:*'
Example
The following example shows the necessary steps to setup the proxy for the EWR and UPI endpoints.
-
Start the EWR and UPI triple store servers from ld-prototype-data.
cd ld-prototype-data/UC-Serafe/client-POC ./startEWR.sh ./startUPI.sh -
Start the proxy as described above.
cd ld-prototype-proxy/proxy npm run proxy-ewr npm run proxy-upi -
To test the proxy run the client script from ld-prototype-data with the following arguments.
cd ld-prototype-data/UC-Serafe/client-POC python3 serafe_sparql_query.py --queryNumber 5 --ewr_endpoint http://localhost:3000/sparql/ --upi_endpoint http://localhost:3001/sparql/
Note
The proxy is unable to execute federated queries.
Third-Party Libraries
This project uses the following third-party libraries:
YASGUI (Yet Another SPARQL GUI)
- Repository: YASGUI on GitHub
- License: MIT License