types: make pre auth key use bcrypt (#2853)
Some checks are pending
Build / build-nix (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=linux) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=linux) (push) Waiting to run
Check Generated Files / check-generated (push) Waiting to run
NixOS Module Tests / nix-module-check (push) Waiting to run
Tests / test (push) Waiting to run

This commit is contained in:
Kristoffer Dalby 2025-11-12 09:36:36 -06:00 committed by GitHub
parent e3ced80278
commit da9018a0eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1450 additions and 225 deletions

View file

@ -337,9 +337,10 @@ func TestPreAuthKeyCommand(t *testing.T) {
},
)
assert.NotEmpty(t, listedPreAuthKeys[1].GetKey())
assert.NotEmpty(t, listedPreAuthKeys[2].GetKey())
assert.NotEmpty(t, listedPreAuthKeys[3].GetKey())
// New keys show prefix after listing, so check the created keys instead
assert.NotEmpty(t, keys[0].GetKey())
assert.NotEmpty(t, keys[1].GetKey())
assert.NotEmpty(t, keys[2].GetKey())
assert.True(t, listedPreAuthKeys[1].GetExpiration().AsTime().After(time.Now()))
assert.True(t, listedPreAuthKeys[2].GetExpiration().AsTime().After(time.Now()))
@ -370,7 +371,7 @@ func TestPreAuthKeyCommand(t *testing.T) {
)
}
// Test key expiry
// Test key expiry - use the full key from creation, not the masked one from listing
_, err = headscale.Execute(
[]string{
"headscale",
@ -378,7 +379,7 @@ func TestPreAuthKeyCommand(t *testing.T) {
"--user",
"1",
"expire",
listedPreAuthKeys[1].GetKey(),
keys[0].GetKey(),
},
)
require.NoError(t, err)