store: host_credentials becomes kind-aware (repo + admin slots)
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.dcglab.co.uk/steve/restic-manager/internal/store"
|
||||
)
|
||||
|
||||
// TestEnrollmentTransfersRepoCreds verifies the round-trip:
|
||||
@@ -57,12 +59,12 @@ func TestEnrollmentTransfersRepoCreds(t *testing.T) {
|
||||
hostID, "host42", "linux", "amd64", "2026-01-01T00:00:00Z"); err != nil {
|
||||
t.Fatalf("insert host: %v", err)
|
||||
}
|
||||
if err := st.SetHostCredentials(ctx, hostID, encForHost); err != nil {
|
||||
if err := st.SetHostCredentials(ctx, hostID, store.CredKindRepo, encForHost); err != nil {
|
||||
t.Fatalf("set host credentials: %v", err)
|
||||
}
|
||||
|
||||
// host_credentials row should now hold the host-bound ciphertext.
|
||||
got, err := st.GetHostCredentials(ctx, hostID)
|
||||
got, err := st.GetHostCredentials(ctx, hostID, store.CredKindRepo)
|
||||
if err != nil {
|
||||
t.Fatalf("get host creds: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user