Skip to content

Commit a3e8a93

Browse files
committed
Refactored OAuth and access requests
They have all moved to the end-user dataspace and do not need to extend `GraphStoreImpl` or `SPARQLEndpointImpl` anymore
1 parent 5c8c7e3 commit a3e8a93

File tree

20 files changed

+431
-1430
lines changed

20 files changed

+431
-1430
lines changed

config/system.trig

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,79 @@
5252
a:graphStore <http://fuseki-end-user:3030/ds/> ;
5353
a:quadStore <http://fuseki-end-user:3030/ds/> ;
5454
lapp:backendProxy <http://varnish-end-user/> .
55+
56+
# Anna dataspace admin
57+
58+
<urn:linkeddatahub:apps/anna/admin> a lapp:Application, lapp:AdminApplication ;
59+
dct:title "Anna admin" ;
60+
ldh:origin <https://admin.anna.localhost:4443> ;
61+
ldt:ontology <https://w3id.org/atomgraph/linkeddatahub/admin#> ;
62+
ldt:service <urn:linkeddatahub:services/anna/admin> ;
63+
ac:stylesheet <static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/admin/layout.xsl> ;
64+
lapp:endUserApplication <urn:linkeddatahub:apps/anna/end-user> ;
65+
lapp:frontendProxy <http://varnish-frontend:6060/> .
66+
67+
<urn:linkeddatahub:services/anna/admin> a sd:Service ;
68+
dct:title "Anna admin service" ;
69+
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
70+
sd:endpoint <http://fuseki-admin:3030/ds/> ;
71+
a:graphStore <http://fuseki-admin:3030/ds/> ;
72+
a:quadStore <http://fuseki-admin:3030/ds/> ;
73+
lapp:backendProxy <http://varnish-admin/> .
74+
75+
# Anna dataspace end-user
76+
77+
<urn:linkeddatahub:apps/anna/end-user> a lapp:Application, lapp:EndUserApplication ;
78+
dct:title "Anna" ;
79+
ldh:origin <https://anna.localhost:4443> ;
80+
ldt:ontology <https://anna.localhost:4443/ns#> ;
81+
ldt:service <urn:linkeddatahub:services/anna/end-user> ;
82+
lapp:adminApplication <urn:linkeddatahub:apps/anna/admin> ;
83+
lapp:frontendProxy <http://varnish-frontend:6060/> ;
84+
lapp:public true .
85+
86+
<urn:linkeddatahub:services/anna/end-user> a sd:Service ;
87+
dct:title "Anna service" ;
88+
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
89+
sd:endpoint <http://fuseki-end-user:3030/ds/> ;
90+
a:graphStore <http://fuseki-end-user:3030/ds/> ;
91+
a:quadStore <http://fuseki-end-user:3030/ds/> ;
92+
lapp:backendProxy <http://varnish-end-user/> .
93+
94+
# Bjørn dataspace admin
95+
96+
<urn:linkeddatahub:apps/bjorn/admin> a lapp:Application, lapp:AdminApplication ;
97+
dct:title "Bjørn admin" ;
98+
ldh:origin <https://admin.xn--bjrn-hra.localhost:4443> ;
99+
ldt:ontology <https://w3id.org/atomgraph/linkeddatahub/admin#> ;
100+
ldt:service <urn:linkeddatahub:services/bjorn/admin> ;
101+
ac:stylesheet <static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/admin/layout.xsl> ;
102+
lapp:endUserApplication <urn:linkeddatahub:apps/bjorn/end-user> ;
103+
lapp:frontendProxy <http://varnish-frontend:6060/> .
104+
105+
<urn:linkeddatahub:services/bjorn/admin> a sd:Service ;
106+
dct:title "Bjørn admin service" ;
107+
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
108+
sd:endpoint <http://fuseki-admin:3030/ds/> ;
109+
a:graphStore <http://fuseki-admin:3030/ds/> ;
110+
a:quadStore <http://fuseki-admin:3030/ds/> ;
111+
lapp:backendProxy <http://varnish-admin/> .
112+
113+
# Bjørn dataspace end-user
114+
115+
<urn:linkeddatahub:apps/bjorn/end-user> a lapp:Application, lapp:EndUserApplication ;
116+
dct:title "Bjørn" ;
117+
ldh:origin <https://xn--bjrn-hra.localhost:4443> ;
118+
ldt:ontology <https://xn--bjrn-hra.localhost:4443/ns#> ;
119+
ldt:service <urn:linkeddatahub:services/bjorn/end-user> ;
120+
lapp:adminApplication <urn:linkeddatahub:apps/bjorn/admin> ;
121+
lapp:frontendProxy <http://varnish-frontend:6060/> ;
122+
lapp:public true .
123+
124+
<urn:linkeddatahub:services/bjorn/end-user> a sd:Service ;
125+
dct:title "Bjørn service" ;
126+
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
127+
sd:endpoint <http://fuseki-end-user:3030/ds/> ;
128+
a:graphStore <http://fuseki-end-user:3030/ds/> ;
129+
a:quadStore <http://fuseki-end-user:3030/ds/> ;
130+
lapp:backendProxy <http://varnish-end-user/> .

