Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming. Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
27 lines
1.2 KiB
Go
27 lines
1.2 KiB
Go
package store
|
|
|
|
import "testing"
|
|
|
|
func TestLocalityPublicationCeilingIntersection(t *testing.T) {
|
|
for _, domain := range []string{"public", "authenticated_acl"} {
|
|
for _, q := range []string{"inherit", "public", "authenticated_acl"} {
|
|
for _, st := range []string{"inherit", "public", "authenticated_acl"} {
|
|
for _, spot := range []string{"inherit", "public", "authenticated_acl"} {
|
|
chain := []LocalityPolicy{{Kind: "domain", Policy: domain}, {Kind: "quartier", Policy: q}, {Kind: "street", Policy: st}, {Kind: "spot", Policy: spot}}
|
|
allows, published := EvaluateLocalityPublication(chain)
|
|
wantCap := domain == "public" && q != "authenticated_acl" && st != "authenticated_acl" && spot != "authenticated_acl"
|
|
wantPublic := wantCap && (q == "public" || st == "public" || spot == "public")
|
|
if allows != wantCap || published != wantPublic {
|
|
t.Fatalf("chain=%+v result=%v,%v", chain, allows, published)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for _, policy := range []string{"inherit", "invalid", ""} {
|
|
if allows, published := EvaluateLocalityPublication([]LocalityPolicy{{Kind: "domain", Policy: policy}, {Kind: "spot", Policy: "public"}}); allows || published {
|
|
t.Fatal("invalid Domain policy failed open")
|
|
}
|
|
}
|
|
}
|