Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: nyagamunene <[email protected]>
  • Loading branch information
nyagamunene committed Feb 4, 2025
1 parent a236485 commit bf6abe4
Show file tree
Hide file tree
Showing 18 changed files with 214 additions and 1,094 deletions.
3 changes: 2 additions & 1 deletion auth/api/http/keys/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ func (tr testRequest) make() (*http.Response, error) {
func newService() (auth.Service, *mocks.KeyRepository) {
krepo := new(mocks.KeyRepository)
pRepo := new(mocks.PATSRepository)
cache := new(mocks.Cache)
hash := new(mocks.Hasher)
idProvider := uuid.NewMock()
pService := new(policymocks.Service)
pEvaluator := new(policymocks.Evaluator)
t := jwt.New([]byte(secret))

return auth.New(krepo, pRepo, hash, idProvider, t, pEvaluator, pService, loginDuration, refreshDuration, invalidDuration), krepo
return auth.New(krepo, pRepo, cache, hash, idProvider, t, pEvaluator, pService, loginDuration, refreshDuration, invalidDuration), krepo
}

func newServer(svc auth.Service) *httptest.Server {
Expand Down
7 changes: 6 additions & 1 deletion auth/api/http/pats/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ func retrievePATEndpoint(svc auth.Service) endpoint.Endpoint {
return nil, err
}

pat, err := svc.RetrievePAT(ctx, req.token, req.id)
key, err := svc.Identify(ctx, req.token)
if err != nil {
return nil, err
}

pat, err := svc.RetrievePAT(ctx, key.User, req.id)
if err != nil {
return nil, err
}
Expand Down
6 changes: 0 additions & 6 deletions auth/bolt/doc.go

This file was deleted.

21 changes: 0 additions & 21 deletions auth/bolt/init.go

This file was deleted.

Loading

0 comments on commit bf6abe4

Please sign in to comment.