File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1- FROM ghcr.io/developmentseed/stac-auth-proxy:latest
1+ FROM ghcr.io/developmentseed/stac-auth-proxy:0.1.2
22
33ADD . /opa
44
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ services:
22 proxy :
33 depends_on :
44 - stac
5+ - opa
56 build :
67 context : examples/opa
78 environment :
@@ -17,3 +18,13 @@ services:
1718 - " 8000:8000"
1819 volumes :
1920 - ./src:/app/src
21+
22+ opa :
23+ image : openpolicyagent/opa:latest
24+ command : " run --server --addr=:8181 --watch /policies"
25+ ports :
26+ - " 8181:8181"
27+ volumes :
28+ - ./examples/opa/policies:/policies
29+ depends_on :
30+ - stac
Original file line number Diff line number Diff line change 1+ package example
2+
3+ # Helper function to check if user is authenticated
4+ is_authenticated if {
5+ input.payload != null
6+ }
7+
8+ # Return the list of permitted collections
9+ collections = [" naip" ] if {
10+ input.payload != null
11+ } else = [] if {
12+ true
13+ }
14+
15+ # Allow access to collections list - authenticated users see their permitted collections
16+ allow if {
17+ input.method == " GET"
18+ input.path = [" collections" ]
19+ }
You can’t perform that action at this time.
0 commit comments