platform/datasets/admin.trig

Lines changed: 14 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@prefix def: <https://w3id.org/atomgraph/linkeddatahub/default#> .
22
@prefix ldh: <https://w3id.org/atomgraph/linkeddatahub#> .
3-
@prefix ac: <https://w3id.org/atomgraph/client#> .
3+
@prefix ac: <https://w3id.org/atomgraph/client#> .
44
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
55
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6-
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy#> .
6+
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy#> .
77
@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
8-
@prefix sp: <http://spinrdf.org/sp#> .
8+
@prefix sp: <http://spinrdf.org/sp#> .
99
@prefix sioc: <http://rdfs.org/sioc/ns#> .
1010
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
1111
@prefix dct: <http://purl.org/dc/terms/> .
@@ -58,22 +58,6 @@
5858

5959
}
6060

61-
<access>
62-
{
63-
64-
<access> a foaf:Document ;
65-
dct:title "Access endpoint" .
66-
67-
}
68-
69-
<access/request>
70-
{
71-
72-
<access/request> a foaf:Document ;
73-
dct:title "Access request endpoint" .
74-
75-
}
76-
7761
# CONTAINERS
7862

7963
<queries/>
@@ -355,40 +339,6 @@ WHERE
355339

356340
}
357341

358-
<services/dbpedia/>
359-
{
360-
361-
<services/dbpedia/> a dh:Item ;
362-
sioc:has_container <queries/> ;
363-
dct:title "DBPedia" ;
364-
foaf:primaryTopic <services/dbpedia/#this> .
365-
366-
<services/dbpedia/#this>
367-
a sd:Service ;
368-
dct:title "DBPedia" ;
369-
dct:description "Public SPARQL endpoint providing access to the DBpedia knowledge base, a crowd-sourced community effort to extract structured information from Wikipedia and make this information available on the Web." ;
370-
sd:endpoint <https://dbpedia.org/sparql> ;
371-
sd:supportedLanguage sd:SPARQL11Query .
372-
373-
}
374-
375-
<services/wikidata/>
376-
{
377-
378-
<services/wikidata/> a dh:Item ;
379-
sioc:has_container <queries/> ;
380-
dct:title "Wikidata" ;
381-
foaf:primaryTopic <services/wikidata/#this> .
382-
383-
<services/wikidata/#this>
384-
a sd:Service ;
385-
dct:title "Wikidata" ;
386-
dct:description "Public SPARQL endpoint providing access to Wikidata, a free and open knowledge base that acts as central storage for the structured data of Wikimedia projects including Wikipedia, Wikivoyage, Wiktionary, Wikisource, and others." ;
387-
sd:endpoint <https://query.wikidata.org/sparql> ;
388-
sd:supportedLanguage sd:SPARQL11Query .
389-
390-
}
391-
392342
### ADMIN-SPECIFIC
393343

