Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-01-05 10:53:13 +01:00
parent 4beba10a6e
commit a7a3025d25

View File

@@ -19,54 +19,80 @@ import (
"github.com/elimity-com/scim/schema" "github.com/elimity-com/scim/schema"
) )
// UserSchema returns the SCIM User schema definition
func UserSchema() schema.Schema { func UserSchema() schema.Schema {
return schema.Schema{ return schema.Schema{
ID: schema.UserSchema, ID: schema.UserSchema,
Name: optional.NewString("User"), Name: optional.NewString("User"),
Description: optional.NewString("User Account"), Description: optional.NewString("User Account"),
Attributes: []schema.CoreAttribute{ Attributes: []schema.CoreAttribute{
schema.SimpleCoreAttribute(schema.SimpleStringParams(schema.StringParams{ schema.SimpleCoreAttribute(
Name: "userName", schema.SimpleStringParams(
Required: true, schema.StringParams{
Uniqueness: schema.AttributeUniquenessServer(), Name: "userName",
})), Required: true,
schema.SimpleCoreAttribute(schema.SimpleStringParams(schema.StringParams{ Uniqueness: schema.AttributeUniquenessServer(),
Name: "displayName", },
})), ),
schema.ComplexCoreAttribute(schema.ComplexParams{ ),
Name: "name", schema.SimpleCoreAttribute(
SubAttributes: []schema.SimpleParams{ schema.SimpleStringParams(
schema.SimpleStringParams(schema.StringParams{ schema.StringParams{
Name: "formatted", Name: "displayName",
}), },
schema.SimpleStringParams(schema.StringParams{ ),
Name: "familyName", ),
}), schema.ComplexCoreAttribute(
schema.SimpleStringParams(schema.StringParams{ schema.ComplexParams{
Name: "givenName", Name: "name",
}), SubAttributes: []schema.SimpleParams{
schema.SimpleStringParams(
schema.StringParams{
Name: "formatted",
},
),
schema.SimpleStringParams(
schema.StringParams{
Name: "familyName",
},
),
schema.SimpleStringParams(
schema.StringParams{
Name: "givenName",
},
),
},
}, },
}), ),
schema.SimpleCoreAttribute(schema.SimpleBooleanParams(schema.BooleanParams{ schema.SimpleCoreAttribute(
Name: "active", schema.SimpleBooleanParams(
})), schema.BooleanParams{
schema.ComplexCoreAttribute(schema.ComplexParams{ Name: "active",
Name: "emails", },
MultiValued: true, ),
SubAttributes: []schema.SimpleParams{ ),
schema.SimpleStringParams(schema.StringParams{ schema.ComplexCoreAttribute(
Name: "value", schema.ComplexParams{
}), Name: "emails",
schema.SimpleStringParams(schema.StringParams{ MultiValued: true,
Name: "type", SubAttributes: []schema.SimpleParams{
}), schema.SimpleStringParams(
schema.SimpleBooleanParams(schema.BooleanParams{ schema.StringParams{
Name: "primary", Name: "value",
}), },
),
schema.SimpleStringParams(
schema.StringParams{
Name: "type",
},
),
schema.SimpleBooleanParams(
schema.BooleanParams{
Name: "primary",
},
),
},
}, },
}), ),
}, },
} }
} }