{"action":"created","comment":{"url":"https://api.github.com/repos/crate/crate/pulls/comments/151094521","pull_request_review_id":76738263,"id":151094521,"diff_hunk":"@@ -0,0 +1,77 @@\n+/*\n+ * Licensed to Crate under one or more contributor license agreements.\n+ * See the NOTICE file distributed with this work for additional\n+ * information regarding copyright ownership.  Crate licenses this file\n+ * to you under the Apache License, Version 2.0 (the \"License\"); you may\n+ * not use this file except in compliance with the License.  You may\n+ * obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+ * implied.  See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ *\n+ * However, if you have executed another commercial license agreement\n+ * with Crate these terms will supersede the license and you may use the\n+ * software solely pursuant to the terms of the relevant commercial\n+ * agreement.\n+ */\n+\n+package io.crate.user;\n+\n+import com.google.common.annotations.VisibleForTesting;\n+import io.crate.analyze.CreateUserAnalyzedStatement;\n+import io.crate.analyze.symbol.ParamSymbols;\n+import io.crate.analyze.symbol.Symbol;\n+import io.crate.analyze.symbol.ValueSymbolVisitor;\n+import io.crate.data.Row;\n+import org.elasticsearch.common.settings.SecureString;\n+\n+import java.security.GeneralSecurityException;\n+import java.util.Locale;\n+import java.util.Map;\n+import java.util.concurrent.CompletableFuture;\n+import java.util.function.BiFunction;\n+\n+import static io.crate.concurrent.CompletableFutures.failedFuture;\n+\n+public final class UserActions {\n+\n+    private UserActions() {\n+\n+    }\n+\n+    public static CompletableFuture<Long> executeCreateUser(BiFunction<String, SecureHash, CompletableFuture<Long>> userAction,","path":"sql/src/main/java/io/crate/user/UserActions.java","position":47,"original_position":47,"commit_id":"f4a8e4ae40cc89449fbfe9864db094d833bfd85f","original_commit_id":"f4a8e4ae40cc89449fbfe9864db094d833bfd85f","user":{"login":"seut","id":219690,"avatar_url":"https://avatars0.githubusercontent.com/u/219690?v=4","gravatar_id":"","url":"https://api.github.com/users/seut","html_url":"https://github.com/seut","followers_url":"https://api.github.com/users/seut/followers","following_url":"https://api.github.com/users/seut/following{/other_user}","gists_url":"https://api.github.com/users/seut/gists{/gist_id}","starred_url":"https://api.github.com/users/seut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seut/subscriptions","organizations_url":"https://api.github.com/users/seut/orgs","repos_url":"https://api.github.com/users/seut/repos","events_url":"https://api.github.com/users/seut/events{/privacy}","received_events_url":"https://api.github.com/users/seut/received_events","type":"User","site_admin":false},"body":"sry but still don't think the name is reflecting what this method is all about. the main thing here done is resolving the password and generating a hash out of it (and yes then applies the given BiFunction). maybe just let it generate the hash and do the execute out of this function like it was before? also this would be more correct at the exception handling as afaik the catched exception can only occur while generating the hash and not while applying the bifunction. by doing this, the related test method would also be much simpler and clear","created_at":"2017-11-15T10:59:04Z","updated_at":"2017-11-15T11:03:20Z","html_url":"https://github.com/crate/crate/pull/6519#discussion_r151094521","pull_request_url":"https://api.github.com/repos/crate/crate/pulls/6519","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/crate/crate/pulls/comments/151094521"},"html":{"href":"https://github.com/crate/crate/pull/6519#discussion_r151094521"},"pull_request":{"href":"https://api.github.com/repos/crate/crate/pulls/6519"}}},"pull_request":{"url":"https://api.github.com/repos/crate/crate/pulls/6519","id":152073610,"html_url":"https://github.com/crate/crate/pull/6519","diff_url":"https://github.com/crate/crate/pull/6519.diff","patch_url":"https://github.com/crate/crate/pull/6519.patch","issue_url":"https://api.github.com/repos/crate/crate/issues/6519","number":6519,"state":"open","locked":false,"title":"add password property to CREATE USER statement","user":{"login":"mikethebeer","id":6863216,"avatar_url":"https://avatars1.githubusercontent.com/u/6863216?v=4","gravatar_id":"","url":"https://api.github.com/users/mikethebeer","html_url":"https://github.com/mikethebeer","followers_url":"https://api.github.com/users/mikethebeer/followers","following_url":"https://api.github.com/users/mikethebeer/following{/other_user}","gists_url":"https://api.github.com/users/mikethebeer/gists{/gist_id}","starred_url":"https://api.github.com/users/mikethebeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikethebeer/subscriptions","organizations_url":"https://api.github.com/users/mikethebeer/orgs","repos_url":"https://api.github.com/users/mikethebeer/repos","events_url":"https://api.github.com/users/mikethebeer/events{/privacy}","received_events_url":"https://api.github.com/users/mikethebeer/received_events","type":"User","site_admin":false},"body":"This will extend the CREATE USER statement with an optional password property. It allows to specify a password for the user that is being created.\r\n\r\nUsage:\r\n\r\n```sql\r\nCREATE USER foo WITH (password = 'pass');\r\n```\r\n\r\nThe password information is computed using a salted PBKDF2 algorithm that produces a SHA-512 hash. The `SecureHash` (containing iterations, salt and SHA-512 hash) is stored in the custom metdata.\r\n\r\nTo be followed:\r\n* User Meta Data Migration layer that ensures correct user-data migration if Crate gets updated.","created_at":"2017-11-11T20:27:55Z","updated_at":"2017-11-15T11:03:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44397b3bcdd74cb1ea47a8d28fff04640e65ef1d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/crate/crate/pulls/6519/commits","review_comments_url":"https://api.github.com/repos/crate/crate/pulls/6519/comments","review_comment_url":"https://api.github.com/repos/crate/crate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crate/crate/issues/6519/comments","statuses_url":"https://api.github.com/repos/crate/crate/statuses/f4a8e4ae40cc89449fbfe9864db094d833bfd85f","head":{"label":"crate:m/create-user-pw","ref":"m/create-user-pw","sha":"f4a8e4ae40cc89449fbfe9864db094d833bfd85f","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars3.githubusercontent.com/u/4048232?v=4","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":9342529,"name":"crate","full_name":"crate/crate","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars3.githubusercontent.com/u/4048232?v=4","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/crate","description":"CrateDB is a distributed SQL database that makes it simple to store and analyze massive amounts of machine data in real-time.","fork":false,"url":"https://api.github.com/repos/crate/crate","forks_url":"https://api.github.com/repos/crate/crate/forks","keys_url":"https://api.github.com/repos/crate/crate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/crate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/crate/teams","hooks_url":"https://api.github.com/repos/crate/crate/hooks","issue_events_url":"https://api.github.com/repos/crate/crate/issues/events{/number}","events_url":"https://api.github.com/repos/crate/crate/events","assignees_url":"https://api.github.com/repos/crate/crate/assignees{/user}","branches_url":"https://api.github.com/repos/crate/crate/branches{/branch}","tags_url":"https://api.github.com/repos/crate/crate/tags","blobs_url":"https://api.github.com/repos/crate/crate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/crate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/crate/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/crate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/crate/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/crate/languages","stargazers_url":"https://api.github.com/repos/crate/crate/stargazers","contributors_url":"https://api.github.com/repos/crate/crate/contributors","subscribers_url":"https://api.github.com/repos/crate/crate/subscribers","subscription_url":"https://api.github.com/repos/crate/crate/subscription","commits_url":"https://api.github.com/repos/crate/crate/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/crate/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/crate/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/crate/issues/comments{/number}","contents_url":"https://api.github.com/repos/crate/crate/contents/{+path}","compare_url":"https://api.github.com/repos/crate/crate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/crate/merges","archive_url":"https://api.github.com/repos/crate/crate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/crate/downloads","issues_url":"https://api.github.com/repos/crate/crate/issues{/number}","pulls_url":"https://api.github.com/repos/crate/crate/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/crate/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/crate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/crate/labels{/name}","releases_url":"https://api.github.com/repos/crate/crate/releases{/id}","deployments_url":"https://api.github.com/repos/crate/crate/deployments","created_at":"2013-04-10T09:17:16Z","updated_at":"2017-11-15T07:32:47Z","pushed_at":"2017-11-15T10:34:26Z","git_url":"git://github.com/crate/crate.git","ssh_url":"git@github.com:crate/crate.git","clone_url":"https://github.com/crate/crate.git","svn_url":"https://github.com/crate/crate","homepage":"https://crate.io","size":81598,"stargazers_count":1834,"watchers_count":1834,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":236,"mirror_url":null,"archived":false,"open_issues_count":79,"forks":236,"open_issues":79,"watchers":1834,"default_branch":"master"}},"base":{"label":"crate:pw-auth","ref":"pw-auth","sha":"cf98a1e95f4a59d18834a2355fe1c832159b71de","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars3.githubusercontent.com/u/4048232?v=4","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":9342529,"name":"crate","full_name":"crate/crate","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars3.githubusercontent.com/u/4048232?v=4","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/crate","description":"CrateDB is a distributed SQL database that makes it simple to store and analyze massive amounts of machine data in real-time.","fork":false,"url":"https://api.github.com/repos/crate/crate","forks_url":"https://api.github.com/repos/crate/crate/forks","keys_url":"https://api.github.com/repos/crate/crate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/crate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/crate/teams","hooks_url":"https://api.github.com/repos/crate/crate/hooks","issue_events_url":"https://api.github.com/repos/crate/crate/issues/events{/number}","events_url":"https://api.github.com/repos/crate/crate/events","assignees_url":"https://api.github.com/repos/crate/crate/assignees{/user}","branches_url":"https://api.github.com/repos/crate/crate/branches{/branch}","tags_url":"https://api.github.com/repos/crate/crate/tags","blobs_url":"https://api.github.com/repos/crate/crate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/crate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/crate/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/crate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/crate/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/crate/languages","stargazers_url":"https://api.github.com/repos/crate/crate/stargazers","contributors_url":"https://api.github.com/repos/crate/crate/contributors","subscribers_url":"https://api.github.com/repos/crate/crate/subscribers","subscription_url":"https://api.github.com/repos/crate/crate/subscription","commits_url":"https://api.github.com/repos/crate/crate/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/crate/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/crate/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/crate/issues/comments{/number}","contents_url":"https://api.github.com/repos/crate/crate/contents/{+path}","compare_url":"https://api.github.com/repos/crate/crate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/crate/merges","archive_url":"https://api.github.com/repos/crate/crate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/crate/downloads","issues_url":"https://api.github.com/repos/crate/crate/issues{/number}","pulls_url":"https://api.github.com/repos/crate/crate/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/crate/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/crate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/crate/labels{/name}","releases_url":"https://api.github.com/repos/crate/crate/releases{/id}","deployments_url":"https://api.github.com/repos/crate/crate/deployments","created_at":"2013-04-10T09:17:16Z","updated_at":"2017-11-15T07:32:47Z","pushed_at":"2017-11-15T10:34:26Z","git_url":"git://github.com/crate/crate.git","ssh_url":"git@github.com:crate/crate.git","clone_url":"https://github.com/crate/crate.git","svn_url":"https://github.com/crate/crate","homepage":"https://crate.io","size":81598,"stargazers_count":1834,"watchers_count":1834,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":236,"mirror_url":null,"archived":false,"open_issues_count":79,"forks":236,"open_issues":79,"watchers":1834,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crate/crate/pulls/6519"},"html":{"href":"https://github.com/crate/crate/pull/6519"},"issue":{"href":"https://api.github.com/repos/crate/crate/issues/6519"},"comments":{"href":"https://api.github.com/repos/crate/crate/issues/6519/comments"},"review_comments":{"href":"https://api.github.com/repos/crate/crate/pulls/6519/comments"},"review_comment":{"href":"https://api.github.com/repos/crate/crate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crate/crate/pulls/6519/commits"},"statuses":{"href":"https://api.github.com/repos/crate/crate/statuses/f4a8e4ae40cc89449fbfe9864db094d833bfd85f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"seut"}}