Files
threshold/internal/auth/password/public_ids.go
T

29 lines
578 B
Go
Raw Normal View History

package password
import (
"fmt"
2020-08-10 17:15:02 -04:00
"github.com/hashicorp/boundary/internal/db"
)
// PublicId prefixes for the resources in the password package.
const (
2020-08-25 00:21:08 -04:00
AuthMethodPrefix = "ampw"
AccountPrefix = "apw"
)
func newAuthMethodId() (string, error) {
id, err := db.NewPublicId(AuthMethodPrefix)
if err != nil {
return "", fmt.Errorf("new password auth method id: %w", err)
}
return id, err
}
func newAccountId() (string, error) {
id, err := db.NewPublicId(AccountPrefix)
if err != nil {
return "", fmt.Errorf("new password account id: %w", err)
}
return id, err
}