Skip to content

Commit

Permalink
remove js from config
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Theel committed Oct 18, 2023
1 parent bd14091 commit b3ad87c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 51 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ test:
./run-tests.sh

start-keycloak: stop-keycloak
docker-compose up -d
docker compose up -d

stop-keycloak:
docker-compose down
docker compose down

start-keycloak-old: stop-keycloak
docker-compose up -d

stop-keycloak-old:
docker-compose down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:
keycloak:
build: .
command: -Dauto-build -Dfeatures=preview
command: -Dauto-build -Dfeatures=preview -Dkeycloak.profile.feature.upload_scripts=enabled
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: secret
Expand All @@ -20,5 +20,5 @@ services:
retries: 5
volumes:
- ./testdata/gocloak-realm.json:/opt/keycloak/data/import/gocloak-realm.json
entrypoint: ["/opt/keycloak/bin/kc.sh", "start-dev --features=preview --import-realm"]
entrypoint: ["/opt/keycloak/bin/kc.sh", "start-dev --features=preview --import-realm --verbose"]

6 changes: 3 additions & 3 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

docker-compose down
docker-compose up -d
docker compose down
docker compose up -d

keycloakServer=http://localhost:8080
url="${keycloakServer}/health"
Expand All @@ -23,4 +23,4 @@ fi

go test -failfast -race -cover -coverprofile=coverage.out -covermode=atomic -p 10 -cpu 1,2 -bench . -benchmem ${ARGS[@]}

docker-compose down
docker compose down
45 changes: 1 addition & 44 deletions testdata/gocloak-realm.json
Original file line number Diff line number Diff line change
Expand Up @@ -741,50 +741,7 @@
"phone",
"offline_access",
"microprofile-jwt"
],
"authorizationSettings": {
"allowRemoteResourceManagement": true,
"policyEnforcementMode": "ENFORCING",
"resources": [
{
"name": "Default Resource",
"type": "urn:gocloak:resources:default",
"ownerManagedAccess": false,
"attributes": {},
"_id": "067438bb-1d4a-4c4d-b84f-a57344ef2b2b",
"uris": [
"/*"
]
}
],
"policies": [
{
"id": "16fdc33a-7384-4735-8b7e-5d15b8e8bdaf",
"name": "Default Policy",
"description": "A policy that grants access only for users within this realm",
"type": "js",
"logic": "POSITIVE",
"decisionStrategy": "AFFIRMATIVE",
"config": {
"code": "// by default, grants any permission associated with this policy\n$evaluation.grant();\n"
}
},
{
"id": "30cfeba8-79c4-493b-97c7-9e8c6e7c62c9",
"name": "Default Permission",
"description": "A permission that applies to the default resource type",
"type": "resource",
"logic": "POSITIVE",
"decisionStrategy": "UNANIMOUS",
"config": {
"defaultResourceType": "urn:gocloak:resources:default",
"applyPolicies": "[\"Default Policy\"]"
}
}
],
"scopes": [],
"decisionStrategy": "UNANIMOUS"
}
]
},
{
"id": "db4d47d3-31cd-49c7-a1c7-351e13da7907",
Expand Down

0 comments on commit b3ad87c

Please sign in to comment.