MCPcopy
hub / github.com/perkeep/perkeep / SignAt

Method SignAt

pkg/schema/blob.go:470–481  ·  view source on GitHub ↗

SignAt sets the blob builder's camliSigner field with SetSigner and returns the signed JSON using the provided signer. The provided sigTime is the time of the signature, used mostly for planned permanodes. If the zero value, the current time is used.

(ctx context.Context, signer *Signer, sigTime time.Time)

Source from the content-addressed store, hash-verified

468// The provided sigTime is the time of the signature, used mostly
469// for planned permanodes. If the zero value, the current time is used.
470func (bb *Builder) SignAt(ctx context.Context, signer *Signer, sigTime time.Time) (string, error) {
471 switch bb.Type() {
472 case TypePermanode, TypeClaim:
473 default:
474 return "", fmt.Errorf("can't sign camliType %q", bb.Type())
475 }
476 if sigTime.IsZero() {
477 sigTime = time.Now()
478 }
479 bb.SetClaimDate(sigTime)
480 return signer.SignJSON(ctx, bb.SetSigner(signer.pubref).Blob().JSON(), sigTime)
481}
482
483// SetType sets the camliType field.
484func (bb *Builder) SetType(t CamliType) *Builder {

Callers 8

SignMethod · 0.95
signBlobMethod · 0.80
initFunction · 0.80
addClaimMethod · 0.80
addPermanodeMethod · 0.80
TestHandleShareDeletionFunction · 0.80
TestClaimDateFunction · 0.80
uploadFilePermanodeMethod · 0.80

Calls 6

TypeMethod · 0.95
SetClaimDateMethod · 0.95
SetSignerMethod · 0.95
SignJSONMethod · 0.80
BlobMethod · 0.65
JSONMethod · 0.45

Tested by 5

initFunction · 0.64
addClaimMethod · 0.64
addPermanodeMethod · 0.64
TestHandleShareDeletionFunction · 0.64
TestClaimDateFunction · 0.64