Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion github/enterprise_scim.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ type SCIMEnterpriseAttribute struct {
type SCIMEnterpriseAttributeOperation struct {
Op string `json:"op"` // Can be one of: `add`, `replace`, `remove`.
Path *string `json:"path,omitempty"` // Path to the attribute being modified (Filters are not supported).
Value *string `json:"value,omitempty"` // New value for the attribute being modified.
Value any `json:"value,omitempty"` // New value for the attribute being modified.
}

// ListProvisionedSCIMGroups lists provisioned SCIM groups in an enterprise.
Expand Down
52 changes: 40 additions & 12 deletions github/enterprise_scim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,27 +260,55 @@ func TestSCIMEnterpriseAttribute_Marshal(t *testing.T) {
u := &SCIMEnterpriseAttribute{
Schemas: []string{"s"},
Operations: []*SCIMEnterpriseAttributeOperation{
{Op: "o1"},
{
Op: "o1",
Path: Ptr("p1"),
Value: Ptr("v1"),
Op: "o2",
Path: Ptr("p2"),
Value: "v2",
},
{
Op: "o2",
Op: "replace",
Path: Ptr("emails[type eq 'work'].value"),
Value: "v@example.com",
},
{
Op: "add",
Path: Ptr("members"),
Value: []*SCIMEnterpriseDisplayReference{
{Value: "v-1"},
{Value: "v-2"},
},
},
},
}

want := `{
"schemas": ["s"],
"Operations": [{
"op": "o1",
"path": "p1",
"value": "v1"
},
{
"op": "o2"
}]
"Operations": [
{"op": "o1"},
{
"op": "o2",
"path": "p2",
"value": "v2"
},
{
"op": "replace",
"path": "emails[type eq 'work'].value",
"value": "v@example.com"
},
{
"op": "add",
"path": "members",
"value": [
{
"value": "v-1"
},
{
"value": "v-2"
}
]
}
]
}`

testJSONMarshal(t, u, want)
Expand Down
8 changes: 0 additions & 8 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading