sparqlwrapper icon indicating copy to clipboard operation
sparqlwrapper copied to clipboard

setCredentials is detached from endpoints

Open indeyets opened this issue 12 years ago • 2 comments

SPARQLWrapper takes endpoint and updateEndpoint URLs as parameters of constructor

separately, it has method named setCredentials which allows to specify login/password which are used for Basic Authentication.

There are 2 problems with this:

  1. it is possible to have endpoints for queries and updates which require different credentials and current implementation doesn't provide good solution for this case
  2. endpoints might use different authentication schemes (Digest Authentication, OAuth, …)

I propose to separate 3 entities:

  • Set of classes which implement informal Authentication protocol (I wonder if we can reuse some existing package for this)
  • Endpoint class which implements SPARQL 1.1 Protocol which take Auth-object as parameter and takes care of HTTP part
  • Wrapper which takes 1 or 2 Endpoint-objects as parameters and provides user-friendly API

This approach will also allow us to add endpoint implementations which use custom triplestore-specific protocols as a bonus.

This is a large change, so should be implemented in 2.x branch.

indeyets avatar Nov 14 '13 09:11 indeyets

I'm aware of the issue. But I'd need some more time for thinking an appropriate solution.

wikier avatar Nov 15 '13 09:11 wikier

@wikier do you think that my proposal won't be suitable?

I, actually, have 2 very specific use-cases related to this issue:

  1. SPARQL-endpoint protected by OAuth 1.0a
  2. SPARQL-proxy implemented via custom (not HTTP) protocol

indeyets avatar Nov 17 '13 12:11 indeyets