Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/connector/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ func (o *roleBuilder) Grants(
grants = append(grants, nextGrant)
}

bag.Pop()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nextToken, err := bag.NextToken(client.GetNextToken(page, limit, total))
		if err != nil {
			return nil, "", nil, err
		}

I saw this one. Do we need to get the next page from the o.client.GetRolePermissions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://auth0.com/docs/api/management/v2/roles/get-role-permission doesn't say it supports pagination like the other endpoint

nextToken, err := bag.Marshal()
if err != nil {
return nil, "", nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/connector/scopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ func scopeResource(resourceServer client.ResourceServerScope, server *client.Res
}

func formatScopeId(resourceServer client.ResourceServerScope, server *client.ResourceServer) string {
return fmt.Sprintf("%s/%s", server.Identifier, resourceServer.Value)
return fmt.Sprintf("%s:%s", server.Identifier, resourceServer.Value)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

Verify scope ID format change impact across the codebase.

Changing the separator from / to : alters the format of all scope identifiers. While this likely fixes the pagination bug (slashes can interfere with URL paths or token parsing), it's a breaking change if scope IDs were previously persisted in grants, entitlements, or external systems.

Run the following script to verify consistency and identify potential impacts:


🏁 Script executed:

#!/bin/bash
# Description: Search for scope ID construction, parsing, and usage patterns

echo "=== Searching for scope ID construction patterns ==="
# Look for other places that might construct scope IDs with slash
rg -n "Identifier.*/" --type go -C 3

echo -e "\n=== Searching for scope ID parsing or splitting ==="
# Look for code that might parse scope IDs expecting slash separator
rg -n 'strings\.Split.*"/"' --type go -C 3
rg -n 'strings\.Contains.*"/"' --type go -C 3

echo -e "\n=== Searching for formatScopeId usage ==="
# Find all usages of formatScopeId
rg -n "formatScopeId" --type go -C 5

echo -e "\n=== Searching for scopeResourceType usage ==="
# Find how scope resource types are used in grants/entitlements
rg -n "scopeResourceType" --type go -C 3

echo -e "\n=== Searching for scope-related comments ==="
# Find comments that might reference the old format
rg -n "scope.*/" --type go -C 2

Length of output: 7354


Update outdated comment about scope ID format.

The change to : separator is a consistency fix—roles.go line 241 was already using this format. However, the comment at line 68 in scopes.go still references the old / format and needs updating:

Change the comment from:

// Needs to be in the format of <resourceServerId>/<scopeName>

To:

// Needs to be in the format of <resourceServerId>:<scopeName>

The search found no other code constructing scope IDs with /, and roles.go already aligns with the : format, confirming this is a safe consistency improvement rather than a breaking change.

🤖 Prompt for AI Agents
In pkg/connector/scopes.go around line 68, update the outdated comment that says
"Needs to be in the format of <resourceServerId>/<scopeName>" to reflect the
current separator; change it to "Needs to be in the format of
<resourceServerId>:<scopeName>" so it matches the actual implementation (see
line 91) and roles.go usage.

}
Loading