Skip to content

Commit

Permalink
chore: handle invalid authenticator
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Nov 30, 2023
1 parent e07b943 commit 2db3f11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/authenticator/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var (
ErrNoAuthenticator = errors.New("at least one vendor should be enable to have soteria")
ErrNoDefaultCaseIssEntry = errors.New("default case for iss-entity map is required")
ErrNoDefaultCaseIssPeer = errors.New("default case for iss-peer map is required")
ErrInvalidAuthenticator = errors.New("there is no authenticator to support your request")
)

type Builder struct {
Expand All @@ -35,6 +36,8 @@ func (b Builder) Authenticators() (map[string]Authenticator, error) {
)

switch {
case vendor.UseValidator && vendor.IsInternal:
return nil, ErrInvalidAuthenticator
case vendor.UseValidator:
auth, err = b.autoAuthenticator(vendor)
if err != nil {
Expand Down

0 comments on commit 2db3f11

Please sign in to comment.