()
| 66 | } |
| 67 | |
| 68 | func (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 | |
| 86 | func (gh *Github) Validate() (err error) { |
| 87 | gh.Identity = strings.ToLower(gh.Identity) |
no test coverage detected