Move prefixes for many packages into the globals package (#3069)
This is a prerequisite for some enhancements to grant validation
This commit is contained in:
1 parent
6adc0c86b5
commit
b76b24a4ad
115 files changed
+796
-729
No files matched your search
@@ -7,6 +7,7 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/boundary/globals"
|
||||
"github.com/hashicorp/boundary/internal/db"
|
||||
"github.com/hashicorp/boundary/internal/errors"
|
||||
"github.com/hashicorp/boundary/internal/kms"
|
||||
@@ -45,7 +46,7 @@ func (r *Repository) CreateAuthMethod(ctx context.Context, am *AuthMethod, opt .
|
||||
}
|
||||
am.PublicId = id
|
||||
} else {
|
||||
if !strings.HasPrefix(am.PublicId, AuthMethodPrefix+"_") {
|
||||
if !strings.HasPrefix(am.PublicId, globals.OidcAuthMethodPrefix+"_") {
|
||||
return nil, errors.New(ctx, errors.InvalidParameter, op, "wrong auth method id prefix")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user