Commit 61c802a7 authored by Mike Hibler's avatar Mike Hibler
Browse files

Merge remote branch 'central/master'

parents 24903113 776f0e8a
...@@ -208,7 +208,8 @@ sub Resolve($) ...@@ -208,7 +208,8 @@ sub Resolve($)
elsif (defined($hrn) && !($hrn =~ /^[-\w\.]*$/)) { elsif (defined($hrn) && !($hrn =~ /^[-\w\.]*$/)) {
return GeniResponse->MalformedArgsResponse(); return GeniResponse->MalformedArgsResponse();
} }
if (! (defined($type) && ($type =~ /^(SA|CM|MA|Component|Slice|User)$/i))){ if (! (defined($type) &&
($type =~ /^(SA|AM|CM|MA|Component|Slice|User)$/i))){
return GeniResponse->MalformedArgsResponse(); return GeniResponse->MalformedArgsResponse();
} }
$type = lc($type); $type = lc($type);
...@@ -281,7 +282,7 @@ sub Resolve($) ...@@ -281,7 +282,7 @@ sub Resolve($)
}; };
return GeniResponse->Create(GENIRESPONSE_SUCCESS, $blob); return GeniResponse->Create(GENIRESPONSE_SUCCESS, $blob);
} }
if ($type eq "cm") { if ($type eq "cm" || $type eq "am") {
my $manager = GeniAuthority->Lookup($lookup_token); my $manager = GeniAuthority->Lookup($lookup_token);
if (!defined($manager)) { if (!defined($manager)) {
return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef, return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef,
...@@ -339,7 +340,7 @@ sub Register($) ...@@ -339,7 +340,7 @@ sub Register($)
my $type = $argref->{'type'}; my $type = $argref->{'type'};
if (! (defined($type) && if (! (defined($type) &&
($type =~ /^(SA|MA|CM|SES|Component|Slice|User)$/i))){ ($type =~ /^(SA|MA|AM|CM|SES|Component|Slice|User)$/i))){
return GeniResponse->MalformedArgsResponse(); return GeniResponse->MalformedArgsResponse();
} }
$type = lc($type); $type = lc($type);
...@@ -614,7 +615,7 @@ sub Register($) ...@@ -614,7 +615,7 @@ sub Register($)
} }
return GeniResponse->Create(GENIRESPONSE_SUCCESS); return GeniResponse->Create(GENIRESPONSE_SUCCESS);
} }
if ($type eq "cm" || $type eq "sa" || $type eq "ses") { if ($type eq "cm" || $type eq "sa" || $type eq "ses" || $type eq "am") {
my ($auth, $which, $type) = GeniHRN::Parse($certificate->urn()); my ($auth, $which, $type) = GeniHRN::Parse($certificate->urn());
my $url = $certificate->URL(); my $url = $certificate->URL();
...@@ -661,7 +662,7 @@ sub Remove($) ...@@ -661,7 +662,7 @@ sub Remove($)
my $type = $argref->{'type'}; my $type = $argref->{'type'};
my $token = $uuid || $urn; my $token = $uuid || $urn;
if (! (defined($type) && ($type =~ /^(SA|MA|CM|Component|Slice|User)$/))) { if (! (defined($type) && ($type =~ /^(Slice|User)$/))) {
return GeniResponse->MalformedArgsResponse(); return GeniResponse->MalformedArgsResponse();
} }
if (! ((defined($uuid) || defined($urn)) && defined($cred))) { if (! ((defined($uuid) || defined($urn)) && defined($cred))) {
...@@ -815,7 +816,7 @@ sub ListComponents($) ...@@ -815,7 +816,7 @@ sub ListComponents($)
# #
my @results = (); my @results = ();
my $query_result = DBQueryWarn("select uuid from geni_authorities ". my $query_result = DBQueryWarn("select uuid from geni_authorities ".
"where type='cm'"); "where type='cm' or type='am'");
return GeniResponse->Create(GENIRESPONSE_DBERROR) return GeniResponse->Create(GENIRESPONSE_DBERROR)
if (!defined($query_result)); if (!defined($query_result));
......
...@@ -10,8 +10,17 @@ sub DoUpdate($$$) ...@@ -10,8 +10,17 @@ sub DoUpdate($$$)
DBSetDefault($dbhandle); DBSetDefault($dbhandle);
#
# This is a fixup.
#
if (DBKeyExists("geni_authorities", "urn")) {
DBQueryFatal("ALTER TABLE `geni_authorities` drop key `urn`");
}
DBQueryFatal("ALTER TABLE `geni_authorities` " .
"add unique key `urn` (`urn`(255))");
DBQueryFatal( "ALTER TABLE `geni_authorities` " . DBQueryFatal( "ALTER TABLE `geni_authorities` " .
"MODIFY `type` enum( 'sa', 'ma', 'ch', 'cm', 'ses', 'am' ) " . "MODIFY `type` enum( 'sa', 'ma', 'ch', 'cm', 'ses', 'am' ) ".
"NOT NULL DEFAULT 'sa'" ); "NOT NULL DEFAULT 'sa'" );
return 0; return 0;
......
Supports Markdown
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