TODO(mpl): move that to client pkg, with a good API ?
(ctx context.Context, json string)
| 235 | // TODO(mpl): move that to client pkg, with a good API ? |
| 236 | |
| 237 | func (h *handler) signAndSend(ctx context.Context, json string) error { |
| 238 | // TODO(mpl): sign things ourselves if we can. |
| 239 | scl, err := h.cl.Sign(ctx, h.server, strings.NewReader("json="+json)) |
| 240 | if err != nil { |
| 241 | return fmt.Errorf("could not get signed claim %v: %v", json, err) |
| 242 | } |
| 243 | if _, err := h.cl.Upload(ctx, client.NewUploadHandleFromString(string(scl))); err != nil { |
| 244 | return fmt.Errorf("could not upload signed claim %v: %v", json, err) |
| 245 | } |
| 246 | return nil |
| 247 | } |
| 248 | |
| 249 | func (h *handler) setAttribute(ctx context.Context, pn blob.Ref, attr, val string) error { |
| 250 | ucl, err := schema.NewSetAttributeClaim(pn, attr, val).SetSigner(h.signer).JSON() |
no test coverage detected