Commit 9b8e1367 authored by Srikanth's avatar Srikanth

handling admin credentials.

parent c0cec97b
......@@ -587,6 +587,20 @@ sub SliverAction($$$$$)
# For now, only allow top level aggregate or the slice
#
my ($slice, $aggregate) = Credential2SliceAggregate($credential);
# find out the component manager URN.
my $cm_urn = GeniHRN::Generate($OURDOMAIN, "authority", "cm");
if ( (!defined($slice)) && ($credential->target_urn() =~ /\+authority\+cm$/)) { # administrative credentials are presented.
if ($cm_urn != $credential->target_urn()) {
return GeniResponse->Create(GENIRESPONSE_FORBIDDEN(), undef,
"Credential target does not match CM URN");
}
if(!defined($slice_urn)){
return GeniResponse->MalformedArgsResponse("Missing arguments");
}
$slice = GeniSlice->Lookup($slice_urn);
$aggregate = GeniAggregate->SliceAggregate($slice);
}
if (! (defined($slice) && defined($aggregate))) {
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"No slice or aggregate here");
......
......@@ -54,7 +54,7 @@ myslice = resolve_slice( SLICENAME, mycredential )
print "Found the slice, asking for a credential ..."
if admincredentialfile:
f = open( slicecredentialfile )
f = open( admincredentialfile )
slivercred = f.read()
f.close()
else:
......
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