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)
MigScripts: Update refresh-db.sh to set CA names.

Update refresh-db.sh to invoke UpdateCADatabaseRecords.groovy to set CA
names.
Merge branch 'aaf-develop' into code-develop
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
Tests: Metadata: fix output from similarExcludingID

In metadata tests, fix the output from similarExcludingID.  If this
method call from a "then" clause of a Spock test returns false, the
output from the test (the error reported) includes only the call to this
method - result, method name, arguments.

Calling this method with a simple Diff object means only the the first
difference (which typically is the ID attribute ignored by this method)
is printed and the actual XML difference found is hidden away.

Change the code to instead convert the simple Diff to a DetailedDiff
before calling similarExcludingID - that way, all differences captured
in the DetailedDiff are printed and the test errors are much easier to
track down.
Tests: metadata: fix validUntil timezone to UTC

Some tests in the metadata plugin were using hard-coded timestamps but
these timestamps were interpreted relative to the current timezone - and
in other timezones then Australia/Brisbane caused the tests to fail as
the value would not match the UTC-pinned value in expected output.

Explicitly set the timezone to UTC in the tests and adjust test data
accordingly.
Merge pull request #156 from University-of-Auckland/aaf-develop

Fix several issues with tests:
Messages: fix minor typo in migrateorganization msg

Fix minor typo in templates.fr.entitydescriptor.overview.migrateorganization
message: immediently => immediately
Reporting: fix typo in error message
Reporting: CA Usage: skip disabled certificates

The CA Usage Compliance Report has been producing data that was looking
bogus - turns out it was doing a report over all certificates, including
the ones taht had been "deleted" from the descriptor - which in reality
is only being flagged as disabled.

Fix this by honouring the "disabled" flag and skipping over such
certificates in the causage report.
Base: Fix CryptoService to properly decode DN

This is similar to what was handled in \#154 / commit
8a032c8f8ce90bd749ebe67e8dbb8b04fa15a7a7

Some CAs represent the email address with OID 1.2.840.113549.1.9.1 which
does not get decoded by getSubjectX500Principal().getName() /
getIssuerX500Principal().getName() and is displayed as the OID with the
value being printed out in hex - like:

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

Fix this by instead getName(String format, Map oidMap) method and
provide an oidMap mapping this OID to "E".

Define the oidMap HashMap as a class field for CryptoService and reuse
that from the issuer() and subject() methods.
APIv1: Fix IdP and SP web links in json responses

Minor bug: the IdP and SP APIv1 controllers were generating incorrect
weblink entries in the JSON data for an IdP or SP:

IdP: "weblink":"https://registry.tuakiri.ac.nz/federationregistry/IDPSSODescriptor/show/3"
SP:  "weblink":"https://registry.tuakiri.ac.nz/federationregistry/SPSSODescriptor/show/5"

The links should actually be pointing to:

   identityProvider controller instead of IDPSSODescriptor
and
   serviceProvider controller instead of SPSSODescriptor

Fixed the 'controller' parameters to g:createLink.
Merge pull request #159 from University-of-Auckland/develop-fix-message-typo

Messages: fix minor typo in migrateorganization msg
Merge pull request #161 from University-of-Auckland/develop-fix-causage

Minor fixes mostly around certificates
Merge branch 'aaf-develop' into code-develop
Merge branch 'code-develop' into tuakiri-develop