feature (boundary dev): add support for dev ldap auth method (#3192)
This commit is contained in:
19 files changed
+345
-14
No files matched your search
@@ -5,11 +5,16 @@ package controller
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/boundary/globals"
|
||||
"github.com/hashicorp/boundary/internal/auth/ldap"
|
||||
"github.com/hashicorp/boundary/internal/db"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_TestController(t *testing.T) {
|
||||
@@ -65,4 +70,19 @@ func Test_TestController(t *testing.T) {
|
||||
defer tc.Shutdown()
|
||||
}))
|
||||
})
|
||||
t.Run("set-default-ldap-auth-method-id", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
assert, require := assert.New(t), require.New(t)
|
||||
testCtx := context.Background()
|
||||
testLdapAuthMethodId := globals.LdapAuthMethodPrefix + "_0123456789"
|
||||
tc := NewTestController(t, &TestControllerOpts{DefaultLdapAuthMethodId: testLdapAuthMethodId})
|
||||
defer tc.Shutdown()
|
||||
|
||||
testRw := db.New(tc.DbConn())
|
||||
testLdapRepo, err := ldap.NewRepository(testCtx, testRw, testRw, tc.c.kms)
|
||||
require.NoError(err)
|
||||
got, err := testLdapRepo.LookupAuthMethod(testCtx, testLdapAuthMethodId)
|
||||
require.NoError(err)
|
||||
assert.Equal(testLdapAuthMethodId, got.GetPublicId())
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user