Skip to content

Commit 03a0b92

Browse files
madnificentpiemonkey
authored andcommitted
Add authorization endpoint to default mu-project
1 parent 40062e3 commit 03a0b92

File tree

6 files changed

+91
-6
lines changed

6 files changed

+91
-6
lines changed

config/authorization/config.ex

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
alias Acl.Accessibility.Always, as: AlwaysAccessible
2+
alias Acl.Accessibility.ByQuery, as: AccessByQuery
3+
alias Acl.GraphSpec.Constraint.Resource.AllPredicates, as: AllPredicates
4+
alias Acl.GraphSpec.Constraint.Resource.NoPredicates, as: NoPredicates
5+
alias Acl.GraphSpec.Constraint.ResourceFormat, as: ResourceFormatConstraint
6+
alias Acl.GraphSpec.Constraint.Resource, as: ResourceConstraint
7+
alias Acl.GraphSpec, as: GraphSpec
8+
alias Acl.GroupSpec, as: GroupSpec
9+
alias Acl.GroupSpec.GraphCleanup, as: GraphCleanup
10+
11+
defmodule Acl.UserGroups.Config do
12+
def user_groups do
13+
[
14+
# PUBLIC
15+
%GroupSpec{
16+
name: "public",
17+
useage: [:read, :write, :read_for_write],
18+
access: %AlwaysAccessible{},
19+
graphs: [ %GraphSpec{
20+
graph: "http://mu.semte.ch/graphs/public",
21+
constraint: %ResourceConstraint{
22+
resource_types: [
23+
"http://xmlns.com/foaf/0.1/Person"
24+
],
25+
inverse_predicates: %AllPredicates{}
26+
} } ] },
27+
# CLEANUP
28+
#
29+
%GraphCleanup{
30+
originating_graph: "http://mu.semte.ch/application",
31+
useage: [:write],
32+
name: "clean"
33+
}
34+
]
35+
end
36+
end

config/authorization/delta.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
defmodule Delta.Config do
2+
def targets do
3+
[ "http://delta-notifier" ]
4+
end
5+
end

config/delta/rules.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default [
2+
{
3+
match: {
4+
subject: { }
5+
},
6+
callback: {
7+
url: "http://resource/.mu/delta",
8+
method: "POST"
9+
},
10+
options: {
11+
resourceFormat: "v0.0.1",
12+
gracePeriod: 250,
13+
ignoreFromSelf: true
14+
}
15+
}
16+
];

config/resources/domain.lisp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
(in-package :mu-cl-resources)
22

3+
(setf *verify-content-type-header* nil)
4+
(setf *verify-accept-header* nil)
5+
(setf *include-count-in-paginated-responses* t)
6+
(setf *supply-cache-headers-p* t)
7+
(setf sparql:*experimental-no-application-graph-for-sudo-select-queries* t)
8+
(setf *cache-model-properties-p* t)
9+
310
;; reading in the domain.json
411
(read-domain-file "domain.json")

docker-compose.dev.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '3.4'
2+
3+
services:
4+
triplestore:
5+
ports:
6+
- "8890:8890"

docker-compose.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,32 @@ services:
1515
- resource:resource
1616
volumes:
1717
- ./config/dispatcher:/config
18+
resource:
19+
image: semtech/mu-cl-resources:1.22.1
20+
links:
21+
- database:database
22+
volumes:
23+
- ./config/resources:/config
1824
database:
25+
image: semtech/mu-authorization:0.6.0-beta.8
26+
environment:
27+
MU_SPARQL_ENDPOINT: "http://triplestore:8890/sparql"
28+
ERROR_ON_UNWRITTEN_DATA: "true"
29+
volumes:
30+
- ./config/authorization:/config
31+
labels:
32+
- "logging=true"
33+
delta-notifier:
34+
image: semtech/mu-delta-notifier:0.1.0
35+
volumes:
36+
- ./config/delta:/config
37+
labels:
38+
- "logging=true"
39+
triplestore:
1940
image: redpencil/virtuoso:1.1.0
2041
environment:
2142
SPARQL_UPDATE: "true"
2243
DEFAULT_GRAPH: "http://mu.semte.ch/application"
2344
volumes:
2445
- ./data/db:/data
2546
- ./config/virtuoso/virtuoso.ini:/data/virtuoso.ini
26-
resource:
27-
image: semtech/mu-cl-resources:1.21.1
28-
links:
29-
- database:database
30-
volumes:
31-
- ./config/resources:/config

0 commit comments

Comments
 (0)