{"action":"created","comment":{"url":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/comments/83556913","pull_request_review_id":4393843,"id":83556913,"diff_hunk":"@@ -0,0 +1,35 @@\n+package models\n+\n+import (\n+\t\"fmt\"\n+\t\"reflect\"\n+)\n+\n+// UserType represents the user with email\n+type UserType struct {\n+\tSimpleType\n+\tvalue interface{}\n+}\n+\n+func (fieldType UserType) ConvertToModel(value interface{}) (interface{}, error) {\n+\tif value == nil {\n+\t\treturn nil, nil\n+\t}\n+\tvalueType := reflect.TypeOf(value)\n+\tif valueType.Kind() != reflect.String {\n+\t\treturn nil, fmt.Errorf(\"value %v should be %s, but is %s\", value, \"string\", valueType.Name())\n+\t}\n+\t// check with DB","path":"models/user_type.go","position":24,"original_position":22,"commit_id":"ab1c8adf2d89fa25ce0c7f99dadde6fcc592f8ad","original_commit_id":"e70c088dc99f9cb4b76eb201b950111aa19fd3d0","user":{"login":"aslakknutsen","id":132158,"avatar_url":"https://avatars.githubusercontent.com/u/132158?v=3","gravatar_id":"","url":"https://api.github.com/users/aslakknutsen","html_url":"https://github.com/aslakknutsen","followers_url":"https://api.github.com/users/aslakknutsen/followers","following_url":"https://api.github.com/users/aslakknutsen/following{/other_user}","gists_url":"https://api.github.com/users/aslakknutsen/gists{/gist_id}","starred_url":"https://api.github.com/users/aslakknutsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aslakknutsen/subscriptions","organizations_url":"https://api.github.com/users/aslakknutsen/orgs","repos_url":"https://api.github.com/users/aslakknutsen/repos","events_url":"https://api.github.com/users/aslakknutsen/events{/privacy}","received_events_url":"https://api.github.com/users/aslakknutsen/received_events","type":"User","site_admin":false},"body":"We don't need to check the user id here. The user id is coming from a signed and verified token produced by us. If we can't trust ourselves, then... ","created_at":"2016-10-16T18:25:50Z","updated_at":"2016-10-16T18:25:50Z","html_url":"https://github.com/aslakknutsen/almighty-core/pull/7#discussion_r83556913","pull_request_url":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/comments/83556913"},"html":{"href":"https://github.com/aslakknutsen/almighty-core/pull/7#discussion_r83556913"},"pull_request":{"href":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/7","id":88988439,"html_url":"https://github.com/aslakknutsen/almighty-core/pull/7","diff_url":"https://github.com/aslakknutsen/almighty-core/pull/7.diff","patch_url":"https://github.com/aslakknutsen/almighty-core/pull/7.patch","issue_url":"https://api.github.com/repos/aslakknutsen/almighty-core/issues/7","number":7,"state":"open","locked":false,"title":"WIP: Set creator while WI creation","user":{"login":"pranavgore09","id":2026565,"avatar_url":"https://avatars.githubusercontent.com/u/2026565?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavgore09","html_url":"https://github.com/pranavgore09","followers_url":"https://api.github.com/users/pranavgore09/followers","following_url":"https://api.github.com/users/pranavgore09/following{/other_user}","gists_url":"https://api.github.com/users/pranavgore09/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavgore09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavgore09/subscriptions","organizations_url":"https://api.github.com/users/pranavgore09/orgs","repos_url":"https://api.github.com/users/pranavgore09/repos","events_url":"https://api.github.com/users/pranavgore09/events{/privacy}","received_events_url":"https://api.github.com/users/pranavgore09/received_events","type":"User","site_admin":false},"body":"Fixes [iss-244](https://github.com/almighty/almighty-core/issues/244)\r\nWhy:\r\nWe need to record who created what (in WI for now). Need to fill up the field 'Fields['system.creator']' by current logged in user's email.\r\n\r\nWhat:\r\nAs of now there is no special type which can identify a user in fields. Make use of tokenManager to read/extract tokens.\r\n\r\nHow:\r\nAdd a new UserType, Unmarshall FieldDefinition for UserType.\r\nMove Equaler, Lifecycle to new package to avaoid cyclic import.\r\nRemove some tests on temperory purpose.\r\n\r\nToDo:\r\n\r\nadd email to the system.creator\r\nadd middleware to consume Locate method.\r\nwrite/update tests which will use login context.","created_at":"2016-10-12T10:11:33Z","updated_at":"2016-10-16T18:25:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d4f651d85fba5a65a82de010e88e4a801e0015d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/7/commits","review_comments_url":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/7/comments","review_comment_url":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aslakknutsen/almighty-core/issues/7/comments","statuses_url":"https://api.github.com/repos/aslakknutsen/almighty-core/statuses/ab1c8adf2d89fa25ce0c7f99dadde6fcc592f8ad","head":{"label":"pranavgore09:user_auth0","ref":"user_auth0","sha":"ab1c8adf2d89fa25ce0c7f99dadde6fcc592f8ad","user":{"login":"pranavgore09","id":2026565,"avatar_url":"https://avatars.githubusercontent.com/u/2026565?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavgore09","html_url":"https://github.com/pranavgore09","followers_url":"https://api.github.com/users/pranavgore09/followers","following_url":"https://api.github.com/users/pranavgore09/following{/other_user}","gists_url":"https://api.github.com/users/pranavgore09/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavgore09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavgore09/subscriptions","organizations_url":"https://api.github.com/users/pranavgore09/orgs","repos_url":"https://api.github.com/users/pranavgore09/repos","events_url":"https://api.github.com/users/pranavgore09/events{/privacy}","received_events_url":"https://api.github.com/users/pranavgore09/received_events","type":"User","site_admin":false},"repo":{"id":64831426,"name":"almighty-core","full_name":"pranavgore09/almighty-core","owner":{"login":"pranavgore09","id":2026565,"avatar_url":"https://avatars.githubusercontent.com/u/2026565?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavgore09","html_url":"https://github.com/pranavgore09","followers_url":"https://api.github.com/users/pranavgore09/followers","following_url":"https://api.github.com/users/pranavgore09/following{/other_user}","gists_url":"https://api.github.com/users/pranavgore09/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavgore09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavgore09/subscriptions","organizations_url":"https://api.github.com/users/pranavgore09/orgs","repos_url":"https://api.github.com/users/pranavgore09/repos","events_url":"https://api.github.com/users/pranavgore09/events{/privacy}","received_events_url":"https://api.github.com/users/pranavgore09/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pranavgore09/almighty-core","description":null,"fork":true,"url":"https://api.github.com/repos/pranavgore09/almighty-core","forks_url":"https://api.github.com/repos/pranavgore09/almighty-core/forks","keys_url":"https://api.github.com/repos/pranavgore09/almighty-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pranavgore09/almighty-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pranavgore09/almighty-core/teams","hooks_url":"https://api.github.com/repos/pranavgore09/almighty-core/hooks","issue_events_url":"https://api.github.com/repos/pranavgore09/almighty-core/issues/events{/number}","events_url":"https://api.github.com/repos/pranavgore09/almighty-core/events","assignees_url":"https://api.github.com/repos/pranavgore09/almighty-core/assignees{/user}","branches_url":"https://api.github.com/repos/pranavgore09/almighty-core/branches{/branch}","tags_url":"https://api.github.com/repos/pranavgore09/almighty-core/tags","blobs_url":"https://api.github.com/repos/pranavgore09/almighty-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pranavgore09/almighty-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pranavgore09/almighty-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/pranavgore09/almighty-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pranavgore09/almighty-core/statuses/{sha}","languages_url":"https://api.github.com/repos/pranavgore09/almighty-core/languages","stargazers_url":"https://api.github.com/repos/pranavgore09/almighty-core/stargazers","contributors_url":"https://api.github.com/repos/pranavgore09/almighty-core/contributors","subscribers_url":"https://api.github.com/repos/pranavgore09/almighty-core/subscribers","subscription_url":"https://api.github.com/repos/pranavgore09/almighty-core/subscription","commits_url":"https://api.github.com/repos/pranavgore09/almighty-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/pranavgore09/almighty-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/pranavgore09/almighty-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/pranavgore09/almighty-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/pranavgore09/almighty-core/contents/{+path}","compare_url":"https://api.github.com/repos/pranavgore09/almighty-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pranavgore09/almighty-core/merges","archive_url":"https://api.github.com/repos/pranavgore09/almighty-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pranavgore09/almighty-core/downloads","issues_url":"https://api.github.com/repos/pranavgore09/almighty-core/issues{/number}","pulls_url":"https://api.github.com/repos/pranavgore09/almighty-core/pulls{/number}","milestones_url":"https://api.github.com/repos/pranavgore09/almighty-core/milestones{/number}","notifications_url":"https://api.github.com/repos/pranavgore09/almighty-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pranavgore09/almighty-core/labels{/name}","releases_url":"https://api.github.com/repos/pranavgore09/almighty-core/releases{/id}","deployments_url":"https://api.github.com/repos/pranavgore09/almighty-core/deployments","created_at":"2016-08-03T09:01:01Z","updated_at":"2016-08-03T09:01:02Z","pushed_at":"2016-10-14T02:27:24Z","git_url":"git://github.com/pranavgore09/almighty-core.git","ssh_url":"git@github.com:pranavgore09/almighty-core.git","clone_url":"https://github.com/pranavgore09/almighty-core.git","svn_url":"https://github.com/pranavgore09/almighty-core","homepage":null,"size":4229,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"aslakknutsen:user_auth","ref":"user_auth","sha":"b04f03581707a768f9471f8b840b9e729a94af5a","user":{"login":"aslakknutsen","id":132158,"avatar_url":"https://avatars.githubusercontent.com/u/132158?v=3","gravatar_id":"","url":"https://api.github.com/users/aslakknutsen","html_url":"https://github.com/aslakknutsen","followers_url":"https://api.github.com/users/aslakknutsen/followers","following_url":"https://api.github.com/users/aslakknutsen/following{/other_user}","gists_url":"https://api.github.com/users/aslakknutsen/gists{/gist_id}","starred_url":"https://api.github.com/users/aslakknutsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aslakknutsen/subscriptions","organizations_url":"https://api.github.com/users/aslakknutsen/orgs","repos_url":"https://api.github.com/users/aslakknutsen/repos","events_url":"https://api.github.com/users/aslakknutsen/events{/privacy}","received_events_url":"https://api.github.com/users/aslakknutsen/received_events","type":"User","site_admin":false},"repo":{"id":61881368,"name":"almighty-core","full_name":"aslakknutsen/almighty-core","owner":{"login":"aslakknutsen","id":132158,"avatar_url":"https://avatars.githubusercontent.com/u/132158?v=3","gravatar_id":"","url":"https://api.github.com/users/aslakknutsen","html_url":"https://github.com/aslakknutsen","followers_url":"https://api.github.com/users/aslakknutsen/followers","following_url":"https://api.github.com/users/aslakknutsen/following{/other_user}","gists_url":"https://api.github.com/users/aslakknutsen/gists{/gist_id}","starred_url":"https://api.github.com/users/aslakknutsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aslakknutsen/subscriptions","organizations_url":"https://api.github.com/users/aslakknutsen/orgs","repos_url":"https://api.github.com/users/aslakknutsen/repos","events_url":"https://api.github.com/users/aslakknutsen/events{/privacy}","received_events_url":"https://api.github.com/users/aslakknutsen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aslakknutsen/almighty-core","description":null,"fork":true,"url":"https://api.github.com/repos/aslakknutsen/almighty-core","forks_url":"https://api.github.com/repos/aslakknutsen/almighty-core/forks","keys_url":"https://api.github.com/repos/aslakknutsen/almighty-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aslakknutsen/almighty-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aslakknutsen/almighty-core/teams","hooks_url":"https://api.github.com/repos/aslakknutsen/almighty-core/hooks","issue_events_url":"https://api.github.com/repos/aslakknutsen/almighty-core/issues/events{/number}","events_url":"https://api.github.com/repos/aslakknutsen/almighty-core/events","assignees_url":"https://api.github.com/repos/aslakknutsen/almighty-core/assignees{/user}","branches_url":"https://api.github.com/repos/aslakknutsen/almighty-core/branches{/branch}","tags_url":"https://api.github.com/repos/aslakknutsen/almighty-core/tags","blobs_url":"https://api.github.com/repos/aslakknutsen/almighty-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aslakknutsen/almighty-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aslakknutsen/almighty-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/aslakknutsen/almighty-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aslakknutsen/almighty-core/statuses/{sha}","languages_url":"https://api.github.com/repos/aslakknutsen/almighty-core/languages","stargazers_url":"https://api.github.com/repos/aslakknutsen/almighty-core/stargazers","contributors_url":"https://api.github.com/repos/aslakknutsen/almighty-core/contributors","subscribers_url":"https://api.github.com/repos/aslakknutsen/almighty-core/subscribers","subscription_url":"https://api.github.com/repos/aslakknutsen/almighty-core/subscription","commits_url":"https://api.github.com/repos/aslakknutsen/almighty-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/aslakknutsen/almighty-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/aslakknutsen/almighty-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/aslakknutsen/almighty-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/aslakknutsen/almighty-core/contents/{+path}","compare_url":"https://api.github.com/repos/aslakknutsen/almighty-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aslakknutsen/almighty-core/merges","archive_url":"https://api.github.com/repos/aslakknutsen/almighty-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aslakknutsen/almighty-core/downloads","issues_url":"https://api.github.com/repos/aslakknutsen/almighty-core/issues{/number}","pulls_url":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls{/number}","milestones_url":"https://api.github.com/repos/aslakknutsen/almighty-core/milestones{/number}","notifications_url":"https://api.github.com/repos/aslakknutsen/almighty-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aslakknutsen/almighty-core/labels{/name}","releases_url":"https://api.github.com/repos/aslakknutsen/almighty-core/releases{/id}","deployments_url":"https://api.github.com/repos/aslakknutsen/almighty-core/deployments","created_at":"2016-06-24T11:57:12Z","updated_at":"2016-06-24T11:57:13Z","pushed_at":"2016-10-16T12:59:29Z","git_url":"git://github.com/aslakknutsen/almighty-core.git","ssh_url":"git@github.com:aslakknutsen/almighty-core.git","clone_url":"https://github.com/aslakknutsen/almighty-core.git","svn_url":"https://github.com/aslakknutsen/almighty-core","homepage":null,"size":526,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/7"},"html":{"href":"https://github.com/aslakknutsen/almighty-core/pull/7"},"issue":{"href":"https://api.github.com/repos/aslakknutsen/almighty-core/issues/7"},"comments":{"href":"https://api.github.com/repos/aslakknutsen/almighty-core/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aslakknutsen/almighty-core/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/aslakknutsen/almighty-core/statuses/ab1c8adf2d89fa25ce0c7f99dadde6fcc592f8ad"}}}}
{"actor":{"display_login":"aslakknutsen"}}