Backported release 2.3.1 into develop
Branding: fix branding.aaf.rapid linebreaks
Merge pull request #146 from University-of-Auckland/aaf-develop

Branding: fix branding.aaf.rapid linebreaks
Branding: Remove un-used line from rapid description.
Only show RAPID details for SP create if i18n populated.

Hides the entire Rapid marketing blurb box if the i18n message is
empty.
Merge pull request #147 from ausaccessfed/bugfix/#147-hide-rapid-box-branding-empty

SPCreate page RapidConnect box cannot be hidden from branding
Reporting: update Tuakiri scripts for Apache logs

Import minor Tuakiri updates
Reporting: scripts to parse Tuakiri Shib/DS logs

Import scripts for parsing ShibbolethDS logs directly
(as produced by Shibboleth DS with Tuakiri extensions)
Reporting: scripts to parse AAF/SWITCH DS logs

Import scripts for parsing logs from AAF/SWITCH DS.
(Contributed by Tuakiri)
Reporting: ShibbolethDS logs: dry-run, spam filter

New features for the scripting parsing Tuakiri/ShibbolethDS logs:

* accept some flags to control behaviour:
  --dry-run (to test the parsing without writing to the database)
  --verbose, --no-verbose, --debug, --no-debug to control output levels

* spam filtering: allow setting a filter in the config file to weed out
  sessions created by spam bots.
  This is based on a real-life use case: spam-bots targeting MediaWiki sites
  are trying to sign-up for an account and end up traversing through the
  DS, selecting the first IdP in the alphabetical order.

  The sample filter handles this: without any better option to
  filter out the spammers, filter out all sessions for this SP and
  IdP combination that are not originating from the IP range of the
  institution the IdP belongs to.
Merge pull request #149 from University-of-Auckland/develop-log-parsing-scripts

Push in Tuakiri work on log parsing scripts
MigrScripts: delete perms linked to excluded roles

The migration script createSQLDataMigration.groovy excludes some Roles
from migration (in particular, SYSTEM ADMINISTRATORS).

Fix: delete from the Permissions table all entries pointing to the
excluded roles.
Scripts: use wildcardPerm in both setup and upgr.

Modify both versions of createFRBaseEnvironment.groovy (both in setup
and upgrade/major-rleases/2) to use wildcardPermission
(Permission.defaultPerm) instead of adminPerm (which points to
AllPermission).

The notation Permission.defaultPerm is consistent with the rest of the
code base (and is synonymous with Permission.wildcardPerm).
MigrScripts: createFRBaseEnvironment: check-exists

Make scripts/upgrades/major-release/2/createFRBaseEnvironment.groovy
check if the Roles, Permissions and Subjects already exist before
creating them.

That makes this script restartable - and also works around situation
when a role introduced it FR2 (like federation-reporting) had been
manually created in an FR 1.x instance.
Merge pull request #151 from University-of-Auckland/aaf-develop

Migration scripts: fix permissions handling, permission types and check for existing roles
MigrScripts: escape apostrophe in email address

In scripts/upgrades/major-release/2/createSQLDataMigration.groovy,
escape apostrophe in email addresses in generated SQL code (escape as a
double apostrophe).

Also escape in the same way (double apostrophe) apostrophes in subject
full name - previously removed.
Merge pull request #152 from University-of-Auckland/aaf-develop

MigrScripts: escape apostrophe in email address
Scripts: UpdateCAKeyName: handle Email OIDs

Fixes an issue where where one CA was represented with a long string
where the OID representing the email address in a DN
(1.2.840.113549.1.9.1) was not decoded - an even the value was printed
out in hex, resulting into:

1.2.840.113549.1.9.1=#16197072656d69756d2d736572766572407468617774652e636f6d,CN=Thawte
Premium Server CA,OU=Certification Services Division,O=Thawte Consulting
cc,L=Cape Town,ST=Western Cape,C=ZA

Surprisingly, while c.getSubjectDN() nicely decodes the OID and the
value, getSubjectX500Principal().getName() does not.

As the c.getSubjectDN() method is deprecated ("denigrated"), we have to
use getSubjectX500Principal().  A suitable way forward is to use the
getName(String format, Map<String,String> oidMap) method and provide an
oidMap (using the newer format RFC2253 as the format)
Merge pull request #154 from University-of-Auckland/aaf-develop

Scripts: UpdateCAKeyName: handle Email OIDs
Tests: Copy missing resources.groovy among plugins

Copy missing resources.groovy from base plugin into api, administation
and reporting plugins.  Else, tests (grails test-app) fail for these
plugins with ClassNotFoundException: resources