Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Signer ¶
type Signer interface { SignRequest(r request.Interface, headersToSign []string) (*request.Request, error) SignedURLBy(httpMethod, urlToSign string, expires int) (string, error) GenerateSignature(r request.Interface, headersToSign []string) string CanonicalizeRequest(r request.Interface, headersToSign []string) string }
Signer is the Escher Signing object interface
Example ¶
package main import ( "log" "net/http" "github.com/EscherAuth/escher/config" "github.com/EscherAuth/escher/request" "github.com/EscherAuth/escher/signer" ) func main() error { Config, err := config.NewFromENV() if err != nil { return err } req, _ := http.NewRequest("GET", "http://example.com/", nil) escherRequest, err := request.NewFromHTTPRequest(req) if err != nil { return err } signedRequest, err := signer.New(Config).SignRequest(escherRequest, []string{}) if err != nil { return err } err = signedRequest.UpdateHTTPRequest(req) if err != nil { return err } client := &http.Client{} resp, _ := client.Do(req) log.Println(resp) return nil }
Output:
Source Files ¶
Click to show internal directories.
Click to hide internal directories.