Skip to content

[BB-1013] Add permissions support#23

Merged
MarcusGoldschmidt merged 6 commits intomainfrom
goldschmidt/add-permissions
Sep 19, 2025
Merged

[BB-1013] Add permissions support#23
MarcusGoldschmidt merged 6 commits intomainfrom
goldschmidt/add-permissions

Conversation

@MarcusGoldschmidt
Copy link
Contributor

Description

  • Bug fix
  • New feature

Upgrade baton-sdk
Upgrade golanglint-ci

Add support for permissions, scope and Resource servers

Useful links:

Comment on lines 218 to 225
bag.Push(pagination.PageState{
Token: client.GetNextToken(page, limit, total),
ResourceTypeID: userResourceType.Id,
})

nextToken, err := bag.Marshal()
if err != nil {
return nil, "", nil, err

Choose a reason for hiding this comment

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

nit: I think you can do bag.Next for this. It will keep the current resource type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case I can't use it, since I use pop before.

The api for bag is ambiguous since it can leak so many usages; it does not enforce one usage

Comment on lines 159 to 178
state := bag.Pop()
if state == nil {
bag.Push(pagination.PageState{
Token: "",
ResourceTypeID: userResourceType.Id,
})

if len(users) == 0 {
return nil, "", outputAnnotations, nil
if o.syncPermissions {
bag.Push(pagination.PageState{
Token: "",
ResourceTypeID: scopeResourceType.Id,
})
}

nextToken, err := bag.Marshal()
if err != nil {
return nil, "", nil, err
}

return nil, nextToken, nil, nil

Choose a reason for hiding this comment

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

SyncPermissions = field.BoolField(
"sync-permissions",
field.WithDescription("Sync permissions"),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an FYI, this is new, but @mindymo has indicated we should create a Jira issue for the public docs project whenever we add a new capability. https://conductorone.atlassian.net/jira/core/projects/DOCS/board?filter=&groupBy=status

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created DOCS-370

apiPathUsersForRole = "/api/v2/roles/%s/users"
apiPathGetResourceServers = "/api/v2/resource-servers"
apiPathResourceServers = "/api/v2/resource-servers/%s"
apiPathRolePermissions = "/api/v2/roles/%s/permissions"
Copy link
Contributor

Choose a reason for hiding this comment

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

if any of these new endpoints require additional new permissions that we aren't currently documenting we will need to include this in the documentation jira we need to create

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resource servers will required read:resource_servers

The role it's good since we already use read:role before

@MarcusGoldschmidt MarcusGoldschmidt merged commit 0f67fe1 into main Sep 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants