Update Dependency.

This commit is contained in:
Naoki Kosaka 2020-05-10 14:00:24 +09:00
parent d1cc70657e
commit 81581db527
2 changed files with 8 additions and 7 deletions

9
go.mod
View File

@ -1,14 +1,15 @@
module github.com/yukimochi/Activity-Relay module github.com/yukimochi/Activity-Relay
go 1.13 go 1.14
require ( require (
github.com/RichardKnop/machinery v1.7.3 github.com/RichardKnop/machinery v1.7.8
github.com/Songmu/go-httpdate v1.0.0 github.com/Songmu/go-httpdate v1.0.0
github.com/go-fed/httpsig v0.1.1-0.20200204213531-0ef28562fabe
github.com/go-redis/redis v6.15.7+incompatible github.com/go-redis/redis v6.15.7+incompatible
github.com/patrickmn/go-cache v2.1.0+incompatible github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/satori/go.uuid v1.2.0 github.com/satori/go.uuid v1.2.0
github.com/spf13/cobra v0.0.6 github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.6.2 github.com/spf13/viper v1.7.0
github.com/yukimochi/httpsig v0.1.3 github.com/yukimochi/httpsig v0.1.3
) )

View File

@ -11,8 +11,8 @@ import (
"time" "time"
httpdate "github.com/Songmu/go-httpdate" httpdate "github.com/Songmu/go-httpdate"
"github.com/go-fed/httpsig"
"github.com/spf13/viper" "github.com/spf13/viper"
"github.com/yukimochi/httpsig"
) )
func appendSignature(request *http.Request, body *[]byte, KeyID string, publicKey *rsa.PrivateKey) error { func appendSignature(request *http.Request, body *[]byte, KeyID string, publicKey *rsa.PrivateKey) error {
@ -22,11 +22,11 @@ func appendSignature(request *http.Request, body *[]byte, KeyID string, publicKe
request.Header.Set("Digest", "SHA-256="+base64.StdEncoding.EncodeToString(b)) request.Header.Set("Digest", "SHA-256="+base64.StdEncoding.EncodeToString(b))
request.Header.Set("Host", request.Host) request.Header.Set("Host", request.Host)
signer, _, err := httpsig.NewSigner([]httpsig.Algorithm{httpsig.RSA_SHA256}, []string{httpsig.RequestTarget, "Host", "Date", "Digest", "Content-Type"}, httpsig.Signature) signer, _, err := httpsig.NewSigner([]httpsig.Algorithm{httpsig.RSA_SHA256}, httpsig.DigestSha256, []string{httpsig.RequestTarget, "Host", "Date", "Digest", "Content-Type"}, httpsig.Signature)
if err != nil { if err != nil {
return err return err
} }
err = signer.SignRequest(publicKey, KeyID, request) err = signer.SignRequest(publicKey, KeyID, request, *body)
if err != nil { if err != nil {
return err return err
} }