394344
@prefix lacl: <https://w3id.org/atomgraph/linkeddatahub/admin/acl#> .
@@ -437,38 +387,6 @@ WHERE
437387

438388
}
439389

440-
<oauth2/login>
441-
{
442-
443-
<oauth2/login> a foaf:Document ;
444-
dct:title "OAuth 2.0 login" .
445-
446-
}
447-
448-
<oauth2/authorize/google>
449-
{
450-
451-
<oauth2/authorize/google> a foaf:Document ;
452-
dct:title "Google OAuth2.0 authorization" .
453-
454-
}
455-
456-
<oauth2/login/orcid>
457-
{
458-
459-
<oauth2/login/orcid> a foaf:Document ;
460-
dct:title "ORCID OAuth2.0 login" .
461-
462-
}
463-
464-
<oauth2/authorize/orcid>
465-
{
466-
467-
<oauth2/authorize/orcid> a foaf:Document ;
468-
dct:title "ORCID OAuth2.0 authorization" .
469-
470-
}
471-
472390
<queries/construct-constructors/>
473391
{
474392

@@ -665,7 +583,7 @@ WHERE
665583
<acl/authorizations/access/#this> a acl:Authorization ;
666584
rdfs:label "Access description access" ;
667585
rdfs:comment "Allows non-authenticated access" ;
668-
acl:accessTo <access> ;
586+
acl:accessToClass ldh:Access ;
669587
acl:mode acl:Read ;
670588
acl:agentClass foaf:Agent, acl:AuthenticatedAgent .
671589

@@ -684,7 +602,7 @@ WHERE
684602
<acl/authorizations/access-request/#this> a acl:Authorization ;
685603
rdfs:label "Access request access" ;
686604
rdfs:comment "Allows non-authenticated access" ;
687-
acl:accessTo <access/request> ;
605+
acl:accessToClass ldh:AccessRequest ;
688606
acl:mode acl:Append ;
689607
acl:agentClass foaf:Agent, acl:AuthenticatedAgent .
690608

@@ -723,64 +641,26 @@ WHERE
723641
<acl/authorizations/oauth2-login/#this> a acl:Authorization ;
724642
rdfs:label "OAuth2 login access" ;
725643
rdfs:comment "Required to enable public OAuth2 login" ;
726-
acl:accessTo <oauth2/login> ;
644+
acl:accessToClass ldh:OAuthLogin ;
727645
acl:mode acl:Read ;
728646
acl:agentClass foaf:Agent .
729647

730648
}
731649

732-
# Google authorization
650+
# OAuth2 authorization
733651

734-
<acl/authorizations/authorize-google/>
652+
<acl/authorizations/oauth2-authorize/>
735653
{
736654

737-
<acl/authorizations/authorize-google/> a dh:Item ;
655+
<acl/authorizations/oauth2-authorize/> a dh:Item ;
738656
sioc:has_container <acl/authorizations/> ;
739-
dct:title "Google's OAuth2 authorization" ;
740-
foaf:primaryTopic <acl/authorizations/authorize-google/#this> .
657+
dct:title "OAuth2 authorization" ;
658+
foaf:primaryTopic <acl/authorizations/oauth2-authorize/#this> .
741659

742-
<acl/authorizations/authorize-google/#this> a acl:Authorization ;
743-
rdfs:label "Google's OAuth2 authorization" ;
660+
<acl/authorizations/oauth2-authorize/#this> a acl:Authorization ;
661+
rdfs:label "OAuth2 authorization" ;
744662
rdfs:comment "Required to enable public OAuth2 login" ;
745-
acl:accessTo <oauth2/authorize/google> ;
746-
acl:mode acl:Read ;
747-
acl:agentClass foaf:Agent .
748-
749-
}
750-
751-
# ORCID login
752-
753-
<acl/authorizations/oauth2-login-orcid/>
754-
{
755-
756-
<acl/authorizations/oauth2-login-orcid/> a dh:Item ;
757-
sioc:has_container <acl/authorizations/> ;
758-
dct:title "ORCID OAuth2 login access" ;
759-
foaf:primaryTopic <acl/authorizations/oauth2-login-orcid/#this> .
760-
761-
<acl/authorizations/oauth2-login-orcid/#this> a acl:Authorization ;
762-
rdfs:label "ORCID OAuth2 login access" ;
763-
rdfs:comment "Required to enable public ORCID OAuth2 login" ;
764-
acl:accessTo <oauth2/login/orcid> ;
765-
acl:mode acl:Read ;
766-
acl:agentClass foaf:Agent .
767-
768-
}
769-
770-
# ORCID authorization
771-
772-
<acl/authorizations/authorize-orcid/>
773-
{
774-
775-
<acl/authorizations/authorize-orcid/> a dh:Item ;
776-
sioc:has_container <acl/authorizations/> ;
777-
dct:title "ORCID's OAuth2 authorization" ;
778-
foaf:primaryTopic <acl/authorizations/authorize-orcid/#this> .
779-
780-
<acl/authorizations/authorize-orcid/#this> a acl:Authorization ;
781-
rdfs:label "ORCID's OAuth2 authorization" ;
782-
rdfs:comment "Required to enable public ORCID OAuth2 login" ;
783-
acl:accessTo <oauth2/authorize/orcid> ;
663+
acl:accessToClass ldh:OAuthAuthorize ;
784664
acl:mode acl:Read ;
785665
acl:agentClass foaf:Agent .
786666

platform/datasets/end-user.trig

Lines changed: 53 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@prefix def: <https://w3id.org/atomgraph/linkeddatahub/default#> .
22
@prefix ldh: <https://w3id.org/atomgraph/linkeddatahub#> .
3-
@prefix ac: <https://w3id.org/atomgraph/client#> .
3+
@prefix ac: <https://w3id.org/atomgraph/client#> .
44
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
55
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6-
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy#> .
6+
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy#> .
77
@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
8-
@prefix sp: <http://spinrdf.org/sp#> .
8+
@prefix sp: <http://spinrdf.org/sp#> .
99
@prefix sioc: <http://rdfs.org/sioc/ns#> .
1010
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
1111
@prefix dct: <http://purl.org/dc/terms/> .
@@ -58,22 +58,6 @@
5858

5959
}
6060

61-
<access>
62-
{
63-
64-
<access> a foaf:Document ;
65-
dct:title "Access endpoint" .
66-
67-
}
68-
69-
<access/request>
70-
{
71-
72-
<access/request> a foaf:Document ;
73-
dct:title "Access request endpoint" .
74-
75-
}
76-
7761
# CONTAINERS
7862

7963
<queries/>
@@ -355,6 +339,56 @@ WHERE
355339

356340
}
357341

342+
### END-USER-SPECIFIC
343+
344+
<access>
345+
{
346+
347+
<access> a ldh:Access ;
348+
dct:title "Access endpoint" .
349+
350+
}
351+
352+
<access/request>
353+
{
354+
355+
<access/request> a ldh:AccessRequest ;
356+
dct:title "Access request endpoint" .
357+
358+
}
359+
360+
<oauth2/login/google>
361+
{
362+
363+
<oauth2/login/google> a ldh:OAuthLogin ;
364+
dct:title "OAuth 2.0 login" .
365+
366+
}
367+
368+
<oauth2/authorize/google>
369+
{
370+
371+
<oauth2/authorize/google> a ldh:OAuthAuthorize ;
372+
dct:title "Google OAuth2.0 authorization" .
373+
374+
}
375+
376+
<oauth2/login/orcid>
377+
{
378+
379+
<oauth2/login/orcid> a ldh:OAuthLogin ;
380+
dct:title "ORCID OAuth2.0 login" .
381+
382+
}
383+
384+
<oauth2/authorize/orcid>
385+
{
386+
387+
<oauth2/authorize/orcid> a ldh:OAuthAuthorize ;
388+
dct:title "ORCID OAuth2.0 authorization" .
389+
390+
}
391+
358392
<services/dbpedia/>
359393
{
360394

0 commit comments

Comments
 (0)