{"action":"created","comment":{"url":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/comments/220581917","pull_request_review_id":159020778,"id":220581917,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDU4MTkxNw==","diff_hunk":"@@ -279,22 +281,63 @@ func TestGenerate(t *testing.T) {\n \t\t}\n \t})\n \n-\tt.Run(\"generate makes a key that by default expires in 60 days\", func(*testing.T) {\n-\t\tidentityName := getSingleUid(generatedKey.Identities)\n-\t\tsixtyDaysInSeconds := uint32((time.Hour * 24 * 60).Seconds())\n-\t\tactualLifetimeOfKey := generatedKey.Identities[identityName].SelfSignature.KeyLifetimeSecs\n+\tt.Run(\"PrimaryKey.CreationTime is correct\", func(*testing.T) {\n+\t\tassert.AssertEqualTimes(t, now, generatedKey.PrimaryKey.CreationTime)\n+\t})\n \n-\t\tif *actualLifetimeOfKey != sixtyDaysInSeconds {\n-\t\t\tt.Fatalf(\"expected KeyLifetimeSecs to be '%v', got '%v'\", sixtyDaysInSeconds, *actualLifetimeOfKey)\n-\t\t}\n+\tfor name, identity := range generatedKey.Identities {\n+\t\tt.Run(fmt.Sprintf(\"Identity[%s].SelfSignature.CreationTime\", name), func(t *testing.T) {\n+\t\t\tassert.AssertEqualTimes(t, now, identity.SelfSignature.CreationTime)\n+\t\t})\n+\t}\n+\n+\tfor i, subkey := range generatedKey.Subkeys {\n+\t\tt.Run(fmt.Sprintf(\"Subkeys[%d].PublicKey.CreationTime is correct\", i), func(t *testing.T) {\n+\t\t\tassert.AssertEqualTimes(t, now, subkey.PublicKey.CreationTime)\n+\t\t})\n+\n+\t\tt.Run(fmt.Sprintf(\"Subkeys[%d].Sig.CreationTime is correct\", i), func(t *testing.T) {\n+\t\t\tassert.AssertEqualTimes(t, now, subkey.Sig.CreationTime)\n+\t\t})\n+\t}\n \n-\t\tfor _, subkey := range generatedKey.Subkeys {\n-\t\t\tactualLifetimeOfSubkey := subkey.Sig.SigLifetimeSecs\n-\t\t\tif *actualLifetimeOfKey != sixtyDaysInSeconds {\n-\t\t\t\tt.Fatalf(\"expected KeyLifetimeSecs of Subkey to be '%v', got '%v'\", sixtyDaysInSeconds, *actualLifetimeOfSubkey)\n+\tfor name, identity := range generatedKey.Identities {","path":"pgpkey/pgpkey_test.go","position":71,"original_position":71,"commit_id":"ad74ca67203c1b524d16c4428324a767e89e3e06","original_commit_id":"ad74ca67203c1b524d16c4428324a767e89e3e06","user":{"login":"idrysdale","id":55195,"node_id":"MDQ6VXNlcjU1MTk1","avatar_url":"https://avatars1.githubusercontent.com/u/55195?v=4","gravatar_id":"","url":"https://api.github.com/users/idrysdale","html_url":"https://github.com/idrysdale","followers_url":"https://api.github.com/users/idrysdale/followers","following_url":"https://api.github.com/users/idrysdale/following{/other_user}","gists_url":"https://api.github.com/users/idrysdale/gists{/gist_id}","starred_url":"https://api.github.com/users/idrysdale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idrysdale/subscriptions","organizations_url":"https://api.github.com/users/idrysdale/orgs","repos_url":"https://api.github.com/users/idrysdale/repos","events_url":"https://api.github.com/users/idrysdale/events{/privacy}","received_events_url":"https://api.github.com/users/idrysdale/received_events","type":"User","site_admin":false},"body":"Again. So much clearer now!","created_at":"2018-09-26T14:17:51Z","updated_at":"2018-09-26T14:17:51Z","html_url":"https://github.com/fluidkeys/fluidkeys/pull/104#discussion_r220581917","pull_request_url":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/104","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/comments/220581917"},"html":{"href":"https://github.com/fluidkeys/fluidkeys/pull/104#discussion_r220581917"},"pull_request":{"href":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/104","id":218329423,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4MzI5NDIz","html_url":"https://github.com/fluidkeys/fluidkeys/pull/104","diff_url":"https://github.com/fluidkeys/fluidkeys/pull/104.diff","patch_url":"https://github.com/fluidkeys/fluidkeys/pull/104.patch","issue_url":"https://api.github.com/repos/fluidkeys/fluidkeys/issues/104","number":104,"state":"open","locked":false,"title":"PgpKey.Generate: set expiry according to (new) policy","user":{"login":"paulfurley","id":254290,"node_id":"MDQ6VXNlcjI1NDI5MA==","avatar_url":"https://avatars2.githubusercontent.com/u/254290?v=4","gravatar_id":"","url":"https://api.github.com/users/paulfurley","html_url":"https://github.com/paulfurley","followers_url":"https://api.github.com/users/paulfurley/followers","following_url":"https://api.github.com/users/paulfurley/following{/other_user}","gists_url":"https://api.github.com/users/paulfurley/gists{/gist_id}","starred_url":"https://api.github.com/users/paulfurley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulfurley/subscriptions","organizations_url":"https://api.github.com/users/paulfurley/orgs","repos_url":"https://api.github.com/users/paulfurley/repos","events_url":"https://api.github.com/users/paulfurley/events{/privacy}","received_events_url":"https://api.github.com/users/paulfurley/received_events","type":"User","site_admin":false},"body":"* split status package into status & policy\n\n  status was logically doing 2 things:\n  \n  1. defining the \"policy\" e.g. when to rotate keys, define expiry etc 2.\n  testing against, and enforcing the policy, e.g. \"this key's expiry is too\n  long\"\n  \n  I realised this when I tried to point PgpKey.Generate at status'\n  NextExpiryTime function and got a circular import[1]\n  \n  I think what we *actually* want is a separate \"policy\" package which\n  defines the rules, and have status just enforce them. Then, PgpKey can ask\n  the policy package for the expiry it should use.\n  \n  I think the policy package will also be a perfect place to define the\n  ciphers, hashes, compression preferences[2]\n  \n  [1]:\n  https://trello.com/c/KfZguoBa/182-when-we-make-a-new-key-set-its-expiry-to-the-next-rotation-time-not-60-days\n  [2]:\n  https://trello.com/c/5IfrDbky/185-a-newly-generated-key-doesnt-have-any-cipher-hash-or-compression-preferences\n\n* pass creationTime into PgpKey.generateInsecure\n\n  And add tests to check that it's actually used...\n  Note that its passed down into `openpgp` inside the `Config` struct","created_at":"2018-09-26T14:04:20Z","updated_at":"2018-09-26T14:17:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a23e1fe38c50fc88b468e7aefc912f7de0e3d667","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/104/commits","review_comments_url":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/104/comments","review_comment_url":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fluidkeys/fluidkeys/issues/104/comments","statuses_url":"https://api.github.com/repos/fluidkeys/fluidkeys/statuses/ad74ca67203c1b524d16c4428324a767e89e3e06","head":{"label":"fluidkeys:set-expiry-to-next-expiry-time","ref":"set-expiry-to-next-expiry-time","sha":"ad74ca67203c1b524d16c4428324a767e89e3e06","user":{"login":"fluidkeys","id":40570552,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNTcwNTUy","avatar_url":"https://avatars2.githubusercontent.com/u/40570552?v=4","gravatar_id":"","url":"https://api.github.com/users/fluidkeys","html_url":"https://github.com/fluidkeys","followers_url":"https://api.github.com/users/fluidkeys/followers","following_url":"https://api.github.com/users/fluidkeys/following{/other_user}","gists_url":"https://api.github.com/users/fluidkeys/gists{/gist_id}","starred_url":"https://api.github.com/users/fluidkeys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluidkeys/subscriptions","organizations_url":"https://api.github.com/users/fluidkeys/orgs","repos_url":"https://api.github.com/users/fluidkeys/repos","events_url":"https://api.github.com/users/fluidkeys/events{/privacy}","received_events_url":"https://api.github.com/users/fluidkeys/received_events","type":"Organization","site_admin":false},"repo":{"id":143900493,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM5MDA0OTM=","name":"fluidkeys","full_name":"fluidkeys/fluidkeys","private":false,"owner":{"login":"fluidkeys","id":40570552,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNTcwNTUy","avatar_url":"https://avatars2.githubusercontent.com/u/40570552?v=4","gravatar_id":"","url":"https://api.github.com/users/fluidkeys","html_url":"https://github.com/fluidkeys","followers_url":"https://api.github.com/users/fluidkeys/followers","following_url":"https://api.github.com/users/fluidkeys/following{/other_user}","gists_url":"https://api.github.com/users/fluidkeys/gists{/gist_id}","starred_url":"https://api.github.com/users/fluidkeys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluidkeys/subscriptions","organizations_url":"https://api.github.com/users/fluidkeys/orgs","repos_url":"https://api.github.com/users/fluidkeys/repos","events_url":"https://api.github.com/users/fluidkeys/events{/privacy}","received_events_url":"https://api.github.com/users/fluidkeys/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/fluidkeys/fluidkeys","description":"Fluidkeys supercharges PGP","fork":false,"url":"https://api.github.com/repos/fluidkeys/fluidkeys","forks_url":"https://api.github.com/repos/fluidkeys/fluidkeys/forks","keys_url":"https://api.github.com/repos/fluidkeys/fluidkeys/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fluidkeys/fluidkeys/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fluidkeys/fluidkeys/teams","hooks_url":"https://api.github.com/repos/fluidkeys/fluidkeys/hooks","issue_events_url":"https://api.github.com/repos/fluidkeys/fluidkeys/issues/events{/number}","events_url":"https://api.github.com/repos/fluidkeys/fluidkeys/events","assignees_url":"https://api.github.com/repos/fluidkeys/fluidkeys/assignees{/user}","branches_url":"https://api.github.com/repos/fluidkeys/fluidkeys/branches{/branch}","tags_url":"https://api.github.com/repos/fluidkeys/fluidkeys/tags","blobs_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/refs{/sha}","trees_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fluidkeys/fluidkeys/statuses/{sha}","languages_url":"https://api.github.com/repos/fluidkeys/fluidkeys/languages","stargazers_url":"https://api.github.com/repos/fluidkeys/fluidkeys/stargazers","contributors_url":"https://api.github.com/repos/fluidkeys/fluidkeys/contributors","subscribers_url":"https://api.github.com/repos/fluidkeys/fluidkeys/subscribers","subscription_url":"https://api.github.com/repos/fluidkeys/fluidkeys/subscription","commits_url":"https://api.github.com/repos/fluidkeys/fluidkeys/commits{/sha}","git_commits_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/commits{/sha}","comments_url":"https://api.github.com/repos/fluidkeys/fluidkeys/comments{/number}","issue_comment_url":"https://api.github.com/repos/fluidkeys/fluidkeys/issues/comments{/number}","contents_url":"https://api.github.com/repos/fluidkeys/fluidkeys/contents/{+path}","compare_url":"https://api.github.com/repos/fluidkeys/fluidkeys/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fluidkeys/fluidkeys/merges","archive_url":"https://api.github.com/repos/fluidkeys/fluidkeys/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fluidkeys/fluidkeys/downloads","issues_url":"https://api.github.com/repos/fluidkeys/fluidkeys/issues{/number}","pulls_url":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls{/number}","milestones_url":"https://api.github.com/repos/fluidkeys/fluidkeys/milestones{/number}","notifications_url":"https://api.github.com/repos/fluidkeys/fluidkeys/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fluidkeys/fluidkeys/labels{/name}","releases_url":"https://api.github.com/repos/fluidkeys/fluidkeys/releases{/id}","deployments_url":"https://api.github.com/repos/fluidkeys/fluidkeys/deployments","created_at":"2018-08-07T16:32:18Z","updated_at":"2018-09-26T14:05:50Z","pushed_at":"2018-09-26T14:10:56Z","git_url":"git://github.com/fluidkeys/fluidkeys.git","ssh_url":"git@github.com:fluidkeys/fluidkeys.git","clone_url":"https://github.com/fluidkeys/fluidkeys.git","svn_url":"https://github.com/fluidkeys/fluidkeys","homepage":"https://www.fluidkeys.com","size":2379,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":0,"open_issues":7,"watchers":7,"default_branch":"master"}},"base":{"label":"fluidkeys:master","ref":"master","sha":"8591bc181197916b1b4b5a451f9662d2070e3a14","user":{"login":"fluidkeys","id":40570552,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNTcwNTUy","avatar_url":"https://avatars2.githubusercontent.com/u/40570552?v=4","gravatar_id":"","url":"https://api.github.com/users/fluidkeys","html_url":"https://github.com/fluidkeys","followers_url":"https://api.github.com/users/fluidkeys/followers","following_url":"https://api.github.com/users/fluidkeys/following{/other_user}","gists_url":"https://api.github.com/users/fluidkeys/gists{/gist_id}","starred_url":"https://api.github.com/users/fluidkeys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluidkeys/subscriptions","organizations_url":"https://api.github.com/users/fluidkeys/orgs","repos_url":"https://api.github.com/users/fluidkeys/repos","events_url":"https://api.github.com/users/fluidkeys/events{/privacy}","received_events_url":"https://api.github.com/users/fluidkeys/received_events","type":"Organization","site_admin":false},"repo":{"id":143900493,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM5MDA0OTM=","name":"fluidkeys","full_name":"fluidkeys/fluidkeys","private":false,"owner":{"login":"fluidkeys","id":40570552,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNTcwNTUy","avatar_url":"https://avatars2.githubusercontent.com/u/40570552?v=4","gravatar_id":"","url":"https://api.github.com/users/fluidkeys","html_url":"https://github.com/fluidkeys","followers_url":"https://api.github.com/users/fluidkeys/followers","following_url":"https://api.github.com/users/fluidkeys/following{/other_user}","gists_url":"https://api.github.com/users/fluidkeys/gists{/gist_id}","starred_url":"https://api.github.com/users/fluidkeys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluidkeys/subscriptions","organizations_url":"https://api.github.com/users/fluidkeys/orgs","repos_url":"https://api.github.com/users/fluidkeys/repos","events_url":"https://api.github.com/users/fluidkeys/events{/privacy}","received_events_url":"https://api.github.com/users/fluidkeys/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/fluidkeys/fluidkeys","description":"Fluidkeys supercharges PGP","fork":false,"url":"https://api.github.com/repos/fluidkeys/fluidkeys","forks_url":"https://api.github.com/repos/fluidkeys/fluidkeys/forks","keys_url":"https://api.github.com/repos/fluidkeys/fluidkeys/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fluidkeys/fluidkeys/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fluidkeys/fluidkeys/teams","hooks_url":"https://api.github.com/repos/fluidkeys/fluidkeys/hooks","issue_events_url":"https://api.github.com/repos/fluidkeys/fluidkeys/issues/events{/number}","events_url":"https://api.github.com/repos/fluidkeys/fluidkeys/events","assignees_url":"https://api.github.com/repos/fluidkeys/fluidkeys/assignees{/user}","branches_url":"https://api.github.com/repos/fluidkeys/fluidkeys/branches{/branch}","tags_url":"https://api.github.com/repos/fluidkeys/fluidkeys/tags","blobs_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/refs{/sha}","trees_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fluidkeys/fluidkeys/statuses/{sha}","languages_url":"https://api.github.com/repos/fluidkeys/fluidkeys/languages","stargazers_url":"https://api.github.com/repos/fluidkeys/fluidkeys/stargazers","contributors_url":"https://api.github.com/repos/fluidkeys/fluidkeys/contributors","subscribers_url":"https://api.github.com/repos/fluidkeys/fluidkeys/subscribers","subscription_url":"https://api.github.com/repos/fluidkeys/fluidkeys/subscription","commits_url":"https://api.github.com/repos/fluidkeys/fluidkeys/commits{/sha}","git_commits_url":"https://api.github.com/repos/fluidkeys/fluidkeys/git/commits{/sha}","comments_url":"https://api.github.com/repos/fluidkeys/fluidkeys/comments{/number}","issue_comment_url":"https://api.github.com/repos/fluidkeys/fluidkeys/issues/comments{/number}","contents_url":"https://api.github.com/repos/fluidkeys/fluidkeys/contents/{+path}","compare_url":"https://api.github.com/repos/fluidkeys/fluidkeys/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fluidkeys/fluidkeys/merges","archive_url":"https://api.github.com/repos/fluidkeys/fluidkeys/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fluidkeys/fluidkeys/downloads","issues_url":"https://api.github.com/repos/fluidkeys/fluidkeys/issues{/number}","pulls_url":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls{/number}","milestones_url":"https://api.github.com/repos/fluidkeys/fluidkeys/milestones{/number}","notifications_url":"https://api.github.com/repos/fluidkeys/fluidkeys/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fluidkeys/fluidkeys/labels{/name}","releases_url":"https://api.github.com/repos/fluidkeys/fluidkeys/releases{/id}","deployments_url":"https://api.github.com/repos/fluidkeys/fluidkeys/deployments","created_at":"2018-08-07T16:32:18Z","updated_at":"2018-09-26T14:05:50Z","pushed_at":"2018-09-26T14:10:56Z","git_url":"git://github.com/fluidkeys/fluidkeys.git","ssh_url":"git@github.com:fluidkeys/fluidkeys.git","clone_url":"https://github.com/fluidkeys/fluidkeys.git","svn_url":"https://github.com/fluidkeys/fluidkeys","homepage":"https://www.fluidkeys.com","size":2379,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":0,"open_issues":7,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/104"},"html":{"href":"https://github.com/fluidkeys/fluidkeys/pull/104"},"issue":{"href":"https://api.github.com/repos/fluidkeys/fluidkeys/issues/104"},"comments":{"href":"https://api.github.com/repos/fluidkeys/fluidkeys/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fluidkeys/fluidkeys/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/fluidkeys/fluidkeys/statuses/ad74ca67203c1b524d16c4428324a767e89e3e06"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"idrysdale"}}