{"action":"created","comment":{"url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/comments/40535878","id":40535878,"diff_hunk":"@@ -0,0 +1,83 @@\n+// The tests in this file are interactive and require user input. They\n+// are therefore not run by default. to run these tests please run:\n+// \tgo test -tags interactive gopkg.in/macaroon-bakery.v1/httpbakery/form\n+// +build interactive,!windows\n+\n+package form_test\n+\n+import (\n+\t\"fmt\"\n+\t\"os\"\n+\n+\t\"golang.org/x/crypto/ssh/terminal\"\n+\tgc \"gopkg.in/check.v1\"\n+\n+\t\"gopkg.in/macaroon-bakery.v1/httpbakery/form\"\n+)\n+\n+type interactiveSuite struct{}\n+\n+var _ = gc.Suite(&interactiveSuite{})\n+\n+var interactiveIOPrompterTests = []struct {\n+\tabout       string\n+\tmessage     string\n+\tdescription string\n+\tdef         string\n+\tsecret      bool\n+\texpect      string\n+}{{\n+\tabout:       \"simple prompt\",\n+\tmessage:     `Please enter \"pass\" at the following prompt.`,\n+\tdescription: \"test\",\n+\texpect:      \"pass\",\n+}, {\n+\tabout:       \"prompt with default\",\n+\tmessage:     `Please press enter on the following prompt.`,\n+\tdescription: \"test\",\n+\tdef:         \"pass\",\n+\texpect:      \"pass\",\n+}, {\n+\tabout:       \"prompt with default\",\n+\tmessage:     `Please enter \"pass\" at the following prompt.`,\n+\tdescription: \"test\",\n+\tdef:         \"fail\",\n+\texpect:      \"pass\",\n+}, {\n+\tabout:       \"secret\",\n+\tmessage:     `Please enter \"pass\" at the following prompt (there should be no echo)`,\n+\tdescription: \"test\",\n+\tsecret:      true,\n+\texpect:      \"pass\",\n+}, {\n+\tabout:       \"prompt with default\",\n+\tmessage:     `Please press enter on the following prompt.`,\n+\tdescription: \"test\",\n+\tdef:         \"pass\",\n+\tsecret:      true,\n+\texpect:      \"pass\",\n+}, {\n+\tabout:       \"prompt with default\",\n+\tmessage:     `Please enter \"pass\" at the following prompt (there should be no echo)`,\n+\tdescription: \"test\",\n+\tdef:         \"fail\",\n+\tsecret:      true,\n+\texpect:      \"pass\",\n+}}\n+\n+func (s *interactiveSuite) TestIOPrompter(c *gc.C) {\n+\tf, err := os.OpenFile(\"/dev/tty\", os.O_RDWR, 0666)","path":"httpbakery/form/interactive_test.go","position":69,"original_position":69,"commit_id":"90e639d75a835985053919f45207285045bf548b","original_commit_id":"90e639d75a835985053919f45207285045bf548b","user":{"login":"mhilton","id":1136018,"avatar_url":"https://avatars.githubusercontent.com/u/1136018?v=3","gravatar_id":"","url":"https://api.github.com/users/mhilton","html_url":"https://github.com/mhilton","followers_url":"https://api.github.com/users/mhilton/followers","following_url":"https://api.github.com/users/mhilton/following{/other_user}","gists_url":"https://api.github.com/users/mhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/mhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhilton/subscriptions","organizations_url":"https://api.github.com/users/mhilton/orgs","repos_url":"https://api.github.com/users/mhilton/repos","events_url":"https://api.github.com/users/mhilton/events{/privacy}","received_events_url":"https://api.github.com/users/mhilton/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-09-28T10:03:56Z","updated_at":"2015-09-28T10:03:56Z","html_url":"https://github.com/go-macaroon-bakery/macaroon-bakery/pull/67#discussion_r40535878","pull_request_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/comments/40535878"},"html":{"href":"https://github.com/go-macaroon-bakery/macaroon-bakery/pull/67#discussion_r40535878"},"pull_request":{"href":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/67","id":45866767,"html_url":"https://github.com/go-macaroon-bakery/macaroon-bakery/pull/67","diff_url":"https://github.com/go-macaroon-bakery/macaroon-bakery/pull/67.diff","patch_url":"https://github.com/go-macaroon-bakery/macaroon-bakery/pull/67.patch","issue_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/issues/67","number":67,"state":"open","locked":false,"title":"simple CLI form client","user":{"login":"mhilton","id":1136018,"avatar_url":"https://avatars.githubusercontent.com/u/1136018?v=3","gravatar_id":"","url":"https://api.github.com/users/mhilton","html_url":"https://github.com/mhilton","followers_url":"https://api.github.com/users/mhilton/followers","following_url":"https://api.github.com/users/mhilton/following{/other_user}","gists_url":"https://api.github.com/users/mhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/mhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhilton/subscriptions","organizations_url":"https://api.github.com/users/mhilton/orgs","repos_url":"https://api.github.com/users/mhilton/repos","events_url":"https://api.github.com/users/mhilton/events{/privacy}","received_events_url":"https://api.github.com/users/mhilton/received_events","type":"User","site_admin":false},"body":"Simple client for filling out form logins on the command line.","created_at":"2015-09-24T07:30:16Z","updated_at":"2015-09-28T10:03:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6286d27c3ab1e2d71b41e927c36f6f61c127980","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/67/commits","review_comments_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/67/comments","review_comment_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/issues/67/comments","statuses_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/statuses/90e639d75a835985053919f45207285045bf548b","head":{"label":"mhilton:006-form-client","ref":"006-form-client","sha":"90e639d75a835985053919f45207285045bf548b","user":{"login":"mhilton","id":1136018,"avatar_url":"https://avatars.githubusercontent.com/u/1136018?v=3","gravatar_id":"","url":"https://api.github.com/users/mhilton","html_url":"https://github.com/mhilton","followers_url":"https://api.github.com/users/mhilton/followers","following_url":"https://api.github.com/users/mhilton/following{/other_user}","gists_url":"https://api.github.com/users/mhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/mhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhilton/subscriptions","organizations_url":"https://api.github.com/users/mhilton/orgs","repos_url":"https://api.github.com/users/mhilton/repos","events_url":"https://api.github.com/users/mhilton/events{/privacy}","received_events_url":"https://api.github.com/users/mhilton/received_events","type":"User","site_admin":false},"repo":{"id":29598274,"name":"macaroon-bakery","full_name":"mhilton/macaroon-bakery","owner":{"login":"mhilton","id":1136018,"avatar_url":"https://avatars.githubusercontent.com/u/1136018?v=3","gravatar_id":"","url":"https://api.github.com/users/mhilton","html_url":"https://github.com/mhilton","followers_url":"https://api.github.com/users/mhilton/followers","following_url":"https://api.github.com/users/mhilton/following{/other_user}","gists_url":"https://api.github.com/users/mhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/mhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhilton/subscriptions","organizations_url":"https://api.github.com/users/mhilton/orgs","repos_url":"https://api.github.com/users/mhilton/repos","events_url":"https://api.github.com/users/mhilton/events{/privacy}","received_events_url":"https://api.github.com/users/mhilton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mhilton/macaroon-bakery","description":"We bake 'em sweet, we bake 'em nice","fork":true,"url":"https://api.github.com/repos/mhilton/macaroon-bakery","forks_url":"https://api.github.com/repos/mhilton/macaroon-bakery/forks","keys_url":"https://api.github.com/repos/mhilton/macaroon-bakery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mhilton/macaroon-bakery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mhilton/macaroon-bakery/teams","hooks_url":"https://api.github.com/repos/mhilton/macaroon-bakery/hooks","issue_events_url":"https://api.github.com/repos/mhilton/macaroon-bakery/issues/events{/number}","events_url":"https://api.github.com/repos/mhilton/macaroon-bakery/events","assignees_url":"https://api.github.com/repos/mhilton/macaroon-bakery/assignees{/user}","branches_url":"https://api.github.com/repos/mhilton/macaroon-bakery/branches{/branch}","tags_url":"https://api.github.com/repos/mhilton/macaroon-bakery/tags","blobs_url":"https://api.github.com/repos/mhilton/macaroon-bakery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mhilton/macaroon-bakery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mhilton/macaroon-bakery/git/refs{/sha}","trees_url":"https://api.github.com/repos/mhilton/macaroon-bakery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mhilton/macaroon-bakery/statuses/{sha}","languages_url":"https://api.github.com/repos/mhilton/macaroon-bakery/languages","stargazers_url":"https://api.github.com/repos/mhilton/macaroon-bakery/stargazers","contributors_url":"https://api.github.com/repos/mhilton/macaroon-bakery/contributors","subscribers_url":"https://api.github.com/repos/mhilton/macaroon-bakery/subscribers","subscription_url":"https://api.github.com/repos/mhilton/macaroon-bakery/subscription","commits_url":"https://api.github.com/repos/mhilton/macaroon-bakery/commits{/sha}","git_commits_url":"https://api.github.com/repos/mhilton/macaroon-bakery/git/commits{/sha}","comments_url":"https://api.github.com/repos/mhilton/macaroon-bakery/comments{/number}","issue_comment_url":"https://api.github.com/repos/mhilton/macaroon-bakery/issues/comments{/number}","contents_url":"https://api.github.com/repos/mhilton/macaroon-bakery/contents/{+path}","compare_url":"https://api.github.com/repos/mhilton/macaroon-bakery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mhilton/macaroon-bakery/merges","archive_url":"https://api.github.com/repos/mhilton/macaroon-bakery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mhilton/macaroon-bakery/downloads","issues_url":"https://api.github.com/repos/mhilton/macaroon-bakery/issues{/number}","pulls_url":"https://api.github.com/repos/mhilton/macaroon-bakery/pulls{/number}","milestones_url":"https://api.github.com/repos/mhilton/macaroon-bakery/milestones{/number}","notifications_url":"https://api.github.com/repos/mhilton/macaroon-bakery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mhilton/macaroon-bakery/labels{/name}","releases_url":"https://api.github.com/repos/mhilton/macaroon-bakery/releases{/id}","created_at":"2015-01-21T16:15:10Z","updated_at":"2015-01-21T16:15:11Z","pushed_at":"2015-09-24T07:28:13Z","git_url":"git://github.com/mhilton/macaroon-bakery.git","ssh_url":"git@github.com:mhilton/macaroon-bakery.git","clone_url":"https://github.com/mhilton/macaroon-bakery.git","svn_url":"https://github.com/mhilton/macaroon-bakery","homepage":null,"size":449,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"v0"}},"base":{"label":"go-macaroon-bakery:v1","ref":"v1","sha":"cc49c6f866852bd28a0362465c5d41e6652f9482","user":{"login":"go-macaroon-bakery","id":9721471,"avatar_url":"https://avatars.githubusercontent.com/u/9721471?v=3","gravatar_id":"","url":"https://api.github.com/users/go-macaroon-bakery","html_url":"https://github.com/go-macaroon-bakery","followers_url":"https://api.github.com/users/go-macaroon-bakery/followers","following_url":"https://api.github.com/users/go-macaroon-bakery/following{/other_user}","gists_url":"https://api.github.com/users/go-macaroon-bakery/gists{/gist_id}","starred_url":"https://api.github.com/users/go-macaroon-bakery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-macaroon-bakery/subscriptions","organizations_url":"https://api.github.com/users/go-macaroon-bakery/orgs","repos_url":"https://api.github.com/users/go-macaroon-bakery/repos","events_url":"https://api.github.com/users/go-macaroon-bakery/events{/privacy}","received_events_url":"https://api.github.com/users/go-macaroon-bakery/received_events","type":"Organization","site_admin":false},"repo":{"id":26593206,"name":"macaroon-bakery","full_name":"go-macaroon-bakery/macaroon-bakery","owner":{"login":"go-macaroon-bakery","id":9721471,"avatar_url":"https://avatars.githubusercontent.com/u/9721471?v=3","gravatar_id":"","url":"https://api.github.com/users/go-macaroon-bakery","html_url":"https://github.com/go-macaroon-bakery","followers_url":"https://api.github.com/users/go-macaroon-bakery/followers","following_url":"https://api.github.com/users/go-macaroon-bakery/following{/other_user}","gists_url":"https://api.github.com/users/go-macaroon-bakery/gists{/gist_id}","starred_url":"https://api.github.com/users/go-macaroon-bakery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-macaroon-bakery/subscriptions","organizations_url":"https://api.github.com/users/go-macaroon-bakery/orgs","repos_url":"https://api.github.com/users/go-macaroon-bakery/repos","events_url":"https://api.github.com/users/go-macaroon-bakery/events{/privacy}","received_events_url":"https://api.github.com/users/go-macaroon-bakery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/go-macaroon-bakery/macaroon-bakery","description":"We bake 'em sweet, we bake 'em nice","fork":false,"url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery","forks_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/forks","keys_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/teams","hooks_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/hooks","issue_events_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/issues/events{/number}","events_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/events","assignees_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/assignees{/user}","branches_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/branches{/branch}","tags_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/tags","blobs_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/git/refs{/sha}","trees_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/statuses/{sha}","languages_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/languages","stargazers_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/stargazers","contributors_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/contributors","subscribers_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/subscribers","subscription_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/subscription","commits_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/commits{/sha}","git_commits_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/git/commits{/sha}","comments_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/comments{/number}","issue_comment_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/issues/comments{/number}","contents_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/contents/{+path}","compare_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/merges","archive_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/downloads","issues_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/issues{/number}","pulls_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls{/number}","milestones_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/milestones{/number}","notifications_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/labels{/name}","releases_url":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/releases{/id}","created_at":"2014-11-13T15:08:41Z","updated_at":"2015-06-04T11:37:00Z","pushed_at":"2015-09-27T21:02:37Z","git_url":"git://github.com/go-macaroon-bakery/macaroon-bakery.git","ssh_url":"git@github.com:go-macaroon-bakery/macaroon-bakery.git","clone_url":"https://github.com/go-macaroon-bakery/macaroon-bakery.git","svn_url":"https://github.com/go-macaroon-bakery/macaroon-bakery","homepage":null,"size":792,"stargazers_count":13,"watchers_count":13,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":3,"forks":9,"open_issues":3,"watchers":13,"default_branch":"v1"}},"_links":{"self":{"href":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/67"},"html":{"href":"https://github.com/go-macaroon-bakery/macaroon-bakery/pull/67"},"issue":{"href":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/issues/67"},"comments":{"href":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/go-macaroon-bakery/macaroon-bakery/statuses/90e639d75a835985053919f45207285045bf548b"}}}}