MCPcopy Index your code
hub / github.com/coder/coder / TestParseOrganizationClaims

Function TestParseOrganizationClaims

coderd/idpsync/organizations_test.go:90–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestParseOrganizationClaims(t *testing.T) {
91 t.Parallel()
92
93 t.Run("AGPL", func(t *testing.T) {
94 t.Parallel()
95
96 // AGPL has limited behavior
97 s := idpsync.NewAGPLSync(slogtest.Make(t, &slogtest.Options{}),
98 runtimeconfig.NewManager(),
99 idpsync.DeploymentSyncSettings{
100 OrganizationField: "orgs",
101 OrganizationMapping: map[string][]uuid.UUID{
102 "random": {uuid.New()},
103 },
104 OrganizationAssignDefault: false,
105 })
106
107 ctx := testutil.Context(t, testutil.WaitMedium)
108
109 params, err := s.ParseOrganizationClaims(ctx, jwt.MapClaims{})
110 require.Nil(t, err)
111
112 require.False(t, params.SyncEntitled)
113 })
114}
115
116func TestSyncOrganizations(t *testing.T) {
117 t.Parallel()

Callers

nothing calls this directly

Calls 6

NewAGPLSyncFunction · 0.92
NewManagerFunction · 0.92
ContextFunction · 0.92
RunMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected