Skip to content

swiss/ld-prototype-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

Overview

The following describes the structure and usage of the authorization proxy.

Architecture

diagram

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/ and http://localhost:8001/ respectively.

  • The proxy endpoints are published under http://localhost:3000/sparql and http://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.

  1. By specifying a default role on start-up with the --role option. e.g. node ../config/upi --port 3001 --role admin
  2. By specifying the role header 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.

  1. Start the EWR and UPI triple store servers from ld-prototype-data.

    cd ld-prototype-data/UC-Serafe/client-POC
    ./startEWR.sh
    ./startUPI.sh
  2. Start the proxy as described above.

    cd ld-prototype-proxy/proxy
    npm run proxy-ewr
    npm run proxy-upi
  3. 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)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •