Rename root, api and sdk module paths (imports, go.mod, go_package, ldflags, build scripts, buf configs) and regenerate protobuf/gateway code with the project's pinned toolchain. Wire identifiers unchanged. api gets a local replace for sdk; root/api/sdk require v0.1.0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
// Copyright IBM Corp. 2020, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package kms
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/db"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestExternalWrappers(t *testing.T) {
|
|
t.Parallel()
|
|
assert, require := assert.New(t), require.New(t)
|
|
|
|
testCtx := context.Background()
|
|
conn, _ := db.TestSetup(t, "postgres")
|
|
rootWrapper := db.TestWrapper(t)
|
|
recoveryWrapper := db.TestWrapper(t)
|
|
workerAuthWrapper := db.TestWrapper(t)
|
|
workerAuthStorageWrapper := db.TestWrapper(t)
|
|
bsrWrapper := db.TestWrapper(t)
|
|
|
|
k := TestKms(t, conn, rootWrapper)
|
|
err := k.AddExternalWrappers(testCtx,
|
|
WithRecoveryWrapper(recoveryWrapper),
|
|
WithWorkerAuthWrapper(workerAuthWrapper),
|
|
WithWorkerAuthStorageWrapper(workerAuthStorageWrapper),
|
|
WithBsrWrapper(bsrWrapper),
|
|
)
|
|
require.NoError(err)
|
|
|
|
assert.Equal(rootWrapper, k.GetExternalWrappers(testCtx).Root())
|
|
assert.Equal(recoveryWrapper, k.GetExternalWrappers(testCtx).Recovery())
|
|
assert.Equal(workerAuthWrapper, k.GetExternalWrappers(testCtx).WorkerAuth())
|
|
assert.Equal(bsrWrapper, k.GetExternalWrappers(testCtx).Bsr())
|
|
}
|