Skip to content

Commit

Permalink
rename thing to client in scope
Browse files Browse the repository at this point in the history
Signed-off-by: nyagamunene <[email protected]>
  • Loading branch information
nyagamunene authored and dborovcanin committed Dec 16, 2024
1 parent 37a2ebf commit 265bdd0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions auth/pat.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ const (
DomainManagementScope DomainEntityType = iota
DomainGroupsScope
DomainChannelsScope
DomainThingsScope
DomainClientsScope
DomainNullScope
)

const (
domainManagementScopeStr = "domain_management"
domainGroupsScopeStr = "groups"
domainChannelsScopeStr = "channels"
domainThingsScopeStr = "things"
domainClientsScopeStr = "clients"
)

func (det DomainEntityType) String() string {
Expand All @@ -138,8 +138,8 @@ func (det DomainEntityType) String() string {
return domainGroupsScopeStr
case DomainChannelsScope:
return domainChannelsScopeStr
case DomainThingsScope:
return domainThingsScopeStr
case DomainClientsScope:
return domainClientsScopeStr
default:
return fmt.Sprintf("unknown domain entity type %d", det)
}
Expand All @@ -161,8 +161,8 @@ func ParseDomainEntityType(det string) (DomainEntityType, error) {
return DomainGroupsScope, nil
case domainChannelsScopeStr:
return DomainChannelsScope, nil
case domainThingsScopeStr:
return DomainThingsScope, nil
case domainClientsScopeStr:
return DomainClientsScope, nil
default:
return 0, fmt.Errorf("unknown domain entity type %s", det)
}
Expand Down Expand Up @@ -452,7 +452,7 @@ func (ds *DomainScope) Add(domainEntityType DomainEntityType, operation Operatio
return fmt.Errorf("failed to add domain %s scope: domain_scope is nil and not initialized", domainEntityType)
}

if domainEntityType < DomainManagementScope || domainEntityType > DomainThingsScope {
if domainEntityType < DomainManagementScope || domainEntityType > DomainClientsScope {
return fmt.Errorf("failed to add domain %d scope: invalid domain entity type", domainEntityType)
}
if domainEntityType == DomainManagementScope {
Expand Down Expand Up @@ -483,7 +483,7 @@ func (ds *DomainScope) Delete(domainEntityType DomainEntityType, operation Opera
return nil
}

if domainEntityType < DomainManagementScope || domainEntityType > DomainThingsScope {
if domainEntityType < DomainManagementScope || domainEntityType > DomainClientsScope {
return fmt.Errorf("failed to delete domain %d scope: invalid domain entity type", domainEntityType)
}
if ds.Entities == nil {
Expand Down Expand Up @@ -516,7 +516,7 @@ func (ds *DomainScope) Check(domainEntityType DomainEntityType, operation Operat
if ds.Entities == nil {
return false
}
if domainEntityType < DomainManagementScope || domainEntityType > DomainThingsScope {
if domainEntityType < DomainManagementScope || domainEntityType > DomainClientsScope {
return false
}
if domainEntityType == DomainManagementScope {
Expand Down

0 comments on commit 265bdd0

Please sign in to comment.