Commit 746fe9d8 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Sync up with the trunk wrt credential.rnc (I had been on revision 1.2

for a while). I am still not using the actual rspec definition yet, still
using my adhoc one.
parent cb7cf310
...@@ -100,6 +100,7 @@ CREATE TABLE `geni_slices` ( ...@@ -100,6 +100,7 @@ CREATE TABLE `geni_slices` (
`hrn` varchar(256) NOT NULL default '', `hrn` varchar(256) NOT NULL default '',
`idx` mediumint(8) unsigned NOT NULL default '0', `idx` mediumint(8) unsigned NOT NULL default '0',
`uuid` varchar(40) NOT NULL default '', `uuid` varchar(40) NOT NULL default '',
`exptidx` int(11) default NULL,
`created` datetime default NULL, `created` datetime default NULL,
`creator_uuid` varchar(40) NOT NULL default '', `creator_uuid` varchar(40) NOT NULL default '',
`name` tinytext, `name` tinytext,
...@@ -117,6 +118,8 @@ DROP TABLE IF EXISTS `geni_slivers`; ...@@ -117,6 +118,8 @@ DROP TABLE IF EXISTS `geni_slivers`;
CREATE TABLE `geni_slivers` ( CREATE TABLE `geni_slivers` (
`idx` mediumint(8) unsigned NOT NULL default '0', `idx` mediumint(8) unsigned NOT NULL default '0',
`uuid` varchar(40) NOT NULL default '', `uuid` varchar(40) NOT NULL default '',
`hrn` varchar(256) NOT NULL default '',
`name` varchar(256) NOT NULL default '',
`slice_uuid` varchar(40) NOT NULL default '', `slice_uuid` varchar(40) NOT NULL default '',
`creator_uuid` varchar(40) NOT NULL default '', `creator_uuid` varchar(40) NOT NULL default '',
`resource_uuid` varchar(40) NOT NULL default '', `resource_uuid` varchar(40) NOT NULL default '',
...@@ -125,7 +128,7 @@ CREATE TABLE `geni_slivers` ( ...@@ -125,7 +128,7 @@ CREATE TABLE `geni_slivers` (
`credential_idx` int(10) unsigned default NULL, `credential_idx` int(10) unsigned default NULL,
`component_uuid` varchar(40) default NULL, `component_uuid` varchar(40) default NULL,
`aggregate_uuid` varchar(40) default NULL, `aggregate_uuid` varchar(40) default NULL,
`status` enum('ready','broken') NOT NULL default 'ready', `status` enum('created','ready','broken') NOT NULL default 'created',
`rspec_string` text, `rspec_string` text,
PRIMARY KEY (`idx`), PRIMARY KEY (`idx`),
UNIQUE KEY `uuid` (`uuid`), UNIQUE KEY `uuid` (`uuid`),
...@@ -138,6 +141,8 @@ CREATE TABLE `geni_slivers` ( ...@@ -138,6 +141,8 @@ CREATE TABLE `geni_slivers` (
DROP TABLE IF EXISTS `geni_aggregates`; DROP TABLE IF EXISTS `geni_aggregates`;
CREATE TABLE `geni_aggregates` ( CREATE TABLE `geni_aggregates` (
`idx` mediumint(8) unsigned NOT NULL default '0', `idx` mediumint(8) unsigned NOT NULL default '0',
`hrn` varchar(256) NOT NULL default '',
`name` varchar(256) NOT NULL default '',
`uuid` varchar(40) NOT NULL default '', `uuid` varchar(40) NOT NULL default '',
`type` varchar(40) NOT NULL default '', `type` varchar(40) NOT NULL default '',
`slice_uuid` varchar(40) NOT NULL default '', `slice_uuid` varchar(40) NOT NULL default '',
...@@ -147,7 +152,7 @@ CREATE TABLE `geni_aggregates` ( ...@@ -147,7 +152,7 @@ CREATE TABLE `geni_aggregates` (
`ticket_idx` int(10) unsigned default NULL, `ticket_idx` int(10) unsigned default NULL,
`component_idx` int(10) unsigned NOT NULL default '0', `component_idx` int(10) unsigned NOT NULL default '0',
`aggregate_idx` int(10) unsigned default NULL, `aggregate_idx` int(10) unsigned default NULL,
`status` enum('ready','broken') NOT NULL default 'ready', `status` enum('created','ready','broken') NOT NULL default 'created',
PRIMARY KEY (`idx`), PRIMARY KEY (`idx`),
UNIQUE KEY `uuid` (`uuid`), UNIQUE KEY `uuid` (`uuid`),
INDEX `slice_uuid` (`slice_uuid`) INDEX `slice_uuid` (`slice_uuid`)
...@@ -159,12 +164,13 @@ CREATE TABLE `geni_aggregates` ( ...@@ -159,12 +164,13 @@ CREATE TABLE `geni_aggregates` (
DROP TABLE IF EXISTS `geni_tickets`; DROP TABLE IF EXISTS `geni_tickets`;
CREATE TABLE `geni_tickets` ( CREATE TABLE `geni_tickets` (
`idx` mediumint(8) unsigned NOT NULL default '0', `idx` mediumint(8) unsigned NOT NULL default '0',
`ticket_uuid` varchar(40) NOT NULL default '',
`owner_uuid` varchar(40) NOT NULL default '', `owner_uuid` varchar(40) NOT NULL default '',
`slice_uuid` varchar(40) NOT NULL default '', `slice_uuid` varchar(40) NOT NULL default '',
`created` datetime default NULL, `created` datetime default NULL,
`redeem_before` datetime default NULL, `redeem_before` datetime default NULL,
`valid_until` datetime default NULL, `valid_until` datetime default NULL,
`component_idx` int(10) unsigned NOT NULL default '0', `component_uuid` varchar(40) NOT NULL default '',
`seqno` int(10) unsigned NOT NULL default '0', `seqno` int(10) unsigned NOT NULL default '0',
`ticket_string` text, `ticket_string` text,
PRIMARY KEY (`idx`), PRIMARY KEY (`idx`),
...@@ -179,6 +185,7 @@ CREATE TABLE `geni_tickets` ( ...@@ -179,6 +185,7 @@ CREATE TABLE `geni_tickets` (
DROP TABLE IF EXISTS `geni_credentials`; DROP TABLE IF EXISTS `geni_credentials`;
CREATE TABLE `geni_credentials` ( CREATE TABLE `geni_credentials` (
`idx` mediumint(8) unsigned NOT NULL default '0', `idx` mediumint(8) unsigned NOT NULL default '0',
`uuid` varchar(40) NOT NULL default '',
`owner_uuid` varchar(40) NOT NULL default '', `owner_uuid` varchar(40) NOT NULL default '',
`this_uuid` varchar(40) NOT NULL default '', `this_uuid` varchar(40) NOT NULL default '',
`created` datetime default NULL, `created` datetime default NULL,
......
...@@ -112,6 +112,8 @@ sub Create($$$$) ...@@ -112,6 +112,8 @@ sub Create($$$$)
my $self = {}; my $self = {};
$self->{'target'} = $target; $self->{'target'} = $target;
$self->{'owner'} = $owner; $self->{'owner'} = $owner;
$self->{'uuid'} = undef;
$self->{'cert'} = undef;
$self->{'target_uuid'} = $target->uuid(); $self->{'target_uuid'} = $target->uuid();
$self->{'target_cert'} = $target->cert(); $self->{'target_cert'} = $target->cert();
$self->{'owner_uuid'} = $owner->uuid(); $self->{'owner_uuid'} = $owner->uuid();
...@@ -126,6 +128,8 @@ sub Create($$$$) ...@@ -126,6 +128,8 @@ sub Create($$$$)
# accessors # accessors
sub field($$) { return ($_[0]->{$_[1]}); } sub field($$) { return ($_[0]->{$_[1]}); }
sub idx($) { return field($_[0], "idx"); } sub idx($) { return field($_[0], "idx"); }
sub uuid($) { return field($_[0], "uuid"); }
sub cert($) { return field($_[0], "cert"); }
sub hrn($) { return field($_[0], "hrn"); } sub hrn($) { return field($_[0], "hrn"); }
sub target($) { return field($_[0], "target"); } sub target($) { return field($_[0], "target"); }
sub owner($) { return field($_[0], "owner"); } sub owner($) { return field($_[0], "owner"); }
...@@ -208,14 +212,13 @@ sub CreateFromSigned($$;$) ...@@ -208,14 +212,13 @@ sub CreateFromSigned($$;$)
} }
# Dig out the capabilities # Dig out the capabilities
my ($cap_node) = $doc->getElementsByTagName("capabilities"); my ($cap_node) = $doc->getElementsByTagName("privileges");
return undef return undef
if (!defined($cap_node)); if (!defined($cap_node));
my $capabilities = XMLin($cap_node->toString(), ForceArray => 0); my $capabilities = XMLin($cap_node->toString(), ForceArray => 0);
# Dig out the slice uuid. Locally, I am not sure if we bother to # UUID of the credential.
# keep slices in the DB (they are in the DB at geni central). my ($uuid_node) = $doc->getElementsByTagName("uuid");
my ($uuid_node) = $doc->getElementsByTagName("this_uuid");
return undef return undef
if (!defined($uuid_node)); if (!defined($uuid_node));
my $this_cert = $uuid_node->to_literal(); my $this_cert = $uuid_node->to_literal();
...@@ -228,6 +231,21 @@ sub CreateFromSigned($$;$) ...@@ -228,6 +231,21 @@ sub CreateFromSigned($$;$)
return undef; return undef;
} }
# Dig out the slice uuid. Locally, I am not sure if we bother to
# keep slices in the DB (they are in the DB at geni central).
($uuid_node) = $doc->getElementsByTagName("target_uuid");
return undef
if (!defined($uuid_node));
my $target_cert = $uuid_node->to_literal();
my $target_uuid;
GeniCertificate->CertificateInfo($target_cert, \$target_uuid) == 0
or return undef;
if (! ($target_uuid =~ /^\w+\-\w+\-\w+\-\w+\-\w+$/)) {
print STDERR "Invalid target_uuid in credential\n";
return undef;
}
# Dig out the hrn. # Dig out the hrn.
my ($hrn_node) = $doc->getElementsByTagName("hrn"); my ($hrn_node) = $doc->getElementsByTagName("hrn");
return undef return undef
...@@ -251,8 +269,10 @@ sub CreateFromSigned($$;$) ...@@ -251,8 +269,10 @@ sub CreateFromSigned($$;$)
my $self = {}; my $self = {};
$self->{'capabilities'} = $capabilities; $self->{'capabilities'} = $capabilities;
$self->{'target_uuid'} = $this_uuid; $self->{'uuid'} = $this_uuid;
$self->{'target_cert'} = $this_cert; $self->{'cert'} = $this_cert;
$self->{'target_uuid'} = $target_uuid;
$self->{'target_cert'} = $target_cert;
$self->{'owner_uuid'} = $owner_uuid; $self->{'owner_uuid'} = $owner_uuid;
$self->{'hrn'} = $hrn; $self->{'hrn'} = $hrn;
$self->{'string'} = $string; $self->{'string'} = $string;
...@@ -275,8 +295,11 @@ sub Delete($) ...@@ -275,8 +295,11 @@ sub Delete($)
if (! ref($self)); if (! ref($self));
if (defined($self->idx())) { if (defined($self->idx())) {
my $idx = $self->idx(); my $idx = $self->idx();
my $uuid = $self->uuid();
DBQueryWarn("delete from geni_certificates where uuid='$uuid'")
or return -1;
DBQueryWarn("delete from geni_credentials where idx='$idx'") DBQueryWarn("delete from geni_credentials where idx='$idx'")
or return -1; or return -1;
} }
...@@ -298,14 +321,32 @@ sub Sign($$) ...@@ -298,14 +321,32 @@ sub Sign($$)
$self->AddCapability("*", 0); $self->AddCapability("*", 0);
} }
# This little wrapup is for xmlout. # This little wrapup is for xmlout.
my $capabilities = {"capability" => $self->capabilities()}; my $cap_xml = "<privileges>\n";
my $cap_xml = XMLout($capabilities, "NoAttr" => 1); foreach my $cap (keys(%{ $self->capabilities() })) {
$cap_xml =~ s/opt\>/capabilities\>/g; my $can_delegate = $self->capabilities()->{$cap}->{'can_delegate'};
$cap_xml .= "<privilege>";
$cap_xml .= "<name>$cap</name>";
$cap_xml .= "<can_delegate>$can_delegate</can_delegate>";
$cap_xml .= "</privilege>\n";
}
$cap_xml .= "</privileges>\n";
# Every one gets a new unique index, which is used in the xml:id below. # Every one gets a new unique index, which is used in the xml:id below.
my $idx = TBGetUniqueIndex('next_ticket', 1); my $idx = TBGetUniqueIndex('next_ticket', 1);
my $hrn = $self->hrn(); my $hrn = $self->hrn();
#
# Every ticket/credential its own uuid (certificate).
#
my $certificate = GeniCertificate->Create("credential");
if (!defined($certificate)) {
print STDERR "Could not generate new certificate for $self!\n";
return -1;
}
$self->{'cert'} = $certificate->cert();
$self->{'uuid'} = $certificate->uuid();
my $cred_cert = $certificate->cert();
# #
# Need the certificates for target and owner of the credential. # Need the certificates for target and owner of the credential.
# #
...@@ -327,11 +368,11 @@ sub Sign($$) ...@@ -327,11 +368,11 @@ sub Sign($$)
my $template = my $template =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n". "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n".
"<credential xml:id=\"ref1\">\n". "<credential xml:id=\"ref1\">\n".
" <type>capability</type>\n". " <type>privilege</type>\n".
" <serial>$idx</serial>\n". " <serial>$idx</serial>\n".
" <owner_uuid>$owner_cert</owner_uuid>\n". " <owner_uuid>$owner_cert</owner_uuid>\n".
" <target_uuid>$target_cert</target_uuid>\n". " <target_uuid>$target_cert</target_uuid>\n".
" <this_uuid>$target_cert</this_uuid>\n". " <uuid>$cred_cert</uuid>\n".
" <hrn>$hrn</hrn>\n". " <hrn>$hrn</hrn>\n".
" <expires>2008-05-10T09:00:00</expires>\n". " <expires>2008-05-10T09:00:00</expires>\n".
" $cap_xml\n". " $cap_xml\n".
...@@ -409,14 +450,16 @@ sub Store($) ...@@ -409,14 +450,16 @@ sub Store($)
# Every credential store gets a new unique index. # Every credential store gets a new unique index.
my $idx = TBGetUniqueIndex('next_ticket', 1); my $idx = TBGetUniqueIndex('next_ticket', 1);
my $this_uuid = $self->this_uuid(); my $this_uuid = $self->target_uuid();
my $owner_uuid = $self->owner_uuid(); my $owner_uuid = $self->owner_uuid();
my $uuid = $self->uuid();
# Now tack on other stuff we need. # Now tack on other stuff we need.
push(@insert_data, "created=now()"); push(@insert_data, "created=now()");
push(@insert_data, "idx='$idx'"); push(@insert_data, "idx='$idx'");
push(@insert_data, "this_uuid='$this_uuid'"); push(@insert_data, "this_uuid='$this_uuid'");
push(@insert_data, "owner_uuid='$owner_uuid'"); push(@insert_data, "owner_uuid='$owner_uuid'");
push(@insert_data, "uuid='$uuid'");
my $safe_credential = DBQuoteSpecial($self->asString()); my $safe_credential = DBQuoteSpecial($self->asString());
push(@insert_data, "credential_string=$safe_credential"); push(@insert_data, "credential_string=$safe_credential");
......
...@@ -678,7 +678,7 @@ sub Create($$$$$) ...@@ -678,7 +678,7 @@ sub Create($$$$$)
my $experiment = $slice->GetExperiment(); my $experiment = $slice->GetExperiment();
if (!defined($experiment)) { if (!defined($experiment)) {
print STDERR "Could not map $slice to its experiment\n"; print STDERR "Could not map $slice to its experiment\n";
return -1; return undef;
} }
# #
...@@ -689,17 +689,17 @@ sub Create($$$$$) ...@@ -689,17 +689,17 @@ sub Create($$$$$)
my $node = Node->Lookup($resource_uuid); my $node = Node->Lookup($resource_uuid);
if (!defined($node)) { if (!defined($node)) {
print STDERR "Could not map node $resource_uuid to its object\n"; print STDERR "Could not map node $resource_uuid to its object\n";
return -1; return undef;
} }
my $reservation = $node->Reservation(); my $reservation = $node->Reservation();
if (!defined($reservation)) { if (!defined($reservation)) {
print STDERR "$node was already released from $slice\n"; print STDERR "$node was already released from $slice\n";
return -1; return undef;
} }
if (! $reservation->SameExperiment($experiment)) { if (! $reservation->SameExperiment($experiment)) {
print STDERR "$node is reserved to another, not $reservation\n"; print STDERR "$node is reserved to another, not $reservation\n";
# Signal error so we can look at what happened. # Signal error so we can look at what happened.
return -1; return undef;
} }
# #
...@@ -719,7 +719,7 @@ sub Create($$$$$) ...@@ -719,7 +719,7 @@ sub Create($$$$$)
"nodeid" => $node->node_id(), "nodeid" => $node->node_id(),
"verbose" => 1 }) < 0) { "verbose" => 1 }) < 0) {
print STDERR "Could not create fake jail node on $node\n"; print STDERR "Could not create fake jail node on $node\n";
return -1; return undef;
} }
my $vnode = Node->Lookup($vnodes[0]); my $vnode = Node->Lookup($vnodes[0]);
$uuid = $vnode->uuid(); $uuid = $vnode->uuid();
......
...@@ -98,6 +98,8 @@ sub Create($$$$) ...@@ -98,6 +98,8 @@ sub Create($$$$)
my $self = {}; my $self = {};
$self->{'rspec'} = $rspec; $self->{'rspec'} = $rspec;
$self->{'ticket_cert'} = undef;
$self->{'ticket_uuid'} = undef;
$self->{'slice_uuid'} = $slice->uuid(); $self->{'slice_uuid'} = $slice->uuid();
$self->{'owner_uuid'} = $owner->uuid(); $self->{'owner_uuid'} = $owner->uuid();
$self->{'slice_cert'} = $slice->cert(); $self->{'slice_cert'} = $slice->cert();
...@@ -129,6 +131,8 @@ sub slice_uuid($) { return field($_[0], "slice_uuid"); } ...@@ -129,6 +131,8 @@ sub slice_uuid($) { return field($_[0], "slice_uuid"); }
sub owner_uuid($) { return field($_[0], "owner_uuid"); } sub owner_uuid($) { return field($_[0], "owner_uuid"); }
sub slice_cert($) { return field($_[0], "slice_cert"); } sub slice_cert($) { return field($_[0], "slice_cert"); }
sub owner_cert($) { return field($_[0], "owner_cert"); } sub owner_cert($) { return field($_[0], "owner_cert"); }
sub ticket_cert($) { return field($_[0], "ticket_cert"); }
sub ticket_uuid($) { return field($_[0], "ticket_uuid"); }
sub ticket($) { return field($_[0], "ticket"); } sub ticket($) { return field($_[0], "ticket"); }
sub asString($) { return field($_[0], "ticket_string"); } sub asString($) { return field($_[0], "ticket_string"); }
sub ticket_string($) { return field($_[0], "ticket_string"); } sub ticket_string($) { return field($_[0], "ticket_string"); }
...@@ -200,9 +204,23 @@ sub CreateFromSignedTicket($$;$$) ...@@ -200,9 +204,23 @@ sub CreateFromSignedTicket($$;$$)
my $rspec = XMLin($rspec_node->toString(), ForceArray => ["node", my $rspec = XMLin($rspec_node->toString(), ForceArray => ["node",
"link"]); "link"]);
# Dig out the ticket uuid.
my ($uuid_node) = $doc->getElementsByTagName("uuid");
return undef
if (!defined($uuid_node));
my $ticket_cert = $uuid_node->to_literal();
my $ticket_uuid;
GeniCertificate->CertificateInfo($ticket_cert, \$ticket_uuid) == 0
or return undef;
if (! ($ticket_uuid =~ /^\w+\-\w+\-\w+\-\w+\-\w+$/)) {
print STDERR "Invalid uuid in ticket\n";
return undef;
}
# Dig out the slice uuid. Locally, I am not sure if we bother to # Dig out the slice uuid. Locally, I am not sure if we bother to
# keep slices in the DB (they are in the DB at geni central). # keep slices in the DB (they are in the DB at geni central).
my ($uuid_node) = $doc->getElementsByTagName("this_uuid"); my ($uuid_node) = $doc->getElementsByTagName("target_uuid");
return undef return undef
if (!defined($uuid_node)); if (!defined($uuid_node));
my $slice_cert = $uuid_node->to_literal(); my $slice_cert = $uuid_node->to_literal();
...@@ -243,6 +261,8 @@ sub CreateFromSignedTicket($$;$$) ...@@ -243,6 +261,8 @@ sub CreateFromSignedTicket($$;$$)
my $self = {}; my $self = {};
$self->{'idx'} = undef; $self->{'idx'} = undef;
$self->{'rspec'} = $rspec; $self->{'rspec'} = $rspec;
$self->{'ticket_cert'} = $ticket_cert;
$self->{'ticket_uuid'} = $ticket_uuid;
$self->{'slice_uuid'} = $slice_uuid; $self->{'slice_uuid'} = $slice_uuid;
$self->{'owner_uuid'} = $owner_uuid; $self->{'owner_uuid'} = $owner_uuid;
$self->{'slice_cert'} = $slice_cert; $self->{'slice_cert'} = $slice_cert;
...@@ -284,8 +304,11 @@ sub Delete($) ...@@ -284,8 +304,11 @@ sub Delete($)
if (! ref($self)); if (! ref($self));
if ($self->stored()) { if ($self->stored()) {
my $idx = $self->idx(); my $idx = $self->idx();
my $uuid = $self->ticket_uuid();
DBQueryWarn("delete from geni_certificates where uuid='$uuid'")
or return -1;
DBQueryWarn("delete from geni_tickets where idx='$idx'") DBQueryWarn("delete from geni_tickets where idx='$idx'")
or return -1; or return -1;
...@@ -323,6 +346,7 @@ sub Store($) ...@@ -323,6 +346,7 @@ sub Store($)
my $seqno = $self->seqno(); my $seqno = $self->seqno();
my $slice_uuid = $self->slice_uuid(); my $slice_uuid = $self->slice_uuid();
my $owner_uuid = $self->owner_uuid(); my $owner_uuid = $self->owner_uuid();
my $ticket_uuid= $self->ticket_uuid();
# #
# For a locally created/signed ticket, seqno=idx. For a ticket from # For a locally created/signed ticket, seqno=idx. For a ticket from
...@@ -341,6 +365,7 @@ sub Store($) ...@@ -341,6 +365,7 @@ sub Store($)
push(@insert_data, "created=now()"); push(@insert_data, "created=now()");
push(@insert_data, "idx='$idx'"); push(@insert_data, "idx='$idx'");
push(@insert_data, "seqno='$seqno'"); push(@insert_data, "seqno='$seqno'");
push(@insert_data, "ticket_uuid='$ticket_uuid'");
push(@insert_data, "slice_uuid='$slice_uuid'"); push(@insert_data, "slice_uuid='$slice_uuid'");
push(@insert_data, "owner_uuid='$owner_uuid'"); push(@insert_data, "owner_uuid='$owner_uuid'");
...@@ -374,6 +399,18 @@ sub Sign($) ...@@ -374,6 +399,18 @@ sub Sign($)
my $rspec_xml = XMLout($self->rspec(), "NoAttr" => 1); my $rspec_xml = XMLout($self->rspec(), "NoAttr" => 1);
$rspec_xml =~ s/opt\>/rspec\>/g; $rspec_xml =~ s/opt\>/rspec\>/g;
#
# Every ticket/credential its own uuid (certificate).
#
my $certificate = GeniCertificate->Create("ticket");
if (!defined($certificate)) {
print STDERR "Could not generate new certificate for $self!\n";
return -1;
}
$self->{'ticket_cert'} = $certificate->cert();
$self->{'ticket_uuid'} = $certificate->uuid();
my $ticket_cert = $certificate->cert();
# #
# Create a template xml file to sign. # Create a template xml file to sign.
# #
...@@ -384,11 +421,12 @@ sub Sign($) ...@@ -384,11 +421,12 @@ sub Sign($)
" <serial>$idx</serial>\n". " <serial>$idx</serial>\n".
" <owner_uuid>$owner_cert</owner_uuid>\n". " <owner_uuid>$owner_cert</owner_uuid>\n".
" <target_uuid>$slice_cert</target_uuid>\n". " <target_uuid>$slice_cert</target_uuid>\n".
" <this_uuid>$slice_cert</this_uuid>\n". " <uuid>$ticket_cert</uuid>\n".
" <hrn>$hrn</hrn>\n". " <hrn>$hrn</hrn>\n".
" <expires>2008-05-10T09:00:00</expires>\n". " <expires>2008-05-10T09:00:00</expires>\n".
" <ticket>\n". " <ticket>\n".
" <can_delegate>1</can_delegate>\n". " <can_delegate>1</can_delegate>\n".
" <redeem_before>2008-05-10T09:00:00</redeem_before>\n".
" $rspec_xml\n". " $rspec_xml\n".
" </ticket>\n". " </ticket>\n".
"</credential>\n"; "</credential>\n";
......
...@@ -100,6 +100,7 @@ CREATE TABLE `geni_slices` ( ...@@ -100,6 +100,7 @@ CREATE TABLE `geni_slices` (
`hrn` varchar(256) NOT NULL default '', `hrn` varchar(256) NOT NULL default '',
`idx` mediumint(8) unsigned NOT NULL default '0', `idx` mediumint(8) unsigned NOT NULL default '0',
`uuid` varchar(40) NOT NULL default '', `uuid` varchar(40) NOT NULL default '',
`exptidx` int(11) default NULL,
`created` datetime default NULL, `created` datetime default NULL,
`creator_uuid` varchar(40) NOT NULL default '', `creator_uuid` varchar(40) NOT NULL default '',
`name` tinytext, `name` tinytext,
...@@ -117,6 +118,8 @@ DROP TABLE IF EXISTS `geni_slivers`; ...@@ -117,6 +118,8 @@ DROP TABLE IF EXISTS `geni_slivers`;
CREATE TABLE `geni_slivers` ( CREATE TABLE `geni_slivers` (
`idx` mediumint(8) unsigned NOT NULL default '0', `idx` mediumint(8) unsigned NOT NULL default '0',
`uuid` varchar(40) NOT NULL default '', `uuid` varchar(40) NOT NULL default '',
`hrn` varchar(256) NOT NULL default '',
`name` varchar(256) NOT NULL default '',
`slice_uuid` varchar(40) NOT NULL default '', `slice_uuid` varchar(40) NOT NULL default '',
`creator_uuid` varchar(40) NOT NULL default '', `creator_uuid` varchar(40) NOT NULL default '',
`resource_uuid` varchar(40) NOT NULL default '', `resource_uuid` varchar(40) NOT NULL default '',
...@@ -125,7 +128,7 @@ CREATE TABLE `geni_slivers` ( ...@@ -125,7 +128,7 @@ CREATE TABLE `geni_slivers` (
`credential_idx` int(10) unsigned default NULL, `credential_idx` int(10) unsigned default NULL,
`component_uuid` varchar(40) default NULL, `component_uuid` varchar(40) default NULL,
`aggregate_uuid` varchar(40) default NULL, `aggregate_uuid` varchar(40) default NULL,
`status` enum('ready','broken') NOT NULL default 'ready', `status` enum('created','ready','broken') NOT NULL default 'created',
`rspec_string` text, `rspec_string` text,
PRIMARY KEY (`idx`), PRIMARY KEY (`idx`),
UNIQUE KEY `uuid` (`uuid`), UNIQUE KEY `uuid` (`uuid`),
...@@ -138,6 +141,8 @@ CREATE TABLE `geni_slivers` ( ...@@ -138,6 +141,8 @@ CREATE TABLE `geni_slivers` (
DROP TABLE IF EXISTS `geni_aggregates`; DROP TABLE IF EXISTS `geni_aggregates`;
CREATE TABLE `geni_aggregates` ( CREATE TABLE `geni_aggregates` (
`idx` mediumint(8) unsigned NOT NULL default '0', `idx` mediumint(8) unsigned NOT NULL default '0',
`hrn` varchar(256) NOT NULL default '',
`name` varchar(256) NOT NULL default '',
`uuid` varchar(40) NOT NULL default '', `uuid` varchar(40) NOT NULL default '',
`type` varchar(40) NOT NULL default '', `type` varchar(40) NOT NULL default '',
`slice_uuid` varchar(40) NOT NULL default '', `slice_uuid` varchar(40) NOT NULL default '',
...@@ -147,7 +152,7 @@ CREATE TABLE `geni_aggregates` ( ...@@ -147,7 +152,7 @@ CREATE TABLE `geni_aggregates` (
`ticket_idx` int(10) unsigned default NULL, `ticket_idx` int(10) unsigned default NULL,
`component_idx` int(10) unsigned NOT NULL default '0', `component_idx` int(10) unsigned NOT NULL default '0',
`aggregate_idx` int(10) unsigned default NULL, `aggregate_idx` int(10) unsigned default NULL,
`status` enum('ready','broken') NOT NULL default 'ready', `status` enum('created','ready','broken') NOT NULL default 'created',