diff --git a/assembly/locator.go b/assembly/locator.go index c6c487d..ea1a41a 100644 --- a/assembly/locator.go +++ b/assembly/locator.go @@ -51,8 +51,12 @@ func (l Locator) Config(cfg conf.Remote) Config { applicationService := service.NewApplication(txManager, applicationRep, appGroupRep, tokenRep) jwtService := service.NewTokenSource() - tokenService := service.NewToken(jwtService, applicationService, txManager, - applicationRep, appGroupRep, tokenRep, + tokenService := service.NewToken( + jwtService, + applicationService, + txManager, + applicationRep, + tokenRep, ) secureController := controller.NewSecure(secureService) diff --git a/controller/token.go b/controller/token.go index 521a797..e6ae5ea 100644 --- a/controller/token.go +++ b/controller/token.go @@ -64,13 +64,6 @@ func (c Token) Create(ctx context.Context, req domain.TokenCreateRequest) (*doma fmt.Sprintf("application with id %d not found", req.AppId), err, ) - case errors.Is(err, domain.ErrAppGroupNotFound): - return nil, apierrors.New( - codes.NotFound, - domain.ErrCodeAppGroupNotFound, - fmt.Sprintf("service for app_id id %d not found", req.AppId), - err, - ) case err != nil: return nil, err default: diff --git a/service/token.go b/service/token.go index 1017691..64541e2 100644 --- a/service/token.go +++ b/service/token.go @@ -35,7 +35,6 @@ type Token struct { appEnricher AppEnricher tx TokenTxRunner appRepo ApplicationRepo - serviceRepo AppGroupRepo tokenRepo TokenRepo } @@ -44,7 +43,6 @@ func NewToken( appEnricher AppEnricher, tx TokenTxRunner, appRepo ApplicationRepo, - appGroupRepo AppGroupRepo, tokenRepo TokenRepo, ) Token { return Token{ @@ -52,7 +50,6 @@ func NewToken( jwt: jwtGenerate, tx: tx, appRepo: appRepo, - serviceRepo: appGroupRepo, tokenRepo: tokenRepo, } }