-
Notifications
You must be signed in to change notification settings - Fork 887
chore: support multi-org group sync with runtime configuration #14578
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
99c97c2
wip
Emyrk bfddeb6
begin group sync main work
Emyrk f2857c6
initial implementation of group sync
Emyrk 791a059
work on moving to the manager
Emyrk 4326e9d
fixup compile issues
Emyrk 6d3ed2e
fixup some tests
Emyrk 0803619
handle allow list
Emyrk 596e7b4
WIP unit test for group sync
Emyrk b9476ac
fixup tests, account for existing groups
Emyrk ee8e4e4
fix compile issues
Emyrk d5ff0f7
add comment for test helper
Emyrk 86c0f6f
handle legacy params
Emyrk 2f03e18
make gen
Emyrk ec8092d
cleanup
Emyrk d63727d
add unit test for legacy behavior
Emyrk 2a1769c
work on batching removal by name or id
Emyrk 640e86e
group sync adjustments
Emyrk c544a29
test legacy params
Emyrk 476be45
add unit test for ApplyGroupDifference
Emyrk 164aeac
chore: remove old group sync code
Emyrk 986498d
switch oidc test config to deployment values
Emyrk 290cfa5
fix err name
Emyrk c563b10
some linting cleanup
Emyrk d2c247f
dbauthz test for new query
Emyrk 12685bd
fixup comments
Emyrk bf0d4ed
fixup compile issues from rebase
Emyrk f95128e
add test for disabled sync
Emyrk 88b0ad9
linting
Emyrk 6491f6a
chore: handle db conflicts gracefully
Emyrk bd23288
test expected group equality
Emyrk a390ec4
cleanup comments
Emyrk a0a1c53
spelling mistake
Emyrk a86ba83
linting:
Emyrk 0df7f28
add interface method to allow api crud
Emyrk 7a802a9
Remove testable example
Emyrk 611f1e3
fix formatting of sql, add a comment
Emyrk 7f28a53
remove function only used in 1 place
Emyrk 41994d2
make fmt
Emyrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
handle allow list
- Loading branch information
commit 0803619e8c65eb1bb584abae3137e403bf07f8fe
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package enidpsync_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/golang-jwt/jwt/v4" | ||
"github.com/stretchr/testify/require" | ||
|
||
"cdr.dev/slog/sloggers/slogtest" | ||
"github.com/coder/coder/v2/coderd/entitlements" | ||
"github.com/coder/coder/v2/coderd/idpsync" | ||
"github.com/coder/coder/v2/coderd/runtimeconfig" | ||
"github.com/coder/coder/v2/enterprise/coderd/enidpsync" | ||
"github.com/coder/coder/v2/testutil" | ||
) | ||
|
||
func TestEnterpriseParseGroupClaims(t *testing.T) { | ||
t.Parallel() | ||
|
||
t.Run("NoEntitlements", func(t *testing.T) { | ||
t.Parallel() | ||
|
||
s := enidpsync.NewSync(slogtest.Make(t, &slogtest.Options{}), | ||
runtimeconfig.NewNoopManager(), | ||
entitlements.New(), | ||
idpsync.DeploymentSyncSettings{}) | ||
|
||
ctx := testutil.Context(t, testutil.WaitMedium) | ||
|
||
params, err := s.ParseGroupClaims(ctx, jwt.MapClaims{}) | ||
require.Nil(t, err) | ||
|
||
require.False(t, params.SyncEnabled) | ||
}) | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
At some point we should disconnect these from the default org. Might need to move the existing config env and flags, and deprecate the old.