integration: support auth keys without user

Add AuthKeyOptions to create auth keys owned by tags only.
This commit is contained in:
Kristoffer Dalby 2026-01-07 12:12:53 +01:00 committed by Kristoffer Dalby
parent 3b4b9a4436
commit 740d2b5a2c
3 changed files with 70 additions and 53 deletions

View file

@ -8,6 +8,7 @@ import (
policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2"
"github.com/juanfont/headscale/hscontrol/routes"
"github.com/juanfont/headscale/hscontrol/types"
"github.com/juanfont/headscale/integration/hsic"
"github.com/ory/dockertest/v3"
"tailscale.com/tailcfg"
)
@ -25,6 +26,7 @@ type ControlServer interface {
CreateUser(user string) (*v1.User, error)
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
ListNodes(users ...string) ([]*v1.Node, error)
DeleteNode(nodeID uint64) error