()
| 48 | } |
| 49 | |
| 50 | func (gh *Github) GeneratePostPayload() (post map[string]string) { |
| 51 | gh.Identity = strings.ToLower(gh.Identity) |
| 52 | payload := gistPayload{ |
| 53 | Version: "1", |
| 54 | Comment: "Here's an NextID proof of this Github account.", |
| 55 | Comment2: "To validate, base64.decode the signature, and recover pubkey from it using sign_payload with ethereum personal_sign algo.", |
| 56 | Persona: "0x" + crypto.CompressedPubkeyHex(gh.Pubkey), |
| 57 | GithubUsername: gh.Identity, |
| 58 | SignPayload: gh.GenerateSignPayload(), |
| 59 | Signature: "%SIG_BASE64%", |
| 60 | CreatedAt: util.TimeToTimestampString(gh.CreatedAt), |
| 61 | Uuid: gh.Uuid.String(), |
| 62 | } |
| 63 | |
| 64 | payload_json, _ := json.MarshalIndent(payload, "", "\t") |
| 65 | return map[string]string{"default": string(payload_json)} |
| 66 | } |
| 67 | |
| 68 | func (gh *Github) GenerateSignPayload() (payload string) { |
| 69 | gh.Identity = strings.ToLower(gh.Identity) |
nothing calls this directly
no test coverage detected