GitHub PullRequestReviewCommentEvent at 2014-11-18 14:00:14
Repository: foreman
Actor: dragonfly9517
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/20506094","id":20506094,"diff_hunk":"@@ -17,6 +17,18 @@\n \n class AuthSource < ActiveRecord::Base\n   include Authorizable\n+\n+  class AuthSourceNameValidator < ActiveModel::Validator\n+    def validate(record)\n+      if record.class != AuthSourceInternal and record.class != AuthSourceHidden","path":"app/models/auth_source.rb","position":7,"original_position":7,"commit_id":"0304215625cc2fd838d4e1cd49ab99e7dffc5440","original_commit_id":"0304215625cc2fd838d4e1cd49ab99e7dffc5440","user":{"login":"dragonfly9517","id":5465412,"avatar_url":"https://avatars.githubusercontent.com/u/5465412?v=3","gravatar_id":"","url":"https://api.github.com/users/dragonfly9517","html_url":"https://github.com/dragonfly9517","followers_url":"https://api.github.com/users/dragonfly9517/followers","following_url":"https://api.github.com/users/dragonfly9517/following{/other_user}","gists_url":"https://api.github.com/users/dragonfly9517/gists{/gist_id}","starred_url":"https://api.github.com/users/dragonfly9517/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragonfly9517/subscriptions","organizations_url":"https://api.github.com/users/dragonfly9517/orgs","repos_url":"https://api.github.com/users/dragonfly9517/repos","events_url":"https://api.github.com/users/dragonfly9517/events{/privacy}","received_events_url":"https://api.github.com/users/dragonfly9517/received_events","type":"User","site_admin":false},"body":"@eLobato : Well this validation is supposed to be for all auth sources except ```AuthSourceInternal``` and ```AuthSourceHidden``` , hence I added it to the ```AuthSource``` class. If we decide to add simple one line validations to ```AuthSourceExternal``` and ```AuthSourceLdap```, then in the future if more AuthSources are added, then the same validation for the exclusion of ```Internal``` and ```Hidden``` names has to be added there too. Hence I think, to avoid code duplication in the design, adding the validation in ```AuthSource``` would make more sense. \r\nBut let me know if you think it would be a good idea to add simple validations in ```AuthSourceExternal``` and ```AuthSourceLdap```, I will push a new commit with the same.","created_at":"2014-11-18T14:00:14Z","updated_at":"2014-11-18T14:00:14Z","html_url":"https://github.com/theforeman/foreman/pull/1830#discussion_r20506094","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/1830","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/20506094"},"html":{"href":"https://github.com/theforeman/foreman/pull/1830#discussion_r20506094"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/1830"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/1830","id":22466846,"html_url":"https://github.com/theforeman/foreman/pull/1830","diff_url":"https://github.com/theforeman/foreman/pull/1830.diff","patch_url":"https://github.com/theforeman/foreman/pull/1830.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/1830","number":1830,"state":"open","locked":false,"title":"Fixes #6536 Appends the keys of AuthSourceInternal and AuthSourceHidden ...","user":{"login":"dragonfly9517","id":5465412,"avatar_url":"https://avatars.githubusercontent.com/u/5465412?v=3","gravatar_id":"","url":"https://api.github.com/users/dragonfly9517","html_url":"https://github.com/dragonfly9517","followers_url":"https://api.github.com/users/dragonfly9517/followers","following_url":"https://api.github.com/users/dragonfly9517/following{/other_user}","gists_url":"https://api.github.com/users/dragonfly9517/gists{/gist_id}","starred_url":"https://api.github.com/users/dragonfly9517/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragonfly9517/subscriptions","organizations_url":"https://api.github.com/users/dragonfly9517/orgs","repos_url":"https://api.github.com/users/dragonfly9517/repos","events_url":"https://api.github.com/users/dragonfly9517/events{/privacy}","received_events_url":"https://api.github.com/users/dragonfly9517/received_events","type":"User","site_admin":false},"body":"...by their MD5 hashes to make keywords 'Internal' and 'Hidden' available to Administrators when naming External Auth Sources","created_at":"2014-10-09T01:33:57Z","updated_at":"2014-11-18T14:00:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7c50125a28cbfdb510ffa7ba73981eef1096e46","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/1830/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/1830/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/{number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/1830/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/0304215625cc2fd838d4e1cd49ab99e7dffc5440","head":{"label":"dragonfly9517:6536-Adding_entropy_to_names_of_AuthSourceInternal_and_AuthSourceHidden","ref":"6536-Adding_entropy_to_names_of_AuthSourceInternal_and_AuthSourceHidden","sha":"0304215625cc2fd838d4e1cd49ab99e7dffc5440","user":{"login":"dragonfly9517","id":5465412,"avatar_url":"https://avatars.githubusercontent.com/u/5465412?v=3","gravatar_id":"","url":"https://api.github.com/users/dragonfly9517","html_url":"https://github.com/dragonfly9517","followers_url":"https://api.github.com/users/dragonfly9517/followers","following_url":"https://api.github.com/users/dragonfly9517/following{/other_user}","gists_url":"https://api.github.com/users/dragonfly9517/gists{/gist_id}","starred_url":"https://api.github.com/users/dragonfly9517/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragonfly9517/subscriptions","organizations_url":"https://api.github.com/users/dragonfly9517/orgs","repos_url":"https://api.github.com/users/dragonfly9517/repos","events_url":"https://api.github.com/users/dragonfly9517/events{/privacy}","received_events_url":"https://api.github.com/users/dragonfly9517/received_events","type":"User","site_admin":false},"repo":{"id":24879961,"name":"foreman","full_name":"dragonfly9517/foreman","owner":{"login":"dragonfly9517","id":5465412,"avatar_url":"https://avatars.githubusercontent.com/u/5465412?v=3","gravatar_id":"","url":"https://api.github.com/users/dragonfly9517","html_url":"https://github.com/dragonfly9517","followers_url":"https://api.github.com/users/dragonfly9517/followers","following_url":"https://api.github.com/users/dragonfly9517/following{/other_user}","gists_url":"https://api.github.com/users/dragonfly9517/gists{/gist_id}","starred_url":"https://api.github.com/users/dragonfly9517/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragonfly9517/subscriptions","organizations_url":"https://api.github.com/users/dragonfly9517/orgs","repos_url":"https://api.github.com/users/dragonfly9517/repos","events_url":"https://api.github.com/users/dragonfly9517/events{/privacy}","received_events_url":"https://api.github.com/users/dragonfly9517/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dragonfly9517/foreman","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/dragonfly9517/foreman","forks_url":"https://api.github.com/repos/dragonfly9517/foreman/forks","keys_url":"https://api.github.com/repos/dragonfly9517/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dragonfly9517/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dragonfly9517/foreman/teams","hooks_url":"https://api.github.com/repos/dragonfly9517/foreman/hooks","issue_events_url":"https://api.github.com/repos/dragonfly9517/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/dragonfly9517/foreman/events","assignees_url":"https://api.github.com/repos/dragonfly9517/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/dragonfly9517/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/dragonfly9517/foreman/tags","blobs_url":"https://api.github.com/repos/dragonfly9517/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dragonfly9517/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dragonfly9517/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/dragonfly9517/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dragonfly9517/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/dragonfly9517/foreman/languages","stargazers_url":"https://api.github.com/repos/dragonfly9517/foreman/stargazers","contributors_url":"https://api.github.com/repos/dragonfly9517/foreman/contributors","subscribers_url":"https://api.github.com/repos/dragonfly9517/foreman/subscribers","subscription_url":"https://api.github.com/repos/dragonfly9517/foreman/subscription","commits_url":"https://api.github.com/repos/dragonfly9517/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/dragonfly9517/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/dragonfly9517/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/dragonfly9517/foreman/issues/comments/{number}","contents_url":"https://api.github.com/repos/dragonfly9517/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/dragonfly9517/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dragonfly9517/foreman/merges","archive_url":"https://api.github.com/repos/dragonfly9517/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dragonfly9517/foreman/downloads","issues_url":"https://api.github.com/repos/dragonfly9517/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/dragonfly9517/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/dragonfly9517/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/dragonfly9517/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dragonfly9517/foreman/labels{/name}","releases_url":"https://api.github.com/repos/dragonfly9517/foreman/releases{/id}","created_at":"2014-10-07T06:55:21Z","updated_at":"2014-10-11T00:45:04Z","pushed_at":"2014-10-20T22:02:50Z","git_url":"git://github.com/dragonfly9517/foreman.git","ssh_url":"git@github.com:dragonfly9517/foreman.git","clone_url":"https://github.com/dragonfly9517/foreman.git","svn_url":"https://github.com/dragonfly9517/foreman","homepage":"http://theforeman.org","size":23254,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"088c656eb19ddc57a6ce22ad3c6448bdd2a7c919","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":258750,"name":"foreman","full_name":"theforeman/foreman","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/foreman","description":"an application that automates the lifecycle of servers ","fork":false,"url":"https://api.github.com/repos/theforeman/foreman","forks_url":"https://api.github.com/repos/theforeman/foreman/forks","keys_url":"https://api.github.com/repos/theforeman/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman/events","assignees_url":"https://api.github.com/repos/theforeman/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman/issues/comments/{number}","contents_url":"https://api.github.com/repos/theforeman/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman/merges","archive_url":"https://api.github.com/repos/theforeman/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman/releases{/id}","created_at":"2009-07-23T15:07:00Z","updated_at":"2014-11-18T10:37:56Z","pushed_at":"2014-11-18T10:37:55Z","git_url":"git://github.com/theforeman/foreman.git","ssh_url":"git@github.com:theforeman/foreman.git","clone_url":"https://github.com/theforeman/foreman.git","svn_url":"https://github.com/theforeman/foreman","homepage":"http://theforeman.org","size":71625,"stargazers_count":590,"watchers_count":590,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":331,"mirror_url":null,"open_issues_count":66,"forks":331,"open_issues":66,"watchers":590,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/1830"},"html":{"href":"https://github.com/theforeman/foreman/pull/1830"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/1830"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/1830/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/1830/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/1830/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/0304215625cc2fd838d4e1cd49ab99e7dffc5440"}}}}