Files
threshold/internal/auth/password/public_ids_test.go
T
Jeff Mitchell b76b24a4ad Move prefixes for many packages into the globals package (#3069)
This is a prerequisite for some enhancements to grant validation
2023-03-10 15:06:39 -05:00

27 lines
632 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package password
import (
"strings"
"testing"
"github.com/hashicorp/boundary/globals"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_PublicIds(t *testing.T) {
t.Run("authMethod", func(t *testing.T) {
id, err := newAuthMethodId()
require.NoError(t, err)
assert.True(t, strings.HasPrefix(id, globals.PasswordAuthMethodPrefix+"_"))
})
t.Run("account", func(t *testing.T) {
id, err := newAccountId()
require.NoError(t, err)
assert.True(t, strings.HasPrefix(id, globals.PasswordAccountPrefix+"_"))
})
}