diff --git a/integration/auth_key_test.go b/integration/auth_key_test.go index 3ff2c71d..e613d2ab 100644 --- a/integration/auth_key_test.go +++ b/integration/auth_key_test.go @@ -530,7 +530,7 @@ func TestAuthKeyDeleteKey(t *testing.T) { // DELETE the pre-auth key using the API t.Logf("Deleting pre-auth key ID %d using API", authKeyID) - err = headscale.DeleteAuthKey(userID, authKeyString) + err = headscale.DeleteAuthKey(authKeyID) require.NoError(t, err) t.Logf("Successfully deleted auth key") diff --git a/integration/control.go b/integration/control.go index 74f98ced..2c077183 100644 --- a/integration/control.go +++ b/integration/control.go @@ -27,7 +27,7 @@ type ControlServer interface { CreateAuthKey(user uint64, reusable bool, ephemeral bool) (*v1.PreAuthKey, error) CreateAuthKeyWithTags(user uint64, reusable bool, ephemeral bool, tags []string) (*v1.PreAuthKey, error) CreateAuthKeyWithOptions(opts hsic.AuthKeyOptions) (*v1.PreAuthKey, error) - DeleteAuthKey(user uint64, key string) error + DeleteAuthKey(id uint64) error ListNodes(users ...string) ([]*v1.Node, error) DeleteNode(nodeID uint64) error NodesByUser() (map[string][]*v1.Node, error) diff --git a/integration/hsic/hsic.go b/integration/hsic/hsic.go index 787c244f..e1389b61 100644 --- a/integration/hsic/hsic.go +++ b/integration/hsic/hsic.go @@ -1162,18 +1162,16 @@ func (t *HeadscaleInContainer) CreateAuthKeyWithTags( }) } -// DeleteAuthKey deletes an "authorisation key" for a User. +// DeleteAuthKey deletes an "authorisation key" by ID. func (t *HeadscaleInContainer) DeleteAuthKey( - user uint64, - key string, + id uint64, ) error { command := []string{ "headscale", - "--user", - strconv.FormatUint(user, 10), "preauthkeys", "delete", - key, + "--id", + strconv.FormatUint(id, 10), "--output", "json", }