Files
threshold/internal/auth/password/public_ids.go
T
Louis Ruch 7387cec475 Remove sentinel errors (#968)
* Remove sentinal errors
2021-03-05 06:34:06 -08:00

31 lines
638 B
Go

package password
import (
"github.com/hashicorp/boundary/internal/db"
"github.com/hashicorp/boundary/internal/errors"
)
// PublicId prefixes for the resources in the password package.
const (
AuthMethodPrefix = "ampw"
AccountPrefix = "apw"
)
func newAuthMethodId() (string, error) {
const op = "password.newAuthMethodId"
id, err := db.NewPublicId(AuthMethodPrefix)
if err != nil {
return "", errors.Wrap(err, op)
}
return id, nil
}
func newAccountId() (string, error) {
const op = "password.newAccountId"
id, err := db.NewPublicId(AccountPrefix)
if err != nil {
return "", errors.Wrap(err, op)
}
return id, nil
}