Files
threshold/internal/auth/password/public_ids.go
T
s-christoff 6623be8bfb Refactor internal/auth to return domain specific errors (#905)
* Refactor internal/auth to return domain specific errors
2021-02-11 13:32:45 -06: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, err
}
func newAccountId() (string, error) {
const op = "password.newAccountId"
id, err := db.NewPublicId(AccountPrefix)
if err != nil {
return "", errors.Wrap(err, op)
}
return id, err
}