Commit 3a863c9b authored by Gary Wong's avatar Gary Wong

Accept (and generate) a component_manager_urn element in node descriptions,

and ignore remote (i.e. mismatched URN) nodes, just as was done with UUIDs.
parent 37efc78c
......@@ -579,10 +579,14 @@ sub GetTicket($;$)
foreach my $ref (@{$ticket->rspec()->{'node'}}) {
my $resource_uuid = $ref->{'component_uuid'} || $ref->{'uuid'};
my $manager_uuid = $ref->{'component_manager_uuid'};
my $manager_urn = $ref->{'component_manager_urn'};
my $node_nickname = $ref->{'virtual_id'} || $ref->{'nickname'};
my $colocate = $ref->{'colocate'} || $ref->{'phys_nickname'};
# Let remote nodes pass through.
next
if (defined($manager_urn) &&
!GeniHRN::Equal( $manager_urn, $ENV{'MYURN'} ) );
next
if (defined($manager_uuid) && $manager_uuid ne $ENV{'MYUUID'});
......@@ -611,6 +615,7 @@ sub GetTicket($;$)
foreach my $ref (@{$rspec->{'node'}}) {
my $resource_uuid = $ref->{'component_uuid'} || $ref->{'uuid'};
my $manager_uuid = $ref->{'component_manager_uuid'};
my $manager_urn = $ref->{'component_manager_urn'};
my $node_nickname = $ref->{'virtual_id'} || $ref->{'nickname'};
my $colocate = $ref->{'colocate'} || $ref->{'phys_nickname'};
my $virtualization_type = $ref->{'virtualization_type'};
......@@ -621,6 +626,9 @@ sub GetTicket($;$)
my $node;
# Let remote nodes pass through.
next
if (defined($manager_urn) &&
!GeniHRN::Equal( $manager_urn, $ENV{'MYURN'} ) );
next
if (defined($manager_uuid) && $manager_uuid ne $ENV{'MYUUID'});
......@@ -890,6 +898,7 @@ sub GetTicket($;$)
$rspec->{'phys_nickname'};
$rspec->{'component_uuid'} = $component_uuid;
$rspec->{'component_manager_urn'} = $ENV{'MYURN'};
$rspec->{'component_manager_uuid'} = $ENV{'MYUUID'};
# Also update the virtexperiment table row.
......@@ -1285,9 +1294,13 @@ sub SliverWork($$)
foreach my $ref (@{$rspec->{'node'}}) {
my $resource_uuid = $ref->{'component_uuid'} || $ref->{'uuid'};
my $node_nickname = $ref->{'virtual_id'} || $ref->{'nickname'};
my $manager_urn = $ref->{'component_manager_urn'};
my $manager_uuid = $ref->{'component_manager_uuid'};
# Let remote nodes pass through.
next
if (defined($manager_urn) &&
!GeniHRN::Equal( $manager_urn, $ENV{'MYURN'} ) );
next
if (defined($manager_uuid) && $manager_uuid ne $ENV{'MYUUID'});
......@@ -1499,11 +1512,15 @@ sub SliverWork($$)
foreach my $ref (@{$rspec->{'node'}}) {
my $resource_uuid = $ref->{'component_uuid'} || $ref->{'uuid'};
my $virtual_id = $ref->{'virtual_id'} || $ref->{'nickname'};
my $manager_urn = $ref->{'component_manager_urn'};
my $manager_uuid = $ref->{'component_manager_uuid'};
$rspecmap{$virtual_id} = $ref;
# Let remote nodes pass through.
next
if (defined($manager_urn) &&
!GeniHRN::Equal( $manager_urn, $ENV{'MYURN'} ) );
next
if (defined($manager_uuid) && $manager_uuid ne $ENV{'MYUUID'});
......
......@@ -63,6 +63,11 @@ if (!defined($certificate)) {
" Could not get uuid from $EMULAB_PEMFILE\n");
}
$ENV{'MYUUID'} = $certificate->uuid();
# The URN could also come from the certificate, and that might be preferable
# in some ways (if anybody is doing something silly like authenticating
# with somebody else's certificate). But that would require everybody to
# upgrade to URNs in their certificates, so we can't assume it yet.
$ENV{'MYURN'} = "urn:publicid:IDN+@OURDOMAIN@+authority+cm";
#
# In the prototype, we accept certificate signed by trusted roots
......
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