MCPcopy Create free account
hub / github.com/NextDotID/proof_server / GenerateSignPayload

Method GenerateSignPayload

validator/github/github.go:68–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68func (gh *Github) GenerateSignPayload() (payload string) {
69 gh.Identity = strings.ToLower(gh.Identity)
70 payloadStruct := validator.H{
71 "action": string(gh.Action),
72 "identity": gh.Identity,
73 "platform": string(types.Platforms.Github),
74 "prev": nil,
75 "created_at": util.TimeToTimestampString(gh.CreatedAt),
76 "uuid": gh.Uuid.String(),
77 }
78 if gh.Previous != "" {
79 payloadStruct["prev"] = gh.Previous
80 }
81
82 payload_bytes, _ := json.Marshal(payloadStruct)
83 return string(payload_bytes)
84}
85
86func (gh *Github) Validate() (err error) {
87 gh.Identity = strings.ToLower(gh.Identity)

Callers 2

GeneratePostPayloadMethod · 0.95
ValidateMethod · 0.95

Calls 1

TimeToTimestampStringFunction · 0.92

Tested by

no test coverage detected