Skip to content

Commit bdce3b3

Browse files
committed
addressing coderabbitai PR review comments
Signed-off-by: Omer Boehm <omerboehm@gmail.com>
1 parent c0b151c commit bdce3b3

4 files changed

Lines changed: 14 additions & 29 deletions

File tree

authbridge/demos/github-issue/aiac/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ preflight: ## Verify prerequisites (uv, venv, aiac.env, llm_conf.yaml, Keycloak
6464
echo " Copy aiac_agent/config/llm_conf.yaml.TEMPLATE and configure your LLM."; \
6565
exit 1; \
6666
}
67-
@$(PYTHON) -c 'import dotenv, yaml, keycloak, langgraph' 2>/dev/null || { \
67+
@$(PYTHON) -c 'import dotenv, yaml, keycloak, langgraph, langchain_core, langchain_openai, pydantic' 2>/dev/null || { \
6868
echo "ERROR: Python dependencies missing."; \
6969
echo " Run: uv pip install --python $(VENV)/bin/python -r ../../../requirements.txt"; \
7070
exit 1; \

authbridge/demos/github-issue/aiac/scripts/show-result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ def main() -> None:
8686
print(f" {GREEN}{RESET} {container}.{name}")
8787

8888
gen_dir = AIAC_DIR / "generated_configs"
89-
policy_files = sorted(gen_dir.glob("*_policy.yaml")) if gen_dir.exists() else []
89+
policy_files = list(gen_dir.glob("*_policy.yaml")) if gen_dir.exists() else []
9090
if policy_files:
91-
latest = policy_files[-1]
91+
latest = max(policy_files, key=lambda p: p.stat().st_mtime_ns)
9292
section(f"Last generated policy: {latest.name}")
9393
print(latest.read_text())
9494
else:

authbridge/demos/github-issue/demo-aiac.md

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ AI-driven policy management capabilities.
1919

2020
## Architecture Overview
2121

22-
```
22+
```txt
2323
Natural Language Policy Description
2424
2525
@@ -89,7 +89,7 @@ This lets you demonstrate finer-grained authorization: a user with full access c
8989
**Build and Load Container Images (if not already done)**
9090

9191
The agent and tool container images must be built locally and loaded into the kind cluster (they are not published to a public registry):
92-
```
92+
```bash
9393
cd <path-to>/agent-examples
9494

9595
# Build the GitHub tool image
@@ -216,12 +216,12 @@ kubectl get pod -n team1 -l app.kubernetes.io/name=git-issue-agent \
216216
```
217217

218218
Expected (proxy-sidecar mode, the cluster default):
219-
```
219+
```txt
220220
agent authbridge-proxy
221221
```
222222

223223
Or, in envoy-sidecar mode:
224-
```
224+
```txt
225225
agent envoy-proxy
226226
```
227227

@@ -234,7 +234,7 @@ kubectl get pods -n team1
234234
```
235235

236236
Expected output:
237-
```
237+
```txt
238238
NAME READY STATUS RESTARTS AGE
239239
git-issue-agent-xxxxxxxxxx-xxxxx 2/2 Running 0 2m
240240
github-tool-yyyyyyyyyyy-yyyyy 1/1 Running 0 3m
@@ -270,7 +270,7 @@ kubectl logs deployment/git-issue-agent -n team1 -c agent
270270
```
271271

272272
Expected:
273-
```
273+
```txt
274274
INFO: Started server process [17]
275275
INFO: Waiting for application startup.
276276
INFO: Application startup complete.
@@ -324,7 +324,7 @@ curl -s http://git-issue-agent:8080/.well-known/agent.json | jq .
324324
```
325325

326326
Expected :
327-
```
327+
```txt
328328
Agent card information (publicly accessible)
329329
```
330330

@@ -339,7 +339,7 @@ curl -s -X POST http://git-issue-agent:8080/ \
339339
```
340340

341341
Expected:
342-
```
342+
```txt
343343
{
344344
"error": "auth.unauthorized",
345345
"message": "missing Authorization header",
@@ -442,9 +442,6 @@ ALICE_TOKEN=$(curl -s -X POST \
442442
--data-urlencode "client_id=$CLIENT_ID" \
443443
--data-urlencode "client_secret=$CLIENT_SECRET" | jq -r ".access_token")
444444

445-
echo $ALICE_TOKEN
446-
echo $ALICE_TOKEN | cut -d. -f2- | base64 -d | jq .
447-
448445

449446
curl -s --max-time 300 \
450447
-H "Authorization: Bearer $ALICE_TOKEN" \
@@ -485,9 +482,6 @@ BOB_TOKEN=$(curl -s -X POST \
485482
echo "Bob token length: ${#BOB_TOKEN}"
486483
echo "Bob scopes: $(echo $BOB_TOKEN | cut -d. -f2 | base64 -d 2>/dev/null | jq -r '.scope')"
487484

488-
echo $BOB_TOKEN
489-
echo $BOB_TOKEN | cut -d. -f2- | base64 -d | jq .
490-
491485
curl -s --max-time 300 \
492486
-H "Authorization: Bearer $BOB_TOKEN" \
493487
-H "Content-Type: application/json" \
@@ -660,9 +654,6 @@ ALICE_TOKEN=$(curl -s -X POST \
660654
--data-urlencode "client_id=$CLIENT_ID" \
661655
--data-urlencode "client_secret=$CLIENT_SECRET" | jq -r ".access_token")
662656

663-
echo $ALICE_TOKEN
664-
echo $ALICE_TOKEN | cut -d. -f2- | base64 -d | jq .
665-
666657

667658
curl -s --max-time 300 \
668659
-H "Authorization: Bearer $ALICE_TOKEN" \
@@ -713,8 +704,6 @@ BOB_TOKEN=$(curl -s -X POST \
713704
echo "Bob token length: ${#BOB_TOKEN}"
714705
echo "Bob scopes: $(echo $BOB_TOKEN | cut -d. -f2- | base64 -d 2>/dev/null | jq -r '.scope')"
715706

716-
echo $BOB_TOKEN
717-
echo $BOB_TOKEN | cut -d. -f2- | base64 -d | jq .
718707

719708
curl -s --max-time 300 \
720709
-H "Authorization: Bearer $BOB_TOKEN" \
@@ -763,10 +752,6 @@ CHARLIE_TOKEN=$(curl -s -X POST \
763752
--data-urlencode "client_id=$CLIENT_ID" \
764753
--data-urlencode "client_secret=$CLIENT_SECRET" | jq -r ".access_token")
765754

766-
echo $CHARLIE_TOKEN
767-
echo $CHARLIE_TOKEN | cut -d. -f2- | base64 -d | jq .
768-
769-
770755

771756
curl -s --max-time 300 \
772757
-H "Authorization: Bearer $CHARLIE_TOKEN" \
@@ -828,7 +813,7 @@ echo -e "\n5. Sales is now just like Tech-support (\"Other personnel\"):"
828813
yq '.policy.sales[] | select(.client == "github-tool" and .role == "github-tool-aud")' generated_configs/permissive_policy_policy.yaml
829814
```
830815
Expected output :
831-
```bash
816+
```txt
832817
1. Developer has github-full-access:
833818
client: github-tool
834819
role: github-full-access

authbridge/demos/github-issue/setup_keycloak.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ def load_keycloak_config() -> Tuple[str, str]:
601601

602602
if not all([keycloak_url, realm, admin_username, admin_password]):
603603
raise ValueError(
604-
"Missing required environment variables. Please ensure .env file contains "
604+
"Missing required environment variables. Please ensure aiac.env file contains "
605605
"KEYCLOAK_URL, KEYCLOAK_ADMIN_USERNAME, KEYCLOAK_ADMIN_PASSWORD, and REALM_NAME"
606606
)
607607

@@ -1352,7 +1352,7 @@ def main_rbac(config_file: str, reset_only: bool = False):
13521352
map_scopes_to_roles(admin, realm, client_ids, scope_ids)
13531353

13541354
# 11. Create users
1355-
users_config = main_config["users"]
1355+
users_config = main_config.get("users", [])
13561356
create_users(admin, users_config)
13571357

13581358
# 12. Summary

0 commit comments

Comments
 (0)