Skip to content

Commit

Permalink
fix failing linter
Browse files Browse the repository at this point in the history
Signed-off-by: nyagamunene <[email protected]>
  • Loading branch information
nyagamunene committed Jan 8, 2025
1 parent 416a0b4 commit 9bea6f2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions clients/middleware/pat.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"github.com/absmach/supermq/pkg/roles"
)

const emptyDomain = ""

var _ clients.Service = (*patMiddleware)(nil)

type patMiddleware struct {
Expand All @@ -31,7 +29,6 @@ func PATMiddleware(svc clients.Service, pat smqpat.Authorization) clients.Servic
}

Check warning on line 29 in clients/middleware/pat.go

View check run for this annotation

Codecov / codecov/patch

clients/middleware/pat.go#L25-L29

Added lines #L25 - L29 were not covered by tests
}

// authorizePAT validates Personal Access Token if present in the session
func (pm *patMiddleware) authorizePAT(ctx context.Context, session authn.Session, platformEntityType smqauth.PlatformEntityType, optionalDomainEntityType smqauth.DomainEntityType, OptionalDomainID string, operation smqauth.OperationType, entityIDs []string) error {
if session.Type != authn.PersonalAccessToken {
return nil
Expand Down
2 changes: 0 additions & 2 deletions users/middleware/pat.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ type patMiddleware struct {
pat smqpat.Authorization
}

// PATMiddleware adds PAT validation to the users service.
func PATMiddleware(svc users.Service, pat smqpat.Authorization) users.Service {
return &patMiddleware{
svc: svc,
pat: pat,
}

Check warning on line 32 in users/middleware/pat.go

View check run for this annotation

Codecov / codecov/patch

users/middleware/pat.go#L28-L32

Added lines #L28 - L32 were not covered by tests
}

// authorizePAT validates Personal Access Token if present in the session
func (pm *patMiddleware) authorizePAT(ctx context.Context, session authn.Session, platformEntityType smqauth.PlatformEntityType, optionalDomainEntityType smqauth.DomainEntityType, OptionalDomainID string, operation smqauth.OperationType, entityIDs []string) error {
if session.Type != authn.PersonalAccessToken {
return nil
Expand Down

0 comments on commit 9bea6f2

Please sign in to comment.