Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,26 @@ jobs:

- name: Run knip
run: pnpm run knip
lint-rego:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: open-policy-agent/setup-regal@v2.0.0
with:
version: 0.41.1

- name: Lint
run: regal lint --format=github ./policy
test-rego:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v6

- name: Setup OPA
uses: open-policy-agent/setup-opa@v2
with:
version: 1.17.1

- name: Run OPA Tests
run: opa test ./policy -v
17 changes: 17 additions & 0 deletions .regal/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
rules:
imports:
unresolved-reference:
level: error
except-paths:
- data.keys
- data.possibleLocations
- data.users
- data.keys.kid
- data.users.avi.allowNoBrowser
- data.users.avi.allowNoOrigin
style:
line-length:
level: ignore
idiomatic:
directory-package-mismatch:
level: ignore
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
],
"[github-actions-workflow]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"opa.dependency_paths.opa": "${workspaceFolder}/policy/opa",
"opa.dependency_paths.regal": "${workspaceFolder}/policy/regal"
}
11 changes: 0 additions & 11 deletions example/README.md

This file was deleted.

118 changes: 0 additions & 118 deletions example/data/policy.rego

This file was deleted.

4 changes: 0 additions & 4 deletions example/nginx/Dockerfile

This file was deleted.

70 changes: 0 additions & 70 deletions example/nginx/auth.js

This file was deleted.

34 changes: 0 additions & 34 deletions example/nginx/default.conf

This file was deleted.

34 changes: 0 additions & 34 deletions example/nginx/nginx.conf

This file was deleted.

8 changes: 0 additions & 8 deletions example/opa.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions policy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
regal
opa
19 changes: 19 additions & 0 deletions policy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.PHONY: lint test check all

all: lint check test

lint:
./regal lint .

check:
./opa check . --strict

test:
./opa test . -v

init:
curl -L -o regal https://github.com/open-policy-agent/regal/releases/download/v0.41.1/regal_Linux_x86_64
chmod 755 ./regal
curl -L -o opa https://openpolicyagent.org/downloads/v1.17.1/opa_linux_amd64_static
chmod 755 ./opa

File renamed without changes.
3 changes: 2 additions & 1 deletion example/data/logs.rego → policy/logs.rego
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package system.log

# Mask the 'token' field in the query parameters
mask contains "/input/query/token"
mask contains "/input/query/token"

# Mask the 'x-api-key' field in the headers parameters
mask contains "/input/headers/x-api-key"

Expand Down
Loading
Loading