Add VS Code configuration files and demo token hashes for local testing
Build and Test / verify (push) Successful in 34s
Build and Push Container Image / build-and-push-image (push) Successful in 1m35s

This commit is contained in:
2026-07-12 14:59:34 +02:00
parent fc4f89804c
commit 3cb559ffbc
6 changed files with 113 additions and 3 deletions
+7
View File
@@ -0,0 +1,7 @@
{
"recommendations": [
"golang.go",
"redhat.vscode-yaml",
"ms-kubernetes-tools.vscode-kubernetes-tools"
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "F5: Debug authproxy (demo hashes)",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cmd/authproxy",
"env": {
"AUTH_PROXY_LISTEN_ADDR": ":8080",
"AUTH_PROXY_TOKEN_HASHES_DIR": "${workspaceFolder}/demo/token-hashes",
"AUTH_PROXY_LOG_LEVEL": "debug"
}
}
]
}
+47
View File
@@ -0,0 +1,47 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run authproxy (demo hashes)",
"type": "shell",
"command": "go run ./cmd/authproxy",
"options": {
"env": {
"AUTH_PROXY_LISTEN_ADDR": ":8080",
"AUTH_PROXY_TOKEN_HASHES_DIR": "${workspaceFolder}/demo/token-hashes",
"AUTH_PROXY_LOG_LEVEL": "debug"
}
},
"problemMatcher": []
},
{
"label": "Debug authproxy (delve, demo hashes)",
"type": "shell",
"command": "dlv debug ./cmd/authproxy",
"options": {
"env": {
"AUTH_PROXY_LISTEN_ADDR": ":8080",
"AUTH_PROXY_TOKEN_HASHES_DIR": "${workspaceFolder}/demo/token-hashes",
"AUTH_PROXY_LOG_LEVEL": "debug"
}
},
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
{
"label": "Check authproxy 200 (demo-token-1)",
"type": "shell",
"command": "http_code=$(curl -s -o /dev/null -w \"%{http_code}\" -H \"Authorization: Bearer demo-token-1\" http://localhost:8080/) && if [[ \"$http_code\" == \"200\" ]]; then echo \"OK: expected 200, got $http_code\"; else echo \"FAIL: expected 200, got $http_code\"; exit 1; fi",
"problemMatcher": []
},
{
"label": "Check authproxy 401 (wrong token)",
"type": "shell",
"command": "http_code=$(curl -s -o /dev/null -w \"%{http_code}\" -H \"Authorization: Bearer wrong\" http://localhost:8080/) && if [[ \"$http_code\" == \"401\" ]]; then echo \"OK: expected 401, got $http_code\"; else echo \"FAIL: expected 401, got $http_code\"; exit 1; fi",
"problemMatcher": []
}
]
}