-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdoc.go
43 lines (31 loc) · 1.25 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2021 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0
/*
Package apiclient/provisioning implements the interaction model described in
https://github.com/veraison/veraison/tree/main/docs/api/endorsement-provisioning
# Submit
The whole API client exchange is handled via a single invocation of the Run()
method.
The user creates a SubmitConfig object supplying the URL of the /submit
endpoint:
cfg := SubmitConfig{
SubmitURI: "http://veraison.example/endorsement-provisioning/v1/submit",
}
The user can also supply a custom Client object, for example to appropriately
configure the underlying TLS transport:
cfg.Client = &Client{
HTTPClient: http.Client{
Transport: myTLSConfig,
}
}
The user can also request to explicitly delete the session resource at the
server instead of letting it expire:
cfg.DeleteSession = true
Then the Run method is invoked on the instantiated SubmitConfig object to
trigger the protocol FSM, hiding any details about the synchronus / async nature
of the underlying exchange. The user must supply the byte buffer containing the
serialized endorsement, and the associated media type:
err := cfg.Run(corimBuf, "application/corim+cbor")
On success err is nil.
*/
package provisioning