policy/v2: add data-driven grants compatibility test with Tailscale SaaS captures
Rename tailscale_compat_test.go to tailscale_acl_compat_test.go to make room for the grants compat test. Add 237 GRANT-*.json golden test files captured from Tailscale SaaS and a data-driven test driver that compares headscale's grant filter compilation against real Tailscale behavior. Updates #2180
This commit is contained in:
parent
f74ea5b8ed
commit
0fa9dcaff8
239 changed files with 255198 additions and 0 deletions
50
hscontrol/policy/v2/testdata/grant_results/GRANT-H10.json
vendored
Normal file
50
hscontrol/policy/v2/testdata/grant_results/GRANT-H10.json
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"test_id": "GRANT-H10",
|
||||
"description": "",
|
||||
"timestamp": "2026-02-23T00:37:44Z",
|
||||
"error": true,
|
||||
"input": {
|
||||
"policy_file": "/home/kradalby/acl-explore/grant_policies/grant_h10.json",
|
||||
"full_policy": {
|
||||
"groups": {
|
||||
"group:admins": ["kratail2tid@passkey"],
|
||||
"group:developers": ["kristoffer@dalby.cc", "kratail2tid@passkey"],
|
||||
"group:monitors": ["monitorpasskeykradalby@passkey"],
|
||||
"group:empty": []
|
||||
},
|
||||
"tagOwners": {
|
||||
"tag:server": ["kratail2tid@passkey"],
|
||||
"tag:prod": ["kratail2tid@passkey"],
|
||||
"tag:client": ["kratail2tid@passkey"],
|
||||
"tag:router": ["kratail2tid@passkey"],
|
||||
"tag:exit": ["kratail2tid@passkey"]
|
||||
},
|
||||
"hosts": {
|
||||
"webserver": "100.108.74.26",
|
||||
"prodbox": "100.103.8.15",
|
||||
"internal": "10.0.0.0/8"
|
||||
},
|
||||
"autoApprovers": {
|
||||
"routes": {
|
||||
"10.33.0.0/16": ["tag:router"],
|
||||
"0.0.0.0/0": ["tag:exit"],
|
||||
"::/0": ["tag:exit"]
|
||||
}
|
||||
},
|
||||
"grants": [
|
||||
{
|
||||
"src": ["autogroup:self"],
|
||||
"dst": ["*"],
|
||||
"app": {
|
||||
"example.com/cap/test": [{}]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"grants_section": [{ "src": ["autogroup:self"], "dst": ["*"], "app": { "example.com/cap/test": [{}] } }],
|
||||
"api_endpoint": "https://api.tailscale.com/api/v2/tailnet/kratail2tid%40passkey/acl",
|
||||
"api_method": "POST",
|
||||
"api_response_code": 400,
|
||||
"api_response_body": { "message": "\"autogroup:self\" not valid on the src side of a rule" }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue