diff --git a/clients/middleware/pat.go b/clients/middleware/pat.go index c8dc0de560..544ed26f2f 100644 --- a/clients/middleware/pat.go +++ b/clients/middleware/pat.go @@ -15,8 +15,6 @@ import ( "github.com/absmach/supermq/pkg/roles" ) -const emptyDomain = "" - var _ clients.Service = (*patMiddleware)(nil) type patMiddleware struct { @@ -31,7 +29,6 @@ func PATMiddleware(svc clients.Service, pat smqpat.Authorization) clients.Servic } } -// 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 diff --git a/users/middleware/pat.go b/users/middleware/pat.go index 6a770a41d8..6db1058c25 100644 --- a/users/middleware/pat.go +++ b/users/middleware/pat.go @@ -25,7 +25,6 @@ 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, @@ -33,7 +32,6 @@ func PATMiddleware(svc users.Service, pat smqpat.Authorization) users.Service { } } -// 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