(r *http.Request, attributes scim.ResourceAttributes)
| 91 | } |
| 92 | |
| 93 | func (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 | |
| 119 | func (h *testResourceHandler) Delete(r *http.Request, id string) error { |
| 120 | if _, ok := h.data[id]; !ok { |
nothing calls this directly
no test coverage detected