Skip to content

Commit

Permalink
is: Panic on invalid entity types in entityStore
Browse files Browse the repository at this point in the history
  • Loading branch information
htdvisser authored and adriansmares committed Aug 11, 2022
1 parent 64ac60e commit 70af8b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/identityserver/bunstore/entity_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func (s *entityStore) query(ctx context.Context, entityType string, entityIDs ..
var query *bun.SelectQuery

switch entityType {
default:
panic(fmt.Errorf("invalid entity type: %s", entityType))
case "application":
query = s.newSelectModel(ctx, &Application{}).
Column("id").
Expand Down Expand Up @@ -137,6 +139,8 @@ func (s *entityStore) getEntityID(ctx context.Context, entityType, entityUUID st
var query *bun.SelectQuery

switch entityType {
default:
panic(fmt.Errorf("invalid entity type: %s", entityType))
case "application":
query = s.newSelectModel(ctx, &Application{}).
Column("application_id").
Expand Down

0 comments on commit 70af8b5

Please sign in to comment.