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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.0 KiB
Go
Raw Normal View History

package password
import (
"github.com/hashicorp/boundary/internal/auth"
2020-08-10 17:15:02 -04:00
"github.com/hashicorp/boundary/internal/db"
"github.com/hashicorp/boundary/internal/errors"
"github.com/hashicorp/boundary/internal/intglobals"
"github.com/hashicorp/boundary/internal/types/subtypes"
)
func init() {
if err := subtypes.Register(auth.Domain, Subtype, AuthMethodPrefix, intglobals.OldPasswordAccountPrefix, intglobals.NewPasswordAccountPrefix); err != nil {
panic(err)
}
}
// PublicId prefixes for the resources in the password package.
const (
2020-08-25 00:21:08 -04:00
AuthMethodPrefix = "ampw"
Subtype = subtypes.Subtype("password")
)
func newAuthMethodId() (string, error) {
const op = "password.newAuthMethodId"
id, err := db.NewPublicId(AuthMethodPrefix)
if err != nil {
return "", errors.WrapDeprecated(err, op)
}
2021-03-05 06:34:06 -08:00
return id, nil
}
func newAccountId() (string, error) {
const op = "password.newAccountId"
id, err := db.NewPublicId(intglobals.NewPasswordAccountPrefix)
if err != nil {
return "", errors.WrapDeprecated(err, op)
}
2021-03-05 06:34:06 -08:00
return id, nil
}