Validate SP names for admin pages and REST
authorNathan Kinder <nkinder@redhat.com>
Thu, 2 Apr 2015 00:36:22 +0000 (17:36 -0700)
committerRob Crittenden <rcritten@redhat.com>
Thu, 2 Apr 2015 03:18:39 +0000 (23:18 -0400)
commit8ffd2629c6554124e7e3b15dce10275a2efd8261
tree32212efa6f6884ba357955dbcaab93d955744b90
parent9600cff7a3f93529ab56044968b489030f74b76c
Validate SP names for admin pages and REST

We were previously only validating the SP name in the admin pages
for SP creation and update.  The REST API would allow a SP to be
created with an invalid name, which would break the ability to
manage that SP in the admin pages.

This patch moves the SP name validation logic out of the admin
page code and centralizes it in the provider creation code.  This
ensures that validation will occur regardless of the interface
that is used.  In addition, a helper method is added to allow
the admin page to check if a name is valid during update operations.

https://fedorahosted.org/ipsilon/ticket/102

Signed-off-by: Nathan Kinder <nkinder@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
ipsilon/providers/saml2/admin.py
ipsilon/providers/saml2/provider.py
tests/testrest.py