- Notifications
You must be signed in to change notification settings - Fork928
feat: get and update group IdP Sync settings#14647
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
14 commits Select commitHold shift + click to select a range
64aee46
🧹
aslilaca7cc9a2
sort of testing
aslilac497d7e6
:(
aslilac2c243d1
🧹
aslilac3e1087e
make gen
Emyrk86ba866
add unit test to enforce unauthorized
Emyrkc8982a4
update unit test
Emyrk1093e83
add unit test for legacy group settings
Emyrk4ac097b
update unit test to use EntryNotFoundErr
Emyrk812a786
update unit tests and linting
Emyrk93d916c
add rbac authz test
Emyrk8449c9d
revert ui change
Emyrk0045409
gen
Emyrkec83e80
fmt
EmyrkFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
sort of testing
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commita7cc9a24fbb32255e6c90d526ab8289f15c18e9c
There are no files selected for viewing
87 changes: 87 additions & 0 deletionsenterprise/coderd/idpsync_test.go
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,87 @@ | ||
package coderd_test | ||
import ( | ||
"fmt" | ||
"testing" | ||
"github.com/stretchr/testify/require" | ||
"github.com/coder/coder/v2/coderd/audit" | ||
"github.com/coder/coder/v2/coderd/coderdtest" | ||
"github.com/coder/coder/v2/coderd/rbac" | ||
"github.com/coder/coder/v2/codersdk" | ||
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest" | ||
"github.com/coder/coder/v2/enterprise/coderd/license" | ||
"github.com/coder/coder/v2/testutil" | ||
) | ||
func TestGetGroupSyncConfig(t *testing.T) { | ||
t.Parallel() | ||
t.Run("OK", func(t *testing.T) { | ||
t.Parallel() | ||
dv := coderdtest.DeploymentValues(t) | ||
dv.Experiments = []string{ | ||
string(codersdk.ExperimentCustomRoles), | ||
string(codersdk.ExperimentMultiOrganization), | ||
} | ||
client, user := coderdenttest.New(t, &coderdenttest.Options{ | ||
Options: &coderdtest.Options{ | ||
DeploymentValues: dv, | ||
}, | ||
LicenseOptions: &coderdenttest.LicenseOptions{ | ||
Features: license.Features{ | ||
codersdk.FeatureCustomRoles: 1, | ||
codersdk.FeatureMultipleOrganizations: 1, | ||
}, | ||
}, | ||
}) | ||
ctx := testutil.Context(t, testutil.WaitLong) | ||
settings, err := client.GroupIDPSyncSettings(ctx, user.OrganizationID.String()) | ||
require.NoError(t, err) | ||
fmt.Printf("%v#", settings) | ||
// TODO | ||
}) | ||
t.Run("Audit", func(t *testing.T) { | ||
t.Parallel() | ||
auditor := audit.NewMock() | ||
client, user := coderdenttest.New(t, &coderdenttest.Options{ | ||
AuditLogging: true, | ||
Options: &coderdtest.Options{ | ||
IncludeProvisionerDaemon: true, | ||
Auditor: auditor, | ||
}, | ||
LicenseOptions: &coderdenttest.LicenseOptions{ | ||
Features: license.Features{ | ||
codersdk.FeatureTemplateRBAC: 1, | ||
codersdk.FeatureAuditLog: 1, | ||
}, | ||
}, | ||
}) | ||
_, _ = coderdtest.CreateAnotherUser(t, client, user.OrganizationID, rbac.RoleUserAdmin()) | ||
// TODO | ||
}) | ||
} | ||
func TestPatchGroupSyncConfig(t *testing.T) { | ||
t.Parallel() | ||
t.Run("OK", func(t *testing.T) { | ||
t.Parallel() | ||
client, user := coderdenttest.New(t, &coderdenttest.Options{LicenseOptions: &coderdenttest.LicenseOptions{ | ||
Features: license.Features{ | ||
codersdk.FeatureTemplateRBAC: 1, | ||
}, | ||
}}) | ||
_, _ = coderdtest.CreateAnotherUser(t, client, user.OrganizationID, rbac.RoleUserAdmin()) | ||
// TODO | ||
}) | ||
} |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.