mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-23 02:24:10 +00:00
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
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:
parent
e3ced80278
commit
da9018a0eb
21 changed files with 1450 additions and 225 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue