mirror of
https://github.com/juanfont/headscale.git
synced 2026-03-26 03:11:25 +01:00
gen: regenerate protobuf code
This commit is contained in:
committed by
Kristoffer Dalby
parent
eec54cbbf3
commit
0516c0ec37
@@ -2814,7 +2814,7 @@ func TestACLTagPropagation(t *testing.T) {
|
||||
assert.NotNil(c, node, "Node should still exist")
|
||||
|
||||
if node != nil {
|
||||
assert.ElementsMatch(c, tt.tagChange, node.GetValidTags(), "Tags should be updated")
|
||||
assert.ElementsMatch(c, tt.tagChange, node.GetTags(), "Tags should be updated")
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "verifying tag change applied")
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ func tagsEqual(actual, expected []string) bool {
|
||||
|
||||
// assertNodeHasTagsWithCollect asserts that a node has exactly the expected tags (order-independent).
|
||||
func assertNodeHasTagsWithCollect(c *assert.CollectT, node *v1.Node, expectedTags []string) {
|
||||
actualTags := node.GetValidTags()
|
||||
actualTags := node.GetTags()
|
||||
sortedActual := append([]string{}, actualTags...)
|
||||
sortedExpected := append([]string{}, expectedTags...)
|
||||
|
||||
@@ -78,7 +78,7 @@ func assertNodeHasTagsWithCollect(c *assert.CollectT, node *v1.Node, expectedTag
|
||||
|
||||
// assertNodeHasNoTagsWithCollect asserts that a node has no tags.
|
||||
func assertNodeHasNoTagsWithCollect(c *assert.CollectT, node *v1.Node) {
|
||||
assert.Empty(c, node.GetValidTags(), "Node %s should have no tags, but has: %v", node.GetName(), node.GetValidTags())
|
||||
assert.Empty(c, node.GetTags(), "Node %s should have no tags, but has: %v", node.GetName(), node.GetTags())
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
@@ -152,7 +152,7 @@ func TestTagsAuthKeyWithTagRequestDifferentTag(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetValidTags())
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetTags())
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "checking node state")
|
||||
|
||||
@@ -222,7 +222,7 @@ func TestTagsAuthKeyWithTagNoAdvertiseFlag(t *testing.T) {
|
||||
|
||||
if len(nodes) == 1 {
|
||||
node := nodes[0]
|
||||
t.Logf("Node registered with tags: %v", node.GetValidTags())
|
||||
t.Logf("Node registered with tags: %v", node.GetTags())
|
||||
assertNodeHasTagsWithCollect(c, node, []string{"tag:valid-owned"})
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "verifying node inherited tags from auth key")
|
||||
@@ -320,10 +320,10 @@ func TestTagsAuthKeyWithTagCannotAddViaCLI(t *testing.T) {
|
||||
|
||||
if len(nodes) == 1 {
|
||||
// If still only has original tag, that's the expected behavior
|
||||
if tagsEqual(nodes[0].GetValidTags(), []string{"tag:valid-owned"}) {
|
||||
t.Logf("Test 2.3 PASS: Tags unchanged after CLI attempt: %v", nodes[0].GetValidTags())
|
||||
if tagsEqual(nodes[0].GetTags(), []string{"tag:valid-owned"}) {
|
||||
t.Logf("Test 2.3 PASS: Tags unchanged after CLI attempt: %v", nodes[0].GetTags())
|
||||
} else {
|
||||
t.Logf("Test 2.3 FAIL: Tags changed unexpectedly to: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Test 2.3 FAIL: Tags changed unexpectedly to: %v", nodes[0].GetTags())
|
||||
assert.Fail(c, "Tags should not have changed")
|
||||
}
|
||||
}
|
||||
@@ -416,10 +416,10 @@ func TestTagsAuthKeyWithTagCannotChangeViaCLI(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
if tagsEqual(nodes[0].GetValidTags(), []string{"tag:valid-owned"}) {
|
||||
t.Logf("Test 2.4 PASS: Tags unchanged: %v", nodes[0].GetValidTags())
|
||||
if tagsEqual(nodes[0].GetTags(), []string{"tag:valid-owned"}) {
|
||||
t.Logf("Test 2.4 PASS: Tags unchanged: %v", nodes[0].GetTags())
|
||||
} else {
|
||||
t.Logf("Test 2.4 FAIL: Tags changed unexpectedly to: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Test 2.4 FAIL: Tags changed unexpectedly to: %v", nodes[0].GetTags())
|
||||
assert.Fail(c, "Tags should not have changed")
|
||||
}
|
||||
}
|
||||
@@ -509,7 +509,7 @@ func TestTagsAuthKeyWithTagAdminOverrideReauthPreserves(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("After admin assignment, tags are: %v", nodes[0].GetValidTags())
|
||||
t.Logf("After admin assignment, tags are: %v", nodes[0].GetTags())
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:second"})
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "verifying admin tag assignment")
|
||||
@@ -535,7 +535,7 @@ func TestTagsAuthKeyWithTagAdminOverrideReauthPreserves(t *testing.T) {
|
||||
if len(nodes) >= 1 {
|
||||
// Find the most recently updated node (in case a new one was created)
|
||||
node := nodes[len(nodes)-1]
|
||||
t.Logf("After reauth, tags are: %v", node.GetValidTags())
|
||||
t.Logf("After reauth, tags are: %v", node.GetTags())
|
||||
|
||||
// Expected: admin-assigned tags are preserved through reauth
|
||||
assertNodeHasTagsWithCollect(c, node, []string{"tag:second"})
|
||||
@@ -648,7 +648,7 @@ func TestTagsAuthKeyWithTagCLICannotModifyAdminTags(t *testing.T) {
|
||||
assert.Len(c, nodes, 1, "Should have exactly 1 node")
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("After CLI attempt, tags are: %v", nodes[0].GetValidTags())
|
||||
t.Logf("After CLI attempt, tags are: %v", nodes[0].GetTags())
|
||||
|
||||
// Expected: tags should remain unchanged (admin wins)
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:valid-owned", "tag:second"})
|
||||
@@ -726,7 +726,7 @@ func TestTagsAuthKeyWithoutTagCannotRequestTags(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetValidTags())
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetTags())
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "checking node state")
|
||||
|
||||
@@ -793,7 +793,7 @@ func TestTagsAuthKeyWithoutTagRegisterNoTags(t *testing.T) {
|
||||
assert.Len(c, nodes, 1)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Node registered with tags: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Node registered with tags: %v", nodes[0].GetTags())
|
||||
assertNodeHasNoTagsWithCollect(c, nodes[0])
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "verifying node has no tags")
|
||||
@@ -889,10 +889,10 @@ func TestTagsAuthKeyWithoutTagCannotAddViaCLI(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
if len(nodes[0].GetValidTags()) == 0 {
|
||||
if len(nodes[0].GetTags()) == 0 {
|
||||
t.Logf("Test 3.3 PASS: Tags still empty after CLI attempt")
|
||||
} else {
|
||||
t.Logf("Test 3.3 FAIL: Tags changed to: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Test 3.3 FAIL: Tags changed to: %v", nodes[0].GetTags())
|
||||
assert.Fail(c, "Tags should not have changed")
|
||||
}
|
||||
}
|
||||
@@ -1003,7 +1003,7 @@ func TestTagsAuthKeyWithoutTagCLINoOpAfterAdminWithReset(t *testing.T) {
|
||||
assert.Len(c, nodes, 1, "Should have exactly 1 node")
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("After --reset, tags are: %v", nodes[0].GetValidTags())
|
||||
t.Logf("After --reset, tags are: %v", nodes[0].GetTags())
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:valid-owned"})
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "admin tags should be preserved after --reset")
|
||||
@@ -1113,7 +1113,7 @@ func TestTagsAuthKeyWithoutTagCLINoOpAfterAdminWithEmptyAdvertise(t *testing.T)
|
||||
assert.Len(c, nodes, 1, "Should have exactly 1 node")
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("After empty --advertise-tags, tags are: %v", nodes[0].GetValidTags())
|
||||
t.Logf("After empty --advertise-tags, tags are: %v", nodes[0].GetTags())
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:valid-owned"})
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "admin tags should be preserved after empty --advertise-tags")
|
||||
@@ -1223,7 +1223,7 @@ func TestTagsAuthKeyWithoutTagCLICannotReduceAdminMultiTag(t *testing.T) {
|
||||
assert.Len(c, nodes, 1, "Should have exactly 1 node")
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("After CLI reduce attempt, tags are: %v", nodes[0].GetValidTags())
|
||||
t.Logf("After CLI reduce attempt, tags are: %v", nodes[0].GetTags())
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:valid-owned", "tag:second"})
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "admin tags should be preserved after CLI reduce attempt")
|
||||
@@ -1300,7 +1300,7 @@ func TestTagsUserLoginOwnedTagAtRegistration(t *testing.T) {
|
||||
assert.Len(c, nodes, 1, "Should have exactly 1 node")
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Node registered with tags: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Node registered with tags: %v", nodes[0].GetTags())
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:valid-owned"})
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "verifying node has advertised tag")
|
||||
@@ -1373,9 +1373,9 @@ func TestTagsUserLoginNonExistentTagAtRegistration(t *testing.T) {
|
||||
t.Logf("Test 1.2 PASS: Registration rejected - no nodes registered")
|
||||
} else {
|
||||
// If a node was registered, it should NOT have the non-existent tag
|
||||
assert.NotContains(c, nodes[0].GetValidTags(), "tag:nonexistent",
|
||||
assert.NotContains(c, nodes[0].GetTags(), "tag:nonexistent",
|
||||
"Non-existent tag should not be applied to node")
|
||||
t.Logf("Test 1.2: Node registered with tags: %v (non-existent tag correctly rejected)", nodes[0].GetValidTags())
|
||||
t.Logf("Test 1.2: Node registered with tags: %v (non-existent tag correctly rejected)", nodes[0].GetTags())
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "checking node registration result")
|
||||
}
|
||||
@@ -1442,9 +1442,9 @@ func TestTagsUserLoginUnownedTagAtRegistration(t *testing.T) {
|
||||
t.Logf("Test 1.3 PASS: Registration rejected - no nodes registered")
|
||||
} else {
|
||||
// If a node was registered, it should NOT have the unowned tag
|
||||
assert.NotContains(c, nodes[0].GetValidTags(), "tag:valid-unowned",
|
||||
assert.NotContains(c, nodes[0].GetTags(), "tag:valid-unowned",
|
||||
"Unowned tag should not be applied to node (tag:valid-unowned is owned by other-user)")
|
||||
t.Logf("Test 1.3: Node registered with tags: %v (unowned tag correctly rejected)", nodes[0].GetValidTags())
|
||||
t.Logf("Test 1.3: Node registered with tags: %v (unowned tag correctly rejected)", nodes[0].GetTags())
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "checking node registration result")
|
||||
}
|
||||
@@ -1509,7 +1509,7 @@ func TestTagsUserLoginAddTagViaCLIReauth(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Initial tags: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Initial tags: %v", nodes[0].GetTags())
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "checking initial tags")
|
||||
|
||||
@@ -1530,12 +1530,12 @@ func TestTagsUserLoginAddTagViaCLIReauth(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) >= 1 {
|
||||
t.Logf("Test 1.4: After CLI, tags are: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Test 1.4: After CLI, tags are: %v", nodes[0].GetTags())
|
||||
|
||||
if tagsEqual(nodes[0].GetValidTags(), []string{"tag:valid-owned", "tag:second"}) {
|
||||
if tagsEqual(nodes[0].GetTags(), []string{"tag:valid-owned", "tag:second"}) {
|
||||
t.Logf("Test 1.4 PASS: Both tags present after reauth")
|
||||
} else {
|
||||
t.Logf("Test 1.4: Tags are %v (may require manual reauth completion)", nodes[0].GetValidTags())
|
||||
t.Logf("Test 1.4: Tags are %v (may require manual reauth completion)", nodes[0].GetTags())
|
||||
}
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "checking tags after CLI")
|
||||
@@ -1601,7 +1601,7 @@ func TestTagsUserLoginRemoveTagViaCLIReauth(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Initial tags: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Initial tags: %v", nodes[0].GetTags())
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "checking initial tags")
|
||||
|
||||
@@ -1622,9 +1622,9 @@ func TestTagsUserLoginRemoveTagViaCLIReauth(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) >= 1 {
|
||||
t.Logf("Test 1.5: After CLI, tags are: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Test 1.5: After CLI, tags are: %v", nodes[0].GetTags())
|
||||
|
||||
if tagsEqual(nodes[0].GetValidTags(), []string{"tag:valid-owned"}) {
|
||||
if tagsEqual(nodes[0].GetTags(), []string{"tag:valid-owned"}) {
|
||||
t.Logf("Test 1.5 PASS: Only one tag after removal")
|
||||
}
|
||||
}
|
||||
@@ -1697,7 +1697,7 @@ func TestTagsUserLoginCLINoOpAfterAdminAssignment(t *testing.T) {
|
||||
|
||||
if len(nodes) == 1 {
|
||||
nodeID = nodes[0].GetId()
|
||||
t.Logf("Step 1: Node %d registered with tags: %v", nodeID, nodes[0].GetValidTags())
|
||||
t.Logf("Step 1: Node %d registered with tags: %v", nodeID, nodes[0].GetTags())
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "waiting for initial registration")
|
||||
|
||||
@@ -1710,7 +1710,7 @@ func TestTagsUserLoginCLINoOpAfterAdminAssignment(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Step 2: After admin assignment, tags: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Step 2: After admin assignment, tags: %v", nodes[0].GetTags())
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:second"})
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "verifying admin assignment")
|
||||
@@ -1731,7 +1731,7 @@ func TestTagsUserLoginCLINoOpAfterAdminAssignment(t *testing.T) {
|
||||
assert.Len(c, nodes, 1, "Should have exactly 1 node")
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Step 3: After CLI, tags are: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Step 3: After CLI, tags are: %v", nodes[0].GetTags())
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:second"})
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "admin tags should be preserved - CLI advertise-tags should be no-op")
|
||||
@@ -1816,7 +1816,7 @@ func TestTagsUserLoginCLICannotRemoveAdminTags(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("After admin assignment, tags: %v", nodes[0].GetValidTags())
|
||||
t.Logf("After admin assignment, tags: %v", nodes[0].GetTags())
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:valid-owned", "tag:second"})
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "verifying admin assignment")
|
||||
@@ -1837,7 +1837,7 @@ func TestTagsUserLoginCLICannotRemoveAdminTags(t *testing.T) {
|
||||
assert.Len(c, nodes, 1, "Should have exactly 1 node")
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Test 1.7: After CLI, tags are: %v", nodes[0].GetValidTags())
|
||||
t.Logf("Test 1.7: After CLI, tags are: %v", nodes[0].GetTags())
|
||||
assertNodeHasTagsWithCollect(c, nodes[0], []string{"tag:valid-owned", "tag:second"})
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "admin tags should be preserved - CLI cannot remove them")
|
||||
@@ -1912,7 +1912,7 @@ func TestTagsAuthKeyWithTagRequestNonExistentTag(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetValidTags())
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetTags())
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "checking node state")
|
||||
|
||||
@@ -1983,7 +1983,7 @@ func TestTagsAuthKeyWithTagRequestUnownedTag(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetValidTags())
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetTags())
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "checking node state")
|
||||
|
||||
@@ -2058,7 +2058,7 @@ func TestTagsAuthKeyWithoutTagRequestNonExistentTag(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetValidTags())
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetTags())
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "checking node state")
|
||||
|
||||
@@ -2129,7 +2129,7 @@ func TestTagsAuthKeyWithoutTagRequestUnownedTag(t *testing.T) {
|
||||
assert.NoError(c, err)
|
||||
|
||||
if len(nodes) == 1 {
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetValidTags())
|
||||
t.Logf("Node registered with tags: %v (expected rejection)", nodes[0].GetTags())
|
||||
}
|
||||
}, 10*time.Second, 500*time.Millisecond, "checking node state")
|
||||
|
||||
@@ -2202,7 +2202,7 @@ func TestTagsAdminAPICannotSetNonExistentTag(t *testing.T) {
|
||||
|
||||
if len(nodes) == 1 {
|
||||
nodeID = nodes[0].GetId()
|
||||
t.Logf("Node %d registered with tags: %v", nodeID, nodes[0].GetValidTags())
|
||||
t.Logf("Node %d registered with tags: %v", nodeID, nodes[0].GetTags())
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "waiting for registration")
|
||||
|
||||
@@ -2275,7 +2275,7 @@ func TestTagsAdminAPICanSetUnownedTag(t *testing.T) {
|
||||
|
||||
if len(nodes) == 1 {
|
||||
nodeID = nodes[0].GetId()
|
||||
t.Logf("Node %d registered with tags: %v", nodeID, nodes[0].GetValidTags())
|
||||
t.Logf("Node %d registered with tags: %v", nodeID, nodes[0].GetTags())
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "waiting for registration")
|
||||
|
||||
@@ -2359,7 +2359,7 @@ func TestTagsAdminAPICannotRemoveAllTags(t *testing.T) {
|
||||
|
||||
if len(nodes) == 1 {
|
||||
nodeID = nodes[0].GetId()
|
||||
t.Logf("Node %d registered with tags: %v", nodeID, nodes[0].GetValidTags())
|
||||
t.Logf("Node %d registered with tags: %v", nodeID, nodes[0].GetTags())
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "waiting for registration")
|
||||
|
||||
@@ -2442,7 +2442,7 @@ func TestTagsAdminAPICannotSetInvalidFormat(t *testing.T) {
|
||||
|
||||
if len(nodes) == 1 {
|
||||
nodeID = nodes[0].GetId()
|
||||
t.Logf("Node %d registered with tags: %v", nodeID, nodes[0].GetValidTags())
|
||||
t.Logf("Node %d registered with tags: %v", nodeID, nodes[0].GetTags())
|
||||
}
|
||||
}, 30*time.Second, 500*time.Millisecond, "waiting for registration")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user