{"action":"created","comment":{"url":"https://api.github.com/repos/pac4j/pac4j/pulls/comments/93406462","pull_request_review_id":13931778,"id":93406462,"diff_hunk":"@@ -0,0 +1,61 @@\n+package org.pac4j.core.matching;\n+\n+import org.pac4j.core.context.WebContext;\n+import org.pac4j.core.exception.HttpAction;\n+\n+import java.util.HashSet;\n+import java.util.Set;\n+import java.util.regex.Pattern;\n+\n+/**\n+ * Matches all request paths except whitelisted (excluded) paths.\n+ *\n+ * @Author Rob Ward\n+ * @since 2.0.0\n+ */\n+public class PathMatcher implements Matcher {\n+    private final Set<String> excludedPaths = new HashSet<>();\n+    private final Set<Pattern> excludedPatterns = new HashSet<>();\n+\n+    /**\n+     * Any path exactly matching this string will be excluded. Use this method if you are excluding a specific path.\n+     */\n+    public void addExcludedPath(final String path) {\n+        excludedPaths.add(path);\n+    }\n+\n+    /**\n+     * Convenience method for excluding all paths starting with a prefix e.g. \"/foo\" would exclude \"/foo\", \"/foo/bar\", etc.\n+     */\n+    public void addExcludedBranch(final String root) {\n+        addExcludedRegex(\"^\" + root + \"(/.*)?$\");\n+    }\n+\n+    /**\n+     * Any path matching this regex will be excluded.\n+     */\n+    public void addExcludedRegex(final String regex) {\n+        excludedPatterns.add(Pattern.compile(regex));","path":"pac4j-core/src/main/java/org/pac4j/core/matching/PathMatcher.java","position":38,"original_position":38,"commit_id":"7a07515d4ac6e12774ed4697881755ddbfcd0a2f","original_commit_id":"7a07515d4ac6e12774ed4697881755ddbfcd0a2f","user":{"login":"leleuj","id":1038508,"avatar_url":"https://avatars.githubusercontent.com/u/1038508?v=3","gravatar_id":"","url":"https://api.github.com/users/leleuj","html_url":"https://github.com/leleuj","followers_url":"https://api.github.com/users/leleuj/followers","following_url":"https://api.github.com/users/leleuj/following{/other_user}","gists_url":"https://api.github.com/users/leleuj/gists{/gist_id}","starred_url":"https://api.github.com/users/leleuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leleuj/subscriptions","organizations_url":"https://api.github.com/users/leleuj/orgs","repos_url":"https://api.github.com/users/leleuj/repos","events_url":"https://api.github.com/users/leleuj/events{/privacy}","received_events_url":"https://api.github.com/users/leleuj/received_events","type":"User","site_admin":false},"body":"And there.","created_at":"2016-12-21T09:52:01Z","updated_at":"2016-12-21T09:52:01Z","html_url":"https://github.com/pac4j/pac4j/pull/778#discussion_r93406462","pull_request_url":"https://api.github.com/repos/pac4j/pac4j/pulls/778","_links":{"self":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/comments/93406462"},"html":{"href":"https://github.com/pac4j/pac4j/pull/778#discussion_r93406462"},"pull_request":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/778"}}},"pull_request":{"url":"https://api.github.com/repos/pac4j/pac4j/pulls/778","id":98601693,"html_url":"https://github.com/pac4j/pac4j/pull/778","diff_url":"https://github.com/pac4j/pac4j/pull/778.diff","patch_url":"https://github.com/pac4j/pac4j/pull/778.patch","issue_url":"https://api.github.com/repos/pac4j/pac4j/issues/778","number":778,"state":"open","locked":false,"title":"added PathMatcher","user":{"login":"wardr","id":9736842,"avatar_url":"https://avatars.githubusercontent.com/u/9736842?v=3","gravatar_id":"","url":"https://api.github.com/users/wardr","html_url":"https://github.com/wardr","followers_url":"https://api.github.com/users/wardr/followers","following_url":"https://api.github.com/users/wardr/following{/other_user}","gists_url":"https://api.github.com/users/wardr/gists{/gist_id}","starred_url":"https://api.github.com/users/wardr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wardr/subscriptions","organizations_url":"https://api.github.com/users/wardr/orgs","repos_url":"https://api.github.com/users/wardr/repos","events_url":"https://api.github.com/users/wardr/events{/privacy}","received_events_url":"https://api.github.com/users/wardr/received_events","type":"User","site_admin":false},"body":"Proposed replacement for ExludedPathMatcher.","created_at":"2016-12-19T16:59:24Z","updated_at":"2016-12-21T09:52:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5fafb02fbc30df4670a17de4909023310366bc3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pac4j/pac4j/pulls/778/commits","review_comments_url":"https://api.github.com/repos/pac4j/pac4j/pulls/778/comments","review_comment_url":"https://api.github.com/repos/pac4j/pac4j/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pac4j/pac4j/issues/778/comments","statuses_url":"https://api.github.com/repos/pac4j/pac4j/statuses/7a07515d4ac6e12774ed4697881755ddbfcd0a2f","head":{"label":"wardr:path-matcher","ref":"path-matcher","sha":"7a07515d4ac6e12774ed4697881755ddbfcd0a2f","user":{"login":"wardr","id":9736842,"avatar_url":"https://avatars.githubusercontent.com/u/9736842?v=3","gravatar_id":"","url":"https://api.github.com/users/wardr","html_url":"https://github.com/wardr","followers_url":"https://api.github.com/users/wardr/followers","following_url":"https://api.github.com/users/wardr/following{/other_user}","gists_url":"https://api.github.com/users/wardr/gists{/gist_id}","starred_url":"https://api.github.com/users/wardr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wardr/subscriptions","organizations_url":"https://api.github.com/users/wardr/orgs","repos_url":"https://api.github.com/users/wardr/repos","events_url":"https://api.github.com/users/wardr/events{/privacy}","received_events_url":"https://api.github.com/users/wardr/received_events","type":"User","site_admin":false},"repo":{"id":76877391,"name":"pac4j","full_name":"wardr/pac4j","owner":{"login":"wardr","id":9736842,"avatar_url":"https://avatars.githubusercontent.com/u/9736842?v=3","gravatar_id":"","url":"https://api.github.com/users/wardr","html_url":"https://github.com/wardr","followers_url":"https://api.github.com/users/wardr/followers","following_url":"https://api.github.com/users/wardr/following{/other_user}","gists_url":"https://api.github.com/users/wardr/gists{/gist_id}","starred_url":"https://api.github.com/users/wardr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wardr/subscriptions","organizations_url":"https://api.github.com/users/wardr/orgs","repos_url":"https://api.github.com/users/wardr/repos","events_url":"https://api.github.com/users/wardr/events{/privacy}","received_events_url":"https://api.github.com/users/wardr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wardr/pac4j","description":"Security engine for Java (authentication, authorization, multi frameworks): OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...","fork":true,"url":"https://api.github.com/repos/wardr/pac4j","forks_url":"https://api.github.com/repos/wardr/pac4j/forks","keys_url":"https://api.github.com/repos/wardr/pac4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wardr/pac4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wardr/pac4j/teams","hooks_url":"https://api.github.com/repos/wardr/pac4j/hooks","issue_events_url":"https://api.github.com/repos/wardr/pac4j/issues/events{/number}","events_url":"https://api.github.com/repos/wardr/pac4j/events","assignees_url":"https://api.github.com/repos/wardr/pac4j/assignees{/user}","branches_url":"https://api.github.com/repos/wardr/pac4j/branches{/branch}","tags_url":"https://api.github.com/repos/wardr/pac4j/tags","blobs_url":"https://api.github.com/repos/wardr/pac4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wardr/pac4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wardr/pac4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/wardr/pac4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wardr/pac4j/statuses/{sha}","languages_url":"https://api.github.com/repos/wardr/pac4j/languages","stargazers_url":"https://api.github.com/repos/wardr/pac4j/stargazers","contributors_url":"https://api.github.com/repos/wardr/pac4j/contributors","subscribers_url":"https://api.github.com/repos/wardr/pac4j/subscribers","subscription_url":"https://api.github.com/repos/wardr/pac4j/subscription","commits_url":"https://api.github.com/repos/wardr/pac4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/wardr/pac4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/wardr/pac4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/wardr/pac4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/wardr/pac4j/contents/{+path}","compare_url":"https://api.github.com/repos/wardr/pac4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wardr/pac4j/merges","archive_url":"https://api.github.com/repos/wardr/pac4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wardr/pac4j/downloads","issues_url":"https://api.github.com/repos/wardr/pac4j/issues{/number}","pulls_url":"https://api.github.com/repos/wardr/pac4j/pulls{/number}","milestones_url":"https://api.github.com/repos/wardr/pac4j/milestones{/number}","notifications_url":"https://api.github.com/repos/wardr/pac4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wardr/pac4j/labels{/name}","releases_url":"https://api.github.com/repos/wardr/pac4j/releases{/id}","deployments_url":"https://api.github.com/repos/wardr/pac4j/deployments","created_at":"2016-12-19T16:17:48Z","updated_at":"2016-12-19T16:17:52Z","pushed_at":"2016-12-19T16:50:06Z","git_url":"git://github.com/wardr/pac4j.git","ssh_url":"git@github.com:wardr/pac4j.git","clone_url":"https://github.com/wardr/pac4j.git","svn_url":"https://github.com/wardr/pac4j","homepage":"http://www.pac4j.org","size":30739,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"pac4j:master","ref":"master","sha":"0a7930e75d6a5e1d914739a80d9dbc39d492aaec","user":{"login":"pac4j","id":7540865,"avatar_url":"https://avatars.githubusercontent.com/u/7540865?v=3","gravatar_id":"","url":"https://api.github.com/users/pac4j","html_url":"https://github.com/pac4j","followers_url":"https://api.github.com/users/pac4j/followers","following_url":"https://api.github.com/users/pac4j/following{/other_user}","gists_url":"https://api.github.com/users/pac4j/gists{/gist_id}","starred_url":"https://api.github.com/users/pac4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pac4j/subscriptions","organizations_url":"https://api.github.com/users/pac4j/orgs","repos_url":"https://api.github.com/users/pac4j/repos","events_url":"https://api.github.com/users/pac4j/events{/privacy}","received_events_url":"https://api.github.com/users/pac4j/received_events","type":"Organization","site_admin":false},"repo":{"id":3291848,"name":"pac4j","full_name":"pac4j/pac4j","owner":{"login":"pac4j","id":7540865,"avatar_url":"https://avatars.githubusercontent.com/u/7540865?v=3","gravatar_id":"","url":"https://api.github.com/users/pac4j","html_url":"https://github.com/pac4j","followers_url":"https://api.github.com/users/pac4j/followers","following_url":"https://api.github.com/users/pac4j/following{/other_user}","gists_url":"https://api.github.com/users/pac4j/gists{/gist_id}","starred_url":"https://api.github.com/users/pac4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pac4j/subscriptions","organizations_url":"https://api.github.com/users/pac4j/orgs","repos_url":"https://api.github.com/users/pac4j/repos","events_url":"https://api.github.com/users/pac4j/events{/privacy}","received_events_url":"https://api.github.com/users/pac4j/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pac4j/pac4j","description":"Security engine for Java (authentication, authorization, multi frameworks): OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...","fork":false,"url":"https://api.github.com/repos/pac4j/pac4j","forks_url":"https://api.github.com/repos/pac4j/pac4j/forks","keys_url":"https://api.github.com/repos/pac4j/pac4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pac4j/pac4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pac4j/pac4j/teams","hooks_url":"https://api.github.com/repos/pac4j/pac4j/hooks","issue_events_url":"https://api.github.com/repos/pac4j/pac4j/issues/events{/number}","events_url":"https://api.github.com/repos/pac4j/pac4j/events","assignees_url":"https://api.github.com/repos/pac4j/pac4j/assignees{/user}","branches_url":"https://api.github.com/repos/pac4j/pac4j/branches{/branch}","tags_url":"https://api.github.com/repos/pac4j/pac4j/tags","blobs_url":"https://api.github.com/repos/pac4j/pac4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pac4j/pac4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pac4j/pac4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/pac4j/pac4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pac4j/pac4j/statuses/{sha}","languages_url":"https://api.github.com/repos/pac4j/pac4j/languages","stargazers_url":"https://api.github.com/repos/pac4j/pac4j/stargazers","contributors_url":"https://api.github.com/repos/pac4j/pac4j/contributors","subscribers_url":"https://api.github.com/repos/pac4j/pac4j/subscribers","subscription_url":"https://api.github.com/repos/pac4j/pac4j/subscription","commits_url":"https://api.github.com/repos/pac4j/pac4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/pac4j/pac4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/pac4j/pac4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/pac4j/pac4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/pac4j/pac4j/contents/{+path}","compare_url":"https://api.github.com/repos/pac4j/pac4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pac4j/pac4j/merges","archive_url":"https://api.github.com/repos/pac4j/pac4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pac4j/pac4j/downloads","issues_url":"https://api.github.com/repos/pac4j/pac4j/issues{/number}","pulls_url":"https://api.github.com/repos/pac4j/pac4j/pulls{/number}","milestones_url":"https://api.github.com/repos/pac4j/pac4j/milestones{/number}","notifications_url":"https://api.github.com/repos/pac4j/pac4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pac4j/pac4j/labels{/name}","releases_url":"https://api.github.com/repos/pac4j/pac4j/releases{/id}","deployments_url":"https://api.github.com/repos/pac4j/pac4j/deployments","created_at":"2012-01-28T17:04:12Z","updated_at":"2016-12-21T07:15:55Z","pushed_at":"2016-12-19T20:02:18Z","git_url":"git://github.com/pac4j/pac4j.git","ssh_url":"git@github.com:pac4j/pac4j.git","clone_url":"https://github.com/pac4j/pac4j.git","svn_url":"https://github.com/pac4j/pac4j","homepage":"http://www.pac4j.org","size":30738,"stargazers_count":731,"watchers_count":731,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":257,"mirror_url":null,"open_issues_count":21,"forks":257,"open_issues":21,"watchers":731,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/778"},"html":{"href":"https://github.com/pac4j/pac4j/pull/778"},"issue":{"href":"https://api.github.com/repos/pac4j/pac4j/issues/778"},"comments":{"href":"https://api.github.com/repos/pac4j/pac4j/issues/778/comments"},"review_comments":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/778/comments"},"review_comment":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/778/commits"},"statuses":{"href":"https://api.github.com/repos/pac4j/pac4j/statuses/7a07515d4ac6e12774ed4697881755ddbfcd0a2f"}}}}
{"actor":{"display_login":"leleuj"}}