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($)
elsif (defined($hrn) && !($hrn =~ /^[-\w\.]*$/)) {
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();
}
$type = lc($type);
......@@ -281,7 +282,7 @@ sub Resolve($)
};
return GeniResponse->Create(GENIRESPONSE_SUCCESS, $blob);
}
if ($type eq "cm") {
if ($type eq "cm" || $type eq "am") {
my $manager = GeniAuthority->Lookup($lookup_token);
if (!defined($manager)) {
return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef,
......@@ -339,7 +340,7 @@ sub Register($)
my $type = $argref->{'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();
}
$type = lc($type);
......@@ -614,7 +615,7 @@ sub Register($)
}
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 $url = $certificate->URL();
......@@ -661,7 +662,7 @@ sub Remove($)
my $type = $argref->{'type'};
my $token = $uuid || $urn;
if (! (defined($type) && ($type =~ /^(SA|MA|CM|Component|Slice|User)$/))) {
if (! (defined($type) && ($type =~ /^(Slice|User)$/))) {
return GeniResponse->MalformedArgsResponse();
}
if (! ((defined($uuid) || defined($urn)) && defined($cred))) {
......@@ -815,7 +816,7 @@ sub ListComponents($)
#
my @results = ();
my $query_result = DBQueryWarn("select uuid from geni_authorities ".
"where type='cm'");
"where type='cm' or type='am'");
return GeniResponse->Create(GENIRESPONSE_DBERROR)
if (!defined($query_result));
......
......@@ -10,8 +10,17 @@ sub DoUpdate($$$)
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` " .
"MODIFY `type` enum( 'sa', 'ma', 'ch', 'cm', 'ses', 'am' ) " .
"MODIFY `type` enum( 'sa', 'ma', 'ch', 'cm', 'ses', 'am' ) ".
"NOT NULL DEFAULT 'sa'" );
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