22 lines
496 B
Go
22 lines
496 B
Go
package rbac
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"queryorchestration/internal/rbac"
|
|
)
|
|
|
|
// TestKeyProvider creates a test key provider for testing
|
|
func TestKeyProvider(t *testing.T, privateKeyPath, publicKeyPath string) rbac.KeyProvider {
|
|
config := &AuthConfig{
|
|
AuthType: "local",
|
|
PrivateKeyPath: privateKeyPath,
|
|
PublicKeyPath: publicKeyPath,
|
|
}
|
|
err := config.InitializeAuthProvider()
|
|
if err != nil {
|
|
t.Fatalf("Failed to initialize auth config: %v", err)
|
|
}
|
|
return config.GetKeyProvider()
|
|
}
|