{"action":"created","comment":{"url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/comments/80450763","id":80450763,"diff_hunk":"@@ -1,10 +1,64 @@\n package com.example\n \n import akka.actor.ActorSystem\n-import akka.routing.{ConsistentHashingPool, ConsistentHashingRouter}\n+import akka.event.{Logging, LoggingAdapter}\n+import akka.http.scaladsl.Http\n+import akka.http.scaladsl.model._\n+import akka.http.scaladsl.server.Directives._\n+import akka.stream.{ActorMaterializer, Materializer}\n+import com.example.domain.rbac.{AccessControlService, AccessControlServiceImpl, CheckAccess}\n+import com.typesafe.config.{Config, ConfigFactory}\n+import play.api.libs.json._\n+import play.api.libs.functional.syntax._\n \n-object Server extends App {\n-  implicit val system = ActorSystem(\"rbac\")\n+import scala.concurrent.ExecutionContextExecutor\n+import scala.util.Try\n+\n+trait Endpoint {\n+  implicit val system: ActorSystem\n+\n+  implicit def executor: ExecutionContextExecutor\n+\n+  implicit val materializer: Materializer\n+\n+  def config: Config\n+\n+  val logger: LoggingAdapter\n+  val accessControlService: AccessControlService\n+\n+  implicit val checkAccessReads: Reads[CheckAccess] = (\n+    (JsPath \\ \"name\").read[String] and\n+      (JsPath \\ \"rule\").read[String]\n+    ) (CheckAccess.apply _)\n+\n+  val routes =\n+    post {\n+      pathPrefix(\"access\") {\n+        path(\"check\") {\n+          entity(as[String]) { strCheck => {\n+            Try(Json.parse(strCheck)).toOption.flatMap(_.asOpt[CheckAccess]) match {","path":"src/main/scala/com/example/Server.scala","position":42,"original_position":42,"commit_id":"90a67c35d1bb8af34942c2f5506bb050ab1a4bcd","original_commit_id":"90a67c35d1bb8af34942c2f5506bb050ab1a4bcd","user":{"login":"NikitaMelnikov","id":1418845,"avatar_url":"https://avatars.githubusercontent.com/u/1418845?v=3","gravatar_id":"","url":"https://api.github.com/users/NikitaMelnikov","html_url":"https://github.com/NikitaMelnikov","followers_url":"https://api.github.com/users/NikitaMelnikov/followers","following_url":"https://api.github.com/users/NikitaMelnikov/following{/other_user}","gists_url":"https://api.github.com/users/NikitaMelnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/NikitaMelnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NikitaMelnikov/subscriptions","organizations_url":"https://api.github.com/users/NikitaMelnikov/orgs","repos_url":"https://api.github.com/users/NikitaMelnikov/repos","events_url":"https://api.github.com/users/NikitaMelnikov/events{/privacy}","received_events_url":"https://api.github.com/users/NikitaMelnikov/received_events","type":"User","site_admin":false},"body":"А у `Json` нет метода `validate` или похожего? В play я встречал что-то типа\r\n```scala\r\nJson.validate[Entity](json).fold(\r\n  entity => ...,\r\n  error => ...\r\n)\r\n```","created_at":"2016-09-26T10:52:03Z","updated_at":"2016-09-26T11:00:42Z","html_url":"https://github.com/NikitaMelnikov/rbac-service/pull/9#discussion_r80450763","pull_request_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/comments/80450763"},"html":{"href":"https://github.com/NikitaMelnikov/rbac-service/pull/9#discussion_r80450763"},"pull_request":{"href":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/9","id":86618931,"html_url":"https://github.com/NikitaMelnikov/rbac-service/pull/9","diff_url":"https://github.com/NikitaMelnikov/rbac-service/pull/9.diff","patch_url":"https://github.com/NikitaMelnikov/rbac-service/pull/9.patch","issue_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/issues/9","number":9,"state":"open","locked":false,"title":"RBAC-3 Add http interface for API","user":{"login":"ititov","id":3988829,"avatar_url":"https://avatars.githubusercontent.com/u/3988829?v=3","gravatar_id":"","url":"https://api.github.com/users/ititov","html_url":"https://github.com/ititov","followers_url":"https://api.github.com/users/ititov/followers","following_url":"https://api.github.com/users/ititov/following{/other_user}","gists_url":"https://api.github.com/users/ititov/gists{/gist_id}","starred_url":"https://api.github.com/users/ititov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ititov/subscriptions","organizations_url":"https://api.github.com/users/ititov/orgs","repos_url":"https://api.github.com/users/ititov/repos","events_url":"https://api.github.com/users/ititov/events{/privacy}","received_events_url":"https://api.github.com/users/ititov/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-24T14:02:36Z","updated_at":"2016-09-26T11:00:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1475d1d29f7e4d4b068d37aeb01bb3e09fa98be1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/9/commits","review_comments_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/9/comments","review_comment_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/issues/9/comments","statuses_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/statuses/90a67c35d1bb8af34942c2f5506bb050ab1a4bcd","head":{"label":"ititov:RBAC-3","ref":"RBAC-3","sha":"90a67c35d1bb8af34942c2f5506bb050ab1a4bcd","user":{"login":"ititov","id":3988829,"avatar_url":"https://avatars.githubusercontent.com/u/3988829?v=3","gravatar_id":"","url":"https://api.github.com/users/ititov","html_url":"https://github.com/ititov","followers_url":"https://api.github.com/users/ititov/followers","following_url":"https://api.github.com/users/ititov/following{/other_user}","gists_url":"https://api.github.com/users/ititov/gists{/gist_id}","starred_url":"https://api.github.com/users/ititov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ititov/subscriptions","organizations_url":"https://api.github.com/users/ititov/orgs","repos_url":"https://api.github.com/users/ititov/repos","events_url":"https://api.github.com/users/ititov/events{/privacy}","received_events_url":"https://api.github.com/users/ititov/received_events","type":"User","site_admin":false},"repo":{"id":67110008,"name":"rbac-service","full_name":"ititov/rbac-service","owner":{"login":"ititov","id":3988829,"avatar_url":"https://avatars.githubusercontent.com/u/3988829?v=3","gravatar_id":"","url":"https://api.github.com/users/ititov","html_url":"https://github.com/ititov","followers_url":"https://api.github.com/users/ititov/followers","following_url":"https://api.github.com/users/ititov/following{/other_user}","gists_url":"https://api.github.com/users/ititov/gists{/gist_id}","starred_url":"https://api.github.com/users/ititov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ititov/subscriptions","organizations_url":"https://api.github.com/users/ititov/orgs","repos_url":"https://api.github.com/users/ititov/repos","events_url":"https://api.github.com/users/ititov/events{/privacy}","received_events_url":"https://api.github.com/users/ititov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ititov/rbac-service","description":null,"fork":true,"url":"https://api.github.com/repos/ititov/rbac-service","forks_url":"https://api.github.com/repos/ititov/rbac-service/forks","keys_url":"https://api.github.com/repos/ititov/rbac-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ititov/rbac-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ititov/rbac-service/teams","hooks_url":"https://api.github.com/repos/ititov/rbac-service/hooks","issue_events_url":"https://api.github.com/repos/ititov/rbac-service/issues/events{/number}","events_url":"https://api.github.com/repos/ititov/rbac-service/events","assignees_url":"https://api.github.com/repos/ititov/rbac-service/assignees{/user}","branches_url":"https://api.github.com/repos/ititov/rbac-service/branches{/branch}","tags_url":"https://api.github.com/repos/ititov/rbac-service/tags","blobs_url":"https://api.github.com/repos/ititov/rbac-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ititov/rbac-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ititov/rbac-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/ititov/rbac-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ititov/rbac-service/statuses/{sha}","languages_url":"https://api.github.com/repos/ititov/rbac-service/languages","stargazers_url":"https://api.github.com/repos/ititov/rbac-service/stargazers","contributors_url":"https://api.github.com/repos/ititov/rbac-service/contributors","subscribers_url":"https://api.github.com/repos/ititov/rbac-service/subscribers","subscription_url":"https://api.github.com/repos/ititov/rbac-service/subscription","commits_url":"https://api.github.com/repos/ititov/rbac-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/ititov/rbac-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/ititov/rbac-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/ititov/rbac-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/ititov/rbac-service/contents/{+path}","compare_url":"https://api.github.com/repos/ititov/rbac-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ititov/rbac-service/merges","archive_url":"https://api.github.com/repos/ititov/rbac-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ititov/rbac-service/downloads","issues_url":"https://api.github.com/repos/ititov/rbac-service/issues{/number}","pulls_url":"https://api.github.com/repos/ititov/rbac-service/pulls{/number}","milestones_url":"https://api.github.com/repos/ititov/rbac-service/milestones{/number}","notifications_url":"https://api.github.com/repos/ititov/rbac-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ititov/rbac-service/labels{/name}","releases_url":"https://api.github.com/repos/ititov/rbac-service/releases{/id}","deployments_url":"https://api.github.com/repos/ititov/rbac-service/deployments","created_at":"2016-09-01T07:48:21Z","updated_at":"2016-09-01T07:48:22Z","pushed_at":"2016-09-24T14:21:13Z","git_url":"git://github.com/ititov/rbac-service.git","ssh_url":"git@github.com:ititov/rbac-service.git","clone_url":"https://github.com/ititov/rbac-service.git","svn_url":"https://github.com/ititov/rbac-service","homepage":null,"size":19,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"NikitaMelnikov:master","ref":"master","sha":"fd272257876c97ed90c0bfd7c281f7a15bd5974a","user":{"login":"NikitaMelnikov","id":1418845,"avatar_url":"https://avatars.githubusercontent.com/u/1418845?v=3","gravatar_id":"","url":"https://api.github.com/users/NikitaMelnikov","html_url":"https://github.com/NikitaMelnikov","followers_url":"https://api.github.com/users/NikitaMelnikov/followers","following_url":"https://api.github.com/users/NikitaMelnikov/following{/other_user}","gists_url":"https://api.github.com/users/NikitaMelnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/NikitaMelnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NikitaMelnikov/subscriptions","organizations_url":"https://api.github.com/users/NikitaMelnikov/orgs","repos_url":"https://api.github.com/users/NikitaMelnikov/repos","events_url":"https://api.github.com/users/NikitaMelnikov/events{/privacy}","received_events_url":"https://api.github.com/users/NikitaMelnikov/received_events","type":"User","site_admin":false},"repo":{"id":66979396,"name":"rbac-service","full_name":"NikitaMelnikov/rbac-service","owner":{"login":"NikitaMelnikov","id":1418845,"avatar_url":"https://avatars.githubusercontent.com/u/1418845?v=3","gravatar_id":"","url":"https://api.github.com/users/NikitaMelnikov","html_url":"https://github.com/NikitaMelnikov","followers_url":"https://api.github.com/users/NikitaMelnikov/followers","following_url":"https://api.github.com/users/NikitaMelnikov/following{/other_user}","gists_url":"https://api.github.com/users/NikitaMelnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/NikitaMelnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NikitaMelnikov/subscriptions","organizations_url":"https://api.github.com/users/NikitaMelnikov/orgs","repos_url":"https://api.github.com/users/NikitaMelnikov/repos","events_url":"https://api.github.com/users/NikitaMelnikov/events{/privacy}","received_events_url":"https://api.github.com/users/NikitaMelnikov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NikitaMelnikov/rbac-service","description":null,"fork":false,"url":"https://api.github.com/repos/NikitaMelnikov/rbac-service","forks_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/forks","keys_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/teams","hooks_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/hooks","issue_events_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/issues/events{/number}","events_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/events","assignees_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/assignees{/user}","branches_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/branches{/branch}","tags_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/tags","blobs_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/statuses/{sha}","languages_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/languages","stargazers_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/stargazers","contributors_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/contributors","subscribers_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/subscribers","subscription_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/subscription","commits_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/contents/{+path}","compare_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/merges","archive_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/downloads","issues_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/issues{/number}","pulls_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls{/number}","milestones_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/milestones{/number}","notifications_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/labels{/name}","releases_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/releases{/id}","deployments_url":"https://api.github.com/repos/NikitaMelnikov/rbac-service/deployments","created_at":"2016-08-30T21:32:19Z","updated_at":"2016-08-30T21:32:42Z","pushed_at":"2016-09-24T14:21:13Z","git_url":"git://github.com/NikitaMelnikov/rbac-service.git","ssh_url":"git@github.com:NikitaMelnikov/rbac-service.git","clone_url":"https://github.com/NikitaMelnikov/rbac-service.git","svn_url":"https://github.com/NikitaMelnikov/rbac-service","homepage":null,"size":24,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/9"},"html":{"href":"https://github.com/NikitaMelnikov/rbac-service/pull/9"},"issue":{"href":"https://api.github.com/repos/NikitaMelnikov/rbac-service/issues/9"},"comments":{"href":"https://api.github.com/repos/NikitaMelnikov/rbac-service/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NikitaMelnikov/rbac-service/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/NikitaMelnikov/rbac-service/statuses/90a67c35d1bb8af34942c2f5506bb050ab1a4bcd"}}}}
{"actor":{"display_login":"NikitaMelnikov"}}