{"action":"opened","number":332,"pull_request":{"url":"https://api.github.com/repos/tildaslash/RatticWeb/pulls/332","id":29342902,"html_url":"https://github.com/tildaslash/RatticWeb/pull/332","diff_url":"https://github.com/tildaslash/RatticWeb/pull/332.diff","patch_url":"https://github.com/tildaslash/RatticWeb/pull/332.patch","issue_url":"https://api.github.com/repos/tildaslash/RatticWeb/issues/332","number":332,"state":"open","locked":false,"title":"1st class support for ssh keys","user":{"login":"delfick","id":109301,"avatar_url":"https://avatars.githubusercontent.com/u/109301?v=3","gravatar_id":"","url":"https://api.github.com/users/delfick","html_url":"https://github.com/delfick","followers_url":"https://api.github.com/users/delfick/followers","following_url":"https://api.github.com/users/delfick/following{/other_user}","gists_url":"https://api.github.com/users/delfick/gists{/gist_id}","starred_url":"https://api.github.com/users/delfick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delfick/subscriptions","organizations_url":"https://api.github.com/users/delfick/orgs","repos_url":"https://api.github.com/users/delfick/repos","events_url":"https://api.github.com/users/delfick/events{/privacy}","received_events_url":"https://api.github.com/users/delfick/received_events","type":"User","site_admin":false},"body":"Hello,\r\n\r\nI chose to spend an internal hackday the other day adding support for ssh keys into rattic, so that I can make ssh key rotation a single command as opposed to an annoying manual process that involves generating ssh keys in amazon and putting them into rattic.\r\n\r\nThe result is this pull request.\r\n\r\n* Adds ssh key support as a first class citizen of Cred\r\n* Adds an expiry option to ApiKey\r\n\r\n  * An expiry that is less than or equal to the created date is considered as not expiring\r\n  \r\n* Expired ApiKeys are deleted when new ones are created or are view on the profile page\r\n* There is validation around uploading a new ssh key such that it has to be a valid ssh key\r\n* There are tests around importing an ssh key and getting it's fingerprint\r\n* If a password is attached to the Cred, that is used to open the ssh key if a passphrase is required\r\n* I have added /account/generate_api_key for generating an ApiKey that expires after 5 minutes\r\n\r\n  * GET to the url returns a 405 along with the crf cookie\r\n  * POST to the url returns 401 if no auth is provided\r\n  * POST with auth-username and auth-password will return 400 if it needs a token\r\n  * POST with the token, or just username and password if that's not required will use the uploaded ssh_key to attach to the cred\r\n  \r\n* I have added /cred/detail/<num>/fingerprint to get the fingerprint of the ssh key attached to the cred\r\n\r\n  * If the cred has no ssh key, a 404 is returned\r\n  * Login is not required for this url\r\n\r\nThanks\r\n\r\nStephen.","created_at":"2015-02-15T23:00:47Z","updated_at":"2015-02-15T23:00:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tildaslash/RatticWeb/pulls/332/commits","review_comments_url":"https://api.github.com/repos/tildaslash/RatticWeb/pulls/332/comments","review_comment_url":"https://api.github.com/repos/tildaslash/RatticWeb/pulls/comments/{number}","comments_url":"https://api.github.com/repos/tildaslash/RatticWeb/issues/332/comments","statuses_url":"https://api.github.com/repos/tildaslash/RatticWeb/statuses/ac8f93bb24e58e366a0fd740460bdcae2ee8093d","head":{"label":"delfick:ssh_keys","ref":"ssh_keys","sha":"ac8f93bb24e58e366a0fd740460bdcae2ee8093d","user":{"login":"delfick","id":109301,"avatar_url":"https://avatars.githubusercontent.com/u/109301?v=3","gravatar_id":"","url":"https://api.github.com/users/delfick","html_url":"https://github.com/delfick","followers_url":"https://api.github.com/users/delfick/followers","following_url":"https://api.github.com/users/delfick/following{/other_user}","gists_url":"https://api.github.com/users/delfick/gists{/gist_id}","starred_url":"https://api.github.com/users/delfick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delfick/subscriptions","organizations_url":"https://api.github.com/users/delfick/orgs","repos_url":"https://api.github.com/users/delfick/repos","events_url":"https://api.github.com/users/delfick/events{/privacy}","received_events_url":"https://api.github.com/users/delfick/received_events","type":"User","site_admin":false},"repo":{"id":30680020,"name":"RatticWeb","full_name":"delfick/RatticWeb","owner":{"login":"delfick","id":109301,"avatar_url":"https://avatars.githubusercontent.com/u/109301?v=3","gravatar_id":"","url":"https://api.github.com/users/delfick","html_url":"https://github.com/delfick","followers_url":"https://api.github.com/users/delfick/followers","following_url":"https://api.github.com/users/delfick/following{/other_user}","gists_url":"https://api.github.com/users/delfick/gists{/gist_id}","starred_url":"https://api.github.com/users/delfick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delfick/subscriptions","organizations_url":"https://api.github.com/users/delfick/orgs","repos_url":"https://api.github.com/users/delfick/repos","events_url":"https://api.github.com/users/delfick/events{/privacy}","received_events_url":"https://api.github.com/users/delfick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/delfick/RatticWeb","description":"Password Management for Humans","fork":true,"url":"https://api.github.com/repos/delfick/RatticWeb","forks_url":"https://api.github.com/repos/delfick/RatticWeb/forks","keys_url":"https://api.github.com/repos/delfick/RatticWeb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/delfick/RatticWeb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/delfick/RatticWeb/teams","hooks_url":"https://api.github.com/repos/delfick/RatticWeb/hooks","issue_events_url":"https://api.github.com/repos/delfick/RatticWeb/issues/events{/number}","events_url":"https://api.github.com/repos/delfick/RatticWeb/events","assignees_url":"https://api.github.com/repos/delfick/RatticWeb/assignees{/user}","branches_url":"https://api.github.com/repos/delfick/RatticWeb/branches{/branch}","tags_url":"https://api.github.com/repos/delfick/RatticWeb/tags","blobs_url":"https://api.github.com/repos/delfick/RatticWeb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/delfick/RatticWeb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/delfick/RatticWeb/git/refs{/sha}","trees_url":"https://api.github.com/repos/delfick/RatticWeb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/delfick/RatticWeb/statuses/{sha}","languages_url":"https://api.github.com/repos/delfick/RatticWeb/languages","stargazers_url":"https://api.github.com/repos/delfick/RatticWeb/stargazers","contributors_url":"https://api.github.com/repos/delfick/RatticWeb/contributors","subscribers_url":"https://api.github.com/repos/delfick/RatticWeb/subscribers","subscription_url":"https://api.github.com/repos/delfick/RatticWeb/subscription","commits_url":"https://api.github.com/repos/delfick/RatticWeb/commits{/sha}","git_commits_url":"https://api.github.com/repos/delfick/RatticWeb/git/commits{/sha}","comments_url":"https://api.github.com/repos/delfick/RatticWeb/comments{/number}","issue_comment_url":"https://api.github.com/repos/delfick/RatticWeb/issues/comments/{number}","contents_url":"https://api.github.com/repos/delfick/RatticWeb/contents/{+path}","compare_url":"https://api.github.com/repos/delfick/RatticWeb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/delfick/RatticWeb/merges","archive_url":"https://api.github.com/repos/delfick/RatticWeb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/delfick/RatticWeb/downloads","issues_url":"https://api.github.com/repos/delfick/RatticWeb/issues{/number}","pulls_url":"https://api.github.com/repos/delfick/RatticWeb/pulls{/number}","milestones_url":"https://api.github.com/repos/delfick/RatticWeb/milestones{/number}","notifications_url":"https://api.github.com/repos/delfick/RatticWeb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/delfick/RatticWeb/labels{/name}","releases_url":"https://api.github.com/repos/delfick/RatticWeb/releases{/id}","created_at":"2015-02-12T01:51:52Z","updated_at":"2015-02-12T01:51:54Z","pushed_at":"2015-02-14T08:58:08Z","git_url":"git://github.com/delfick/RatticWeb.git","ssh_url":"git@github.com:delfick/RatticWeb.git","clone_url":"https://github.com/delfick/RatticWeb.git","svn_url":"https://github.com/delfick/RatticWeb","homepage":"http://rattic.org/","size":1581,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tildaslash:master","ref":"master","sha":"6b8171fca9e13486dddc056997b8932a67a248ba","user":{"login":"tildaslash","id":3614741,"avatar_url":"https://avatars.githubusercontent.com/u/3614741?v=3","gravatar_id":"","url":"https://api.github.com/users/tildaslash","html_url":"https://github.com/tildaslash","followers_url":"https://api.github.com/users/tildaslash/followers","following_url":"https://api.github.com/users/tildaslash/following{/other_user}","gists_url":"https://api.github.com/users/tildaslash/gists{/gist_id}","starred_url":"https://api.github.com/users/tildaslash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildaslash/subscriptions","organizations_url":"https://api.github.com/users/tildaslash/orgs","repos_url":"https://api.github.com/users/tildaslash/repos","events_url":"https://api.github.com/users/tildaslash/events{/privacy}","received_events_url":"https://api.github.com/users/tildaslash/received_events","type":"Organization","site_admin":false},"repo":{"id":8245224,"name":"RatticWeb","full_name":"tildaslash/RatticWeb","owner":{"login":"tildaslash","id":3614741,"avatar_url":"https://avatars.githubusercontent.com/u/3614741?v=3","gravatar_id":"","url":"https://api.github.com/users/tildaslash","html_url":"https://github.com/tildaslash","followers_url":"https://api.github.com/users/tildaslash/followers","following_url":"https://api.github.com/users/tildaslash/following{/other_user}","gists_url":"https://api.github.com/users/tildaslash/gists{/gist_id}","starred_url":"https://api.github.com/users/tildaslash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildaslash/subscriptions","organizations_url":"https://api.github.com/users/tildaslash/orgs","repos_url":"https://api.github.com/users/tildaslash/repos","events_url":"https://api.github.com/users/tildaslash/events{/privacy}","received_events_url":"https://api.github.com/users/tildaslash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tildaslash/RatticWeb","description":"Password Management for Humans","fork":false,"url":"https://api.github.com/repos/tildaslash/RatticWeb","forks_url":"https://api.github.com/repos/tildaslash/RatticWeb/forks","keys_url":"https://api.github.com/repos/tildaslash/RatticWeb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tildaslash/RatticWeb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tildaslash/RatticWeb/teams","hooks_url":"https://api.github.com/repos/tildaslash/RatticWeb/hooks","issue_events_url":"https://api.github.com/repos/tildaslash/RatticWeb/issues/events{/number}","events_url":"https://api.github.com/repos/tildaslash/RatticWeb/events","assignees_url":"https://api.github.com/repos/tildaslash/RatticWeb/assignees{/user}","branches_url":"https://api.github.com/repos/tildaslash/RatticWeb/branches{/branch}","tags_url":"https://api.github.com/repos/tildaslash/RatticWeb/tags","blobs_url":"https://api.github.com/repos/tildaslash/RatticWeb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tildaslash/RatticWeb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tildaslash/RatticWeb/git/refs{/sha}","trees_url":"https://api.github.com/repos/tildaslash/RatticWeb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tildaslash/RatticWeb/statuses/{sha}","languages_url":"https://api.github.com/repos/tildaslash/RatticWeb/languages","stargazers_url":"https://api.github.com/repos/tildaslash/RatticWeb/stargazers","contributors_url":"https://api.github.com/repos/tildaslash/RatticWeb/contributors","subscribers_url":"https://api.github.com/repos/tildaslash/RatticWeb/subscribers","subscription_url":"https://api.github.com/repos/tildaslash/RatticWeb/subscription","commits_url":"https://api.github.com/repos/tildaslash/RatticWeb/commits{/sha}","git_commits_url":"https://api.github.com/repos/tildaslash/RatticWeb/git/commits{/sha}","comments_url":"https://api.github.com/repos/tildaslash/RatticWeb/comments{/number}","issue_comment_url":"https://api.github.com/repos/tildaslash/RatticWeb/issues/comments/{number}","contents_url":"https://api.github.com/repos/tildaslash/RatticWeb/contents/{+path}","compare_url":"https://api.github.com/repos/tildaslash/RatticWeb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tildaslash/RatticWeb/merges","archive_url":"https://api.github.com/repos/tildaslash/RatticWeb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tildaslash/RatticWeb/downloads","issues_url":"https://api.github.com/repos/tildaslash/RatticWeb/issues{/number}","pulls_url":"https://api.github.com/repos/tildaslash/RatticWeb/pulls{/number}","milestones_url":"https://api.github.com/repos/tildaslash/RatticWeb/milestones{/number}","notifications_url":"https://api.github.com/repos/tildaslash/RatticWeb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tildaslash/RatticWeb/labels{/name}","releases_url":"https://api.github.com/repos/tildaslash/RatticWeb/releases{/id}","created_at":"2013-02-17T03:05:42Z","updated_at":"2015-02-15T00:25:51Z","pushed_at":"2015-02-02T20:31:45Z","git_url":"git://github.com/tildaslash/RatticWeb.git","ssh_url":"git@github.com:tildaslash/RatticWeb.git","clone_url":"https://github.com/tildaslash/RatticWeb.git","svn_url":"https://github.com/tildaslash/RatticWeb","homepage":"http://rattic.org/","size":4210,"stargazers_count":122,"watchers_count":122,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":43,"forks":35,"open_issues":43,"watchers":122,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tildaslash/RatticWeb/pulls/332"},"html":{"href":"https://github.com/tildaslash/RatticWeb/pull/332"},"issue":{"href":"https://api.github.com/repos/tildaslash/RatticWeb/issues/332"},"comments":{"href":"https://api.github.com/repos/tildaslash/RatticWeb/issues/332/comments"},"review_comments":{"href":"https://api.github.com/repos/tildaslash/RatticWeb/pulls/332/comments"},"review_comment":{"href":"https://api.github.com/repos/tildaslash/RatticWeb/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/tildaslash/RatticWeb/pulls/332/commits"},"statuses":{"href":"https://api.github.com/repos/tildaslash/RatticWeb/statuses/ac8f93bb24e58e366a0fd740460bdcae2ee8093d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":12,"additions":837,"deletions":35,"changed_files":31}}