NatLibFi / Skosmos

Thesaurus and controlled vocabulary browser using SKOS and SPARQL
Other
229 stars 95 forks source link

Custom HTTP headers for SPARQL endpoint requests #1633

Open mielvds opened 6 months ago

mielvds commented 6 months ago

Description of the enhancement

This enhancement originates from a concrete use case where skos data is stored in a private SPARQL endpoint. Is it possible to configure a number of HTTP headers that are send to the SPARQL endpoint with every request? In particular, the Authorization header should be configurable. It could be that this is already possible, but I couldn't find anything in the configuration docs.

Who are the users that would benefit from the enhancement and how?

My organization (meemoo), but basically every organization who wants to publish concept schemes stored in a private endpoint.

What new functionalities would the enhancement make possible?

SKOSMOS would work on private endpoints.

Why is the enhancement important?

We cannot use SKOSMOS without duplicating our setup somehow, which is doable, but not preferred. Secured endpoints are also quite common.

osma commented 3 months ago

Thanks for opening the issue and sorry for the slow reaction. We (NatLibFi/Finto) don't currently have a need for this feature, but I understand your need.

I think this would be relatively simple to implement: add a new configuration setting (similar to sparqlEndpoint and sparqlGraph settings) by adding a method for reading it in GlobalConfig or VocabularyConfig or both; then use the value when performing SPARQL requests in GenericSparql.

A PR to implement this would be very welcome :)