-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: add GET /organizations/{org}/groups/ai/spend #27123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
deda790
d1b6d1b
582345b
0d677e4
50a654d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIU, for full parity with
/api/v2/organizations/{org}/groups, we need this for regular org members. These members see all groups inGET /organizations/{org}/groups, but without this they would get empty rows from this new endpoint.Note that regular members already see the group's configured spend limit via the existing group budget endpoint (
/api/v2/groups/{group}/ai/budget), so the only new property here is the aggregate current spend.As a result, this comes down to: should regular members have visibility into their groups' current AI spend? Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2 [CRF-5] Answering your question: as written, group AI spend inherits group-read authz, so on a default deployment every org member can read every group's aggregate spend, and a human needs to decide whether that is intended (Pariston P2, Kurapika/Knov P3)
GetOrganizationGroupsAISpendRow.RBACObjectdelegates toGroup.RBACObject, so visibility equalsGET /organizations/{org}/groups. A plain org member gets org-wideResourceGroupread only whenorg.ShareableWorkspaceOwners == everyone(roles.go:1168), which is the column default; the passingMembercase (a user not in the group) confirms it. Meruem's nuance: the budget limit is not new exposure (GetGroupAIBudgetalready authorizes member read), so the only incremental disclosure here is each group's aggregatecurrent_spend_micros, summed across members the caller may not be able to enumerate individually. This is deliberate parity and not a code defect, but cost-control spend is a different sensitivity class from group identity. Per our review policy an agent can't accept this gap as permanent: either confirm members should see group spend (and keep group-read authz), or gate spend behind an admin-level action/resource. Flagging so it's decided rather than defaulted.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as-is.