Skip to content

Commit 5155d5d

Browse files
committed
Merge branch 'feature/add-auth' into mail-service-update
2 parents 47bc931 + c0d3046 commit 5155d5d

File tree

7 files changed

+95
-10
lines changed

7 files changed

+95
-10
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/dispatcher/dispatcher.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ defmodule Dispatcher do
99
@json %{ accept: %{ json: true } }
1010
@html %{ accept: %{ html: true } }
1111

12+
define_layers [ :static, :services, :fall_back, :not_found ]
13+
1214
# In order to forward the 'themes' resource to the
1315
# resource service, use the following forward rule:
1416
#
@@ -19,7 +21,7 @@ defmodule Dispatcher do
1921
# Run `docker-compose restart dispatcher` after updating
2022
# this file.
2123

22-
match "/*_", %{ last_call: true } do
24+
match "/*_", %{ layer: :not_found } do
2325
send_resp( conn, 404, "Route not found. See config/dispatcher.ex" )
2426
end
2527
end

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: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +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:
19-
image: redpencil/virtuoso:1.2.0-rc.1
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:
40+
image: redpencil/virtuoso:1.1.0
2041
environment:
2142
SPARQL_UPDATE: "true"
2243
DEFAULT_GRAPH: "http://mu.semte.ch/application"
23-
ports:
24-
- "8890:8890"
2544
volumes:
2645
- ./data/db:/data
2746
- ./config/virtuoso/virtuoso.ini:/data/virtuoso.ini
28-
resource:
29-
image: semtech/mu-cl-resources:1.22.2
30-
links:
31-
- database:database
32-
volumes:
33-
- ./config/resources:/config

0 commit comments

Comments
 (0)