GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — fix(coderd/idpsync): Group sync may only add users to groups of the syncing org by eric-hughes-coder · Pull Request #30706 · coder/coder Conversation
Contributor
Group sync settings can contain group IDs that belong to another organization or that no longer exist. At login,
Generated by Claude Code under the direction of @eric-hughes-coder.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…ests Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> …ssing groups Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
All contributors have signed the CLA ✍️ ✅ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I have read the CLA Document and I hereby sign the CLA |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…-only-add-users-to-the-syncing
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good catch 👍
1 nit
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // is a group in some other organization. Missing holds entries whose GroupID | ||
| // matches no group at all, whether deleted or never created. Only Inside is | ||
| // safe to sync; Outside and Missing come from invalid sync settings. | ||
| func PartitionOutInvalidSettings(ctx context.Context, tx database.Store, orgID uuid.UUID, expected []ExpectedGroup) (inside, outside, missing []ExpectedGroup, err error) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This function highly depends on the authz permissions of the caller. If it's called with a user permissions, the response could mark all groups as missing or outside.
I think we should not export this function so people outside the pkg know not to call it.
| func PartitionOutInvalidSettings(ctx context.Context, tx database.Store, orgID uuid.UUID, expected []ExpectedGroup) (inside, outside, missing []ExpectedGroup, err error) { | |
| func partitionOutInvalidSettings(ctx context.Context, tx database.Store, orgID uuid.UUID, expected []ExpectedGroup) (inside, outside, missing []ExpectedGroup, err error) { |
For unit tests, just make the file group_internal_test.go and it can share the same pkg
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Taken.
Added an explicit precondition statement to the function in addition.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…cument its preconditions Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.