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

Function makeScimUser

enterprise/coderd/scim_test.go:36–59  ·  view source on GitHub ↗

nolint:revive

(t testing.TB)

Source from the content-addressed store, hash-verified

34
35//nolint:revive
36func makeScimUser(t testing.TB) coderd.SCIMUser {
37 rstr, err := cryptorand.String(10)
38 require.NoError(t, err)
39
40 return coderd.SCIMUser{
41 UserName: rstr,
42 Name: struct {
43 GivenName string `json:"givenName"`
44 FamilyName string `json:"familyName"`
45 }{
46 GivenName: rstr,
47 FamilyName: rstr,
48 },
49 Emails: []struct {
50 Primary bool `json:"primary"`
51 Value string `json:"value" format:"email"`
52 Type string `json:"type"`
53 Display string `json:"display"`
54 }{
55 {Primary: true, Value: fmt.Sprintf("%s@coder.com", rstr)},
56 },
57 Active: ptr.Ref(true),
58 }
59}
60
61func setScimAuth(key []byte) func(*http.Request) {
62 return func(r *http.Request) {

Callers 1

TestScimFunction · 0.85

Calls 2

StringFunction · 0.92
RefFunction · 0.92

Tested by

no test coverage detected