aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-12-01 19:45:55 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-12-01 19:45:55 +0100
commit12af3f2e8fad65534b83260967ea7463df6ca652 (patch)
tree97aab78be87e0c62bf6498011f8b041d859566c9 /client
parent6cd12911f4d3aa4c6a75c922f9de231e2cf309dd (diff)
renamed and documented function
Diffstat (limited to 'client')
-rw-r--r--client/client.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/client/client.go b/client/client.go
index 6ab654a..f474401 100644
--- a/client/client.go
+++ b/client/client.go
@@ -98,7 +98,7 @@ func (c *Client) AddEntry(ctx context.Context, name, checksum []byte) (*stfe.StI
}
glog.V(3).Infof("created post data: %s", string(data))
- url := stfe.EndpointAddEntry.Url(c.protocol() + c.Log.BaseUrl)
+ url := stfe.EndpointAddEntry.Path(c.protocol() + c.Log.BaseUrl)
req, err := http.NewRequest("POST", url, bytes.NewBuffer(data))
if err != nil {
return nil, fmt.Errorf("failed creating http request: %v", err)
@@ -125,7 +125,7 @@ func (c *Client) AddEntry(ctx context.Context, name, checksum []byte) (*stfe.StI
// GetSth fetches and verifies the most recent STH. Safe to use without a
// client chain and corresponding private key.
func (c *Client) GetSth(ctx context.Context) (*stfe.StItem, error) {
- url := stfe.EndpointGetSth.Url(c.protocol() + c.Log.BaseUrl)
+ url := stfe.EndpointGetSth.Path(c.protocol() + c.Log.BaseUrl)
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return nil, fmt.Errorf("failed creating http request: %v", err)
@@ -151,7 +151,7 @@ func (c *Client) GetSth(ctx context.Context) (*stfe.StItem, error) {
// GetConsistencyProof fetches and verifies a consistency proof between two
// STHs. Safe to use without a client chain and corresponding private key.
func (c *Client) GetConsistencyProof(ctx context.Context, first, second *stfe.StItem) (*stfe.StItem, error) {
- url := stfe.EndpointGetConsistencyProof.Url(c.protocol() + c.Log.BaseUrl)
+ url := stfe.EndpointGetConsistencyProof.Path(c.protocol() + c.Log.BaseUrl)
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return nil, fmt.Errorf("failed creating http request: %v", err)
@@ -180,7 +180,7 @@ func (c *Client) GetConsistencyProof(ctx context.Context, first, second *stfe.St
// STH. Safe to use without a client chain and corresponding private key.
func (c *Client) GetProofByHash(ctx context.Context, treeSize uint64, rootHash, leaf []byte) (*stfe.StItem, error) {
leafHash := rfc6962.DefaultHasher.HashLeaf(leaf)
- url := stfe.EndpointGetProofByHash.Url(c.protocol() + c.Log.BaseUrl)
+ url := stfe.EndpointGetProofByHash.Path(c.protocol() + c.Log.BaseUrl)
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return nil, fmt.Errorf("failed creating http request: %v", err)
@@ -213,7 +213,7 @@ func (c *Client) GetProofByHash(ctx context.Context, treeSize uint64, rootHash,
// Note that a certificate chain is considered valid if it is chained correctly.
// In other words, the caller may want to check whether the anchor is trusted.
func (c *Client) GetEntries(ctx context.Context, start, end uint64) ([]*stfe.GetEntryResponse, error) {
- url := stfe.EndpointGetEntries.Url(c.protocol() + c.Log.BaseUrl)
+ url := stfe.EndpointGetEntries.Path(c.protocol() + c.Log.BaseUrl)
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return nil, fmt.Errorf("failed creating http request: %v", err)
@@ -251,7 +251,7 @@ func (c *Client) GetEntries(ctx context.Context, start, end uint64) ([]*stfe.Get
// GetAnchors fetches the log's trust anchors. Safe to use without a client
// chain and corresponding private key.
func (c *Client) GetAnchors(ctx context.Context) ([]*x509.Certificate, error) {
- url := stfe.EndpointGetAnchors.Url(c.protocol() + c.Log.BaseUrl)
+ url := stfe.EndpointGetAnchors.Path(c.protocol() + c.Log.BaseUrl)
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return nil, fmt.Errorf("failed creating http request: %v", err)