{"action":"created","comment":{"url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/comments/24759717","id":24759717,"diff_hunk":"@@ -151,44 +142,16 @@ security.shiro.cas.singleSignOut.disabled = true\n         ShiroCasConfigUtils.shiroCasFilter == \"/shiro-cas=casFilter\\n\"\n     }\n \n-    void \"enabling isServerNameDynamic handles multiple server names\"(){\n+    void \"configurations without a baseServiceUrl use dynamic URLs from the application context\"(){\n         setup:\n-        def firstUrl = \"http://test.server.com\"\n-        def secondUrl = \"http://anothertest.server.com\"\n-\n-        GroovyMock(SecurityUtils, global: true)\n-        GroovyMock(WebUtils, global: true)\n-        def httpServletRequest = Mock(HttpServletRequest)\n-        WebUtils.getHttpRequest(_) >> httpServletRequest\n-\n+        mockLinkGenerator.getServerBaseURL() >> \"https://dynamic.test.server/ctx/\"\n \n         when: \"initialized with a dynamicServerName configuration\"\n-        init(\"\"\"\n-security.shiro.cas.serverUrl = \"https://localhost/cas\"\n-security.shiro.cas.serviceUrl = \"http://localhost:8080/app/shiro-cas\"\n-security.shiro.cas.servicePath = \"/test/shiro-cas\"\n-security.shiro.cas.failurePath = \"/test/\"\n-        \"\"\")\n-\n-        def firstServiceUrl = ShiroCasConfigUtils.serviceUrl\n-        def firstFailureUrl = ShiroCasConfigUtils.failureUrl\n-        def secondServiceUrl = ShiroCasConfigUtils.serviceUrl\n-        def secondFailureUrl = ShiroCasConfigUtils.failureUrl\n+        ShiroCasConfigUtils.initialize(ConfigurationFixtures.configurationWithDynamicServerName)\n \n         then: \"URLs overridden using first domain\"\n-        2 * httpServletRequest.getRequestURL() >> new StringBuffer(firstUrl)\n-        firstServiceUrl == firstUrl + \"/test/shiro-cas\"\n-        firstFailureUrl == firstUrl + \"/test/\"\n-\n-        then: \"URLs overridden using second domain\"\n-        2 * httpServletRequest.getRequestURL() >> new StringBuffer(secondUrl)\n-        secondServiceUrl == secondUrl + \"/test/shiro-cas\"\n-        secondFailureUrl == secondUrl + \"/test/\"","path":"test/unit/org/apache/shiro/cas/grails/ShiroCasConfigUtilsSpec.groovy","position":238,"original_position":239,"commit_id":"bc977504b33ab71696c93d8fea257608a3f658a1","original_commit_id":"94f46295c62a92eff733384cf7219fd871925b94","user":{"login":"davidmc24","id":447825,"avatar_url":"https://avatars.githubusercontent.com/u/447825?v=3","gravatar_id":"","url":"https://api.github.com/users/davidmc24","html_url":"https://github.com/davidmc24","followers_url":"https://api.github.com/users/davidmc24/followers","following_url":"https://api.github.com/users/davidmc24/following{/other_user}","gists_url":"https://api.github.com/users/davidmc24/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmc24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmc24/subscriptions","organizations_url":"https://api.github.com/users/davidmc24/orgs","repos_url":"https://api.github.com/users/davidmc24/repos","events_url":"https://api.github.com/users/davidmc24/events{/privacy}","received_events_url":"https://api.github.com/users/davidmc24/received_events","type":"User","site_admin":false},"body":"While it may be somewhat testing the logic of the underlying framework, it's also asserting an important aspect of how this plugin is using the framework.  If we changed our implementation to no longer use the link builder and instead do something else, we'd still want the same behavior.","created_at":"2015-02-16T16:13:07Z","updated_at":"2015-02-16T16:13:07Z","html_url":"https://github.com/commercehub-oss/grails-shiro-cas/pull/9#discussion_r24759717","pull_request_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/comments/24759717"},"html":{"href":"https://github.com/commercehub-oss/grails-shiro-cas/pull/9#discussion_r24759717"},"pull_request":{"href":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/9","id":29053416,"html_url":"https://github.com/commercehub-oss/grails-shiro-cas/pull/9","diff_url":"https://github.com/commercehub-oss/grails-shiro-cas/pull/9.diff","patch_url":"https://github.com/commercehub-oss/grails-shiro-cas/pull/9.patch","issue_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/issues/9","number":9,"state":"open","locked":false,"title":"Unifying configuration for single/multi domain, Spock test cleanup","user":{"login":"chapmajs","id":1416862,"avatar_url":"https://avatars.githubusercontent.com/u/1416862?v=3","gravatar_id":"","url":"https://api.github.com/users/chapmajs","html_url":"https://github.com/chapmajs","followers_url":"https://api.github.com/users/chapmajs/followers","following_url":"https://api.github.com/users/chapmajs/following{/other_user}","gists_url":"https://api.github.com/users/chapmajs/gists{/gist_id}","starred_url":"https://api.github.com/users/chapmajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapmajs/subscriptions","organizations_url":"https://api.github.com/users/chapmajs/orgs","repos_url":"https://api.github.com/users/chapmajs/repos","events_url":"https://api.github.com/users/chapmajs/events{/privacy}","received_events_url":"https://api.github.com/users/chapmajs/received_events","type":"User","site_admin":false},"body":"This PR unifies the way in which this plugin is configured for single-domain and multi-domain scenarios. Instead of using one URL in one case, or a base URL + path in the other, the plugin is always configured with a base URL and path, and will optionally try to determine the path dynamically if multi-domain support is turned on.\r\n\r\nA single-domain configuration would look like this:\r\n\r\n```groovy\r\nsecurity.shiro.cas.serverUrl='https://sso.example.com/cas'\r\nsecurity.shiro.cas.baseServiceUrl='https://apps.example.com/my-app/'\r\nsecurity.shiro.cas.servicePath='/shiro-cas'\r\n```\r\n\r\nSwitching to a multi-domain scenario only requires the addition of one more config line:\r\n\r\n```groovy\r\nsecurity.shiro.cas.serverUrl='https://sso.example.com/cas'\r\nsecurity.shiro.cas.baseServiceUrl='https://apps.example.com/my-app/'\r\nsecurity.shiro.cas.servicePath='/shiro-cas'\r\nsecurity.shiro.cas.multiDomain=true\r\n```\r\n\r\nThis makes the code easier to follow, reduces code repetition, and will make a set of modifications I'm working on much simpler.\r\n\r\nI also cleaned up the tests, extracting sample configurations to a fixture class, and making the example URLs consistent.","created_at":"2015-02-10T22:56:19Z","updated_at":"2015-02-16T16:13:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9df301c0e6a54b08b4dba57afafbc3105ade646","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/9/commits","review_comments_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/9/comments","review_comment_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/comments/{number}","comments_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/issues/9/comments","statuses_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/statuses/bc977504b33ab71696c93d8fea257608a3f658a1","head":{"label":"chapmajs:simplify_multi_domain","ref":"simplify_multi_domain","sha":"bc977504b33ab71696c93d8fea257608a3f658a1","user":{"login":"chapmajs","id":1416862,"avatar_url":"https://avatars.githubusercontent.com/u/1416862?v=3","gravatar_id":"","url":"https://api.github.com/users/chapmajs","html_url":"https://github.com/chapmajs","followers_url":"https://api.github.com/users/chapmajs/followers","following_url":"https://api.github.com/users/chapmajs/following{/other_user}","gists_url":"https://api.github.com/users/chapmajs/gists{/gist_id}","starred_url":"https://api.github.com/users/chapmajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapmajs/subscriptions","organizations_url":"https://api.github.com/users/chapmajs/orgs","repos_url":"https://api.github.com/users/chapmajs/repos","events_url":"https://api.github.com/users/chapmajs/events{/privacy}","received_events_url":"https://api.github.com/users/chapmajs/received_events","type":"User","site_admin":false},"repo":{"id":30609298,"name":"grails-shiro-cas","full_name":"chapmajs/grails-shiro-cas","owner":{"login":"chapmajs","id":1416862,"avatar_url":"https://avatars.githubusercontent.com/u/1416862?v=3","gravatar_id":"","url":"https://api.github.com/users/chapmajs","html_url":"https://github.com/chapmajs","followers_url":"https://api.github.com/users/chapmajs/followers","following_url":"https://api.github.com/users/chapmajs/following{/other_user}","gists_url":"https://api.github.com/users/chapmajs/gists{/gist_id}","starred_url":"https://api.github.com/users/chapmajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapmajs/subscriptions","organizations_url":"https://api.github.com/users/chapmajs/orgs","repos_url":"https://api.github.com/users/chapmajs/repos","events_url":"https://api.github.com/users/chapmajs/events{/privacy}","received_events_url":"https://api.github.com/users/chapmajs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chapmajs/grails-shiro-cas","description":"Enables Grails applications to use JASIG CAS for single sign-on with Apache Shiro.","fork":true,"url":"https://api.github.com/repos/chapmajs/grails-shiro-cas","forks_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/forks","keys_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/teams","hooks_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/hooks","issue_events_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/issues/events{/number}","events_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/events","assignees_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/assignees{/user}","branches_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/branches{/branch}","tags_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/tags","blobs_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/git/refs{/sha}","trees_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/statuses/{sha}","languages_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/languages","stargazers_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/stargazers","contributors_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/contributors","subscribers_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/subscribers","subscription_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/subscription","commits_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/commits{/sha}","git_commits_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/git/commits{/sha}","comments_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/comments{/number}","issue_comment_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/issues/comments/{number}","contents_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/contents/{+path}","compare_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/merges","archive_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/downloads","issues_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/issues{/number}","pulls_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/pulls{/number}","milestones_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/milestones{/number}","notifications_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/labels{/name}","releases_url":"https://api.github.com/repos/chapmajs/grails-shiro-cas/releases{/id}","created_at":"2015-02-10T19:10:00Z","updated_at":"2015-02-10T19:10:01Z","pushed_at":"2015-02-16T15:57:13Z","git_url":"git://github.com/chapmajs/grails-shiro-cas.git","ssh_url":"git@github.com:chapmajs/grails-shiro-cas.git","clone_url":"https://github.com/chapmajs/grails-shiro-cas.git","svn_url":"https://github.com/chapmajs/grails-shiro-cas","homepage":null,"size":542,"stargazers_count":0,"watchers_count":0,"language":"Groovy","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":"commercehub-oss:master","ref":"master","sha":"cac9938157c702b63a71d9ecdd9926b32971c0cd","user":{"login":"commercehub-oss","id":3227514,"avatar_url":"https://avatars.githubusercontent.com/u/3227514?v=3","gravatar_id":"","url":"https://api.github.com/users/commercehub-oss","html_url":"https://github.com/commercehub-oss","followers_url":"https://api.github.com/users/commercehub-oss/followers","following_url":"https://api.github.com/users/commercehub-oss/following{/other_user}","gists_url":"https://api.github.com/users/commercehub-oss/gists{/gist_id}","starred_url":"https://api.github.com/users/commercehub-oss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercehub-oss/subscriptions","organizations_url":"https://api.github.com/users/commercehub-oss/orgs","repos_url":"https://api.github.com/users/commercehub-oss/repos","events_url":"https://api.github.com/users/commercehub-oss/events{/privacy}","received_events_url":"https://api.github.com/users/commercehub-oss/received_events","type":"Organization","site_admin":false},"repo":{"id":17450054,"name":"grails-shiro-cas","full_name":"commercehub-oss/grails-shiro-cas","owner":{"login":"commercehub-oss","id":3227514,"avatar_url":"https://avatars.githubusercontent.com/u/3227514?v=3","gravatar_id":"","url":"https://api.github.com/users/commercehub-oss","html_url":"https://github.com/commercehub-oss","followers_url":"https://api.github.com/users/commercehub-oss/followers","following_url":"https://api.github.com/users/commercehub-oss/following{/other_user}","gists_url":"https://api.github.com/users/commercehub-oss/gists{/gist_id}","starred_url":"https://api.github.com/users/commercehub-oss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercehub-oss/subscriptions","organizations_url":"https://api.github.com/users/commercehub-oss/orgs","repos_url":"https://api.github.com/users/commercehub-oss/repos","events_url":"https://api.github.com/users/commercehub-oss/events{/privacy}","received_events_url":"https://api.github.com/users/commercehub-oss/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/commercehub-oss/grails-shiro-cas","description":"Enables Grails applications to use JASIG CAS for single sign-on with Apache Shiro.","fork":false,"url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas","forks_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/forks","keys_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/teams","hooks_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/hooks","issue_events_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/issues/events{/number}","events_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/events","assignees_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/assignees{/user}","branches_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/branches{/branch}","tags_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/tags","blobs_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/statuses/{sha}","languages_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/languages","stargazers_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/stargazers","contributors_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/contributors","subscribers_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/subscribers","subscription_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/subscription","commits_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/issues/comments/{number}","contents_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/contents/{+path}","compare_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/merges","archive_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/downloads","issues_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/issues{/number}","pulls_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls{/number}","milestones_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/milestones{/number}","notifications_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/labels{/name}","releases_url":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/releases{/id}","created_at":"2014-03-05T18:13:26Z","updated_at":"2015-01-27T16:37:10Z","pushed_at":"2015-01-27T16:37:10Z","git_url":"git://github.com/commercehub-oss/grails-shiro-cas.git","ssh_url":"git@github.com:commercehub-oss/grails-shiro-cas.git","clone_url":"https://github.com/commercehub-oss/grails-shiro-cas.git","svn_url":"https://github.com/commercehub-oss/grails-shiro-cas","homepage":null,"size":719,"stargazers_count":3,"watchers_count":3,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/9"},"html":{"href":"https://github.com/commercehub-oss/grails-shiro-cas/pull/9"},"issue":{"href":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/issues/9"},"comments":{"href":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/commercehub-oss/grails-shiro-cas/statuses/bc977504b33ab71696c93d8fea257608a3f658a1"}}}}