Commit c4c8823f authored by Leigh Stoller's avatar Leigh Stoller

Add some sanity checking during new authority checkin.

parent f46d06f7
......@@ -144,7 +144,14 @@ sub GetCredential($)
"Malformed URN in the certificate")
if (!GeniHRN::IsValid($urn));
my ($auth, $type, $id) = GeniHRN::Parse($urn);
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"Not an authority certificate")
if ($type ne "authority");
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"Not an am/cm/sa/ses certificate")
if (! ($id =~ /^(am|cm|ses|sa)$/i));
#
# Check for an existing authority.
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment