Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c43c2d
commit 1af7267
Showing
14 changed files
with
817 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
|
||
security { | ||
mock { | ||
// Disabled by default | ||
active = false | ||
|
||
fullName = 'Fake User Account' | ||
email = 'fake@example.org' | ||
username = 'fake user' | ||
username = 'fakeuser' | ||
roles = [ 'ROLE_USER', 'ROLE_ADMIN' ] | ||
} | ||
} | ||
|
||
// Suggested defaults | ||
// grails.springsecurity.ipRestrictions = [ '/**': ['127.0.0.0/8', '::1/128'] ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The Mock plugin adds support for adding "mock" authentication to a Grails applications that uses Spring Security. It depends on the Spring Security Core plugin. | ||
|
||
This is helpful when the spring security implementation is tied to localized infrastructure such as LDAP, CAS, Shibboleth, or something of the like. | ||
|
||
The username and roles mocked up by the plugin are configurable within your Config.groovy file. | ||
|
||
It is suggested that you restrict spring security to only allow access from localhost when using this plugin to prevent unwanted access to your application when authentication is being bypassed. | ||
|
||
It is recommended that you wrap the configuration settings for this pluggin to only load when in development, or possibly test mode. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* Version 0.9.0 | ||
** Released January 9, 2012 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{note} | ||
This plugin exposes a rather large security hole in your application. It is HIGHLY recommended that you restrict access to your application to localhost when you are using this plugin, and that you only use this plugin in development mode. This can be done with the [ipRestrictions|http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/18%20IP%20Address%20Restrictions.html] configuration parameter. | ||
{note} | ||
|
||
When this plugin is enabled, it automatically authenticates anyone using the application as a fake user with fake user roles as defined in Config.groovy. | ||
|
||
The recommended configuration settings are what follows: | ||
{code} | ||
development { | ||
... | ||
grails.plugins.springsecurity.mock.active = true | ||
grails.plugins.springsecurity.mock.fullName = "Your name here" | ||
grails.plugins.springsecurity.mock.email = "Your email address here" | ||
grails.plugins.springsecurity.mock.username = "your.username" | ||
grails.plugins.springsecurity.mock.roles = [ 'ROLE_USER', 'ROLE_ADMIN', 'ROLE_WHATEVERELSE' ] | ||
grails.plugins.springsecurity.ipRestrictions = [ '/**': ['127.0.0.0/8', '::1/128'] ] | ||
... | ||
} | ||
{code} | ||
|
||
where "Your name here" is the name of the user, "Your email address here" is the email address of the user, "your.username" is the username of the user, and "roles" is a list of roles you wish to be assigned to the user that will be automatically logged into your grails application. | ||
|
||
h4. Remember | ||
This is a dangerous plugin. You should only enable this plugin for development use. The example above shows the configuration as being wrapped inside of the "development" closure in the Groovy.config file. | ||
|
||
In your staging and production environments, make sure to set | ||
{code} | ||
grails.plugins.springsecurity.mock.active = false | ||
{code} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
There are a few configuration options for the "Mock" plugin. | ||
|
||
{note} | ||
This plugin exposes a rather large security hole in your application. It is HIGHLY recommended that you restrict access to your application to localhost when you are using this plugin, and that you only use this plugin in development mode. This can be done with the [ipRestrictions|http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/18%20IP%20Address%20Restrictions.html] configuration parameter. | ||
{note} | ||
|
||
{note} | ||
All of these property overrides must be specified in @grails-app/conf/Config.groovy@ using the @grails.plugins.springsecurity@ suffix, for example | ||
{code} | ||
grails.plugins.springsecurity.mock.username = 'aaronzirbes' | ||
{code} | ||
{note} | ||
|
||
|
||
|
||
{table} | ||
*Name* | *Default* | *Meaning* | ||
mock.active | @false@ | whether the plugin is enabled or not (e.g. to disable per-environment) | ||
mock.fullName | 'Fake User Account' | the full name of the mock user being automatically logged in | ||
mock.email | 'fake@example.org' | the email address of the mock user being automatically logged in | ||
mock.username | 'fakeuser' | the username of the mock user being automatically logged in | ||
mock.roles | [ 'ROLE_USER', 'ROLE_ADMIN' ] | a collection of roles that will be automatically assigned to the mock user being auto-logged in to your application | ||
{table} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters