MCPcopy Create free account
hub / github.com/elimity-com/scim / Create

Method Create

server_test.go:93–117  ·  view source on GitHub ↗
(r *http.Request, attributes scim.ResourceAttributes)

Source from the content-addressed store, hash-verified

91}
92
93func (h *testResourceHandler) Create(r *http.Request, attributes scim.ResourceAttributes) (scim.Resource, error) {
94 if err := checkBodyNotEmpty(r); err != nil {
95 return scim.Resource{}, err
96 }
97
98 var (
99 id = h.createID()
100 now = time.Now()
101 meta = scim.Meta{
102 Created: &now,
103 LastModified: &now,
104 Version: fmt.Sprintf("v%d", now.Unix()),
105 }
106 )
107 h.data[id] = testData{
108 attributes: attributes,
109 meta: meta,
110 }
111 return scim.Resource{
112 ID: id,
113 ExternalID: externalID(attributes),
114 Attributes: attributes,
115 Meta: meta,
116 }, nil
117}
118
119func (h *testResourceHandler) Delete(r *http.Request, id string) error {
120 if _, ok := h.data[id]; !ok {

Callers

nothing calls this directly

Calls 3

createIDMethod · 0.95
checkBodyNotEmptyFunction · 0.85
externalIDFunction · 0.85

Tested by

no test coverage detected