Skip to content

Commit

Permalink
Merge branch 'feature/add-auth' into mail-service-update
Browse files Browse the repository at this point in the history
  • Loading branch information
piemonkey committed Sep 22, 2023
2 parents 47bc931 + c0d3046 commit 5155d5d
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 10 deletions.
36 changes: 36 additions & 0 deletions config/authorization/config.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
alias Acl.Accessibility.Always, as: AlwaysAccessible
alias Acl.Accessibility.ByQuery, as: AccessByQuery
alias Acl.GraphSpec.Constraint.Resource.AllPredicates, as: AllPredicates
alias Acl.GraphSpec.Constraint.Resource.NoPredicates, as: NoPredicates
alias Acl.GraphSpec.Constraint.ResourceFormat, as: ResourceFormatConstraint
alias Acl.GraphSpec.Constraint.Resource, as: ResourceConstraint
alias Acl.GraphSpec, as: GraphSpec
alias Acl.GroupSpec, as: GroupSpec
alias Acl.GroupSpec.GraphCleanup, as: GraphCleanup

defmodule Acl.UserGroups.Config do
def user_groups do
[
# PUBLIC
%GroupSpec{
name: "public",
useage: [:read, :write, :read_for_write],
access: %AlwaysAccessible{},
graphs: [ %GraphSpec{
graph: "http://mu.semte.ch/graphs/public",
constraint: %ResourceConstraint{
resource_types: [
"http://xmlns.com/foaf/0.1/Person"
],
inverse_predicates: %AllPredicates{}
} } ] },
# CLEANUP
#
%GraphCleanup{
originating_graph: "http://mu.semte.ch/application",
useage: [:write],
name: "clean"
}
]
end
end
5 changes: 5 additions & 0 deletions config/authorization/delta.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defmodule Delta.Config do
def targets do
[ "http://delta-notifier" ]
end
end
16 changes: 16 additions & 0 deletions config/delta/rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default [
{
match: {
subject: { }
},
callback: {
url: "http://resource/.mu/delta",
method: "POST"
},
options: {
resourceFormat: "v0.0.1",
gracePeriod: 250,
ignoreFromSelf: true
}
}
];
4 changes: 3 additions & 1 deletion config/dispatcher/dispatcher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ defmodule Dispatcher do
@json %{ accept: %{ json: true } }
@html %{ accept: %{ html: true } }

define_layers [ :static, :services, :fall_back, :not_found ]

# In order to forward the 'themes' resource to the
# resource service, use the following forward rule:
#
Expand All @@ -19,7 +21,7 @@ defmodule Dispatcher do
# Run `docker-compose restart dispatcher` after updating
# this file.

match "/*_", %{ last_call: true } do
match "/*_", %{ layer: :not_found } do
send_resp( conn, 404, "Route not found. See config/dispatcher.ex" )
end
end
7 changes: 7 additions & 0 deletions config/resources/domain.lisp
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
(in-package :mu-cl-resources)

(setf *verify-content-type-header* nil)
(setf *verify-accept-header* nil)
(setf *include-count-in-paginated-responses* t)
(setf *supply-cache-headers-p* t)
(setf sparql:*experimental-no-application-graph-for-sudo-select-queries* t)
(setf *cache-model-properties-p* t)

;; reading in the domain.json
(read-domain-file "domain.json")
6 changes: 6 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3.4'

services:
triplestore:
ports:
- "8890:8890"
31 changes: 22 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,32 @@ services:
- resource:resource
volumes:
- ./config/dispatcher:/config
resource:
image: semtech/mu-cl-resources:1.22.1
links:
- database:database
volumes:
- ./config/resources:/config
database:
image: redpencil/virtuoso:1.2.0-rc.1
image: semtech/mu-authorization:0.6.0-beta.8
environment:
MU_SPARQL_ENDPOINT: "http://triplestore:8890/sparql"
ERROR_ON_UNWRITTEN_DATA: "true"
volumes:
- ./config/authorization:/config
labels:
- "logging=true"
delta-notifier:
image: semtech/mu-delta-notifier:0.1.0
volumes:
- ./config/delta:/config
labels:
- "logging=true"
triplestore:
image: redpencil/virtuoso:1.1.0
environment:
SPARQL_UPDATE: "true"
DEFAULT_GRAPH: "http://mu.semte.ch/application"
ports:
- "8890:8890"
volumes:
- ./data/db:/data
- ./config/virtuoso/virtuoso.ini:/data/virtuoso.ini
resource:
image: semtech/mu-cl-resources:1.22.2
links:
- database:database
volumes:
- ./config/resources:/config

0 comments on commit 5155d5d

Please sign in to comment.