Commit 5d7cf641 authored by Gary Wong's avatar Gary Wong
Browse files

Reinstate URNs in the new credential headers.

parent ea72e7db
......@@ -597,7 +597,7 @@ sub Create($$)
my $self = {};
$self->{'CERT'} = $query_result->fetchrow_hashref();
$self->{'CERT'}->{'uri'} = GeniHRN::Generate( $OURDOMAIN, "user",
$self->{'CERT'}->{'urn'} = GeniHRN::Generate( $OURDOMAIN, "user",
$self->{'CERT'}->{'uid'} );
$self->{'stored'} = 1;
bless($self, $class);
......@@ -611,9 +611,10 @@ sub created($) { return field($_[0], "created"); }
sub cert($) { return field($_[0], "cert"); }
sub privkey($) { return field($_[0], "privkey"); }
sub revoked($) { return field($_[0], "revoked"); }
sub uri($) { return field($_[0], "uri"); }
sub uri($) { return undef; }
sub urn($) { return field($_[0], "urn"); }
sub URL($) { return undef; }
sub URN($) { return field($_[0], "uri"); }
sub URN($) { return field($_[0], "urn"); }
#
# Need to add DN to the emulab table.
......
......@@ -137,8 +137,8 @@ sub extensions($) { return field($_[0], "extensions"); }
sub owner_cert($) { return $_[0]->{"owner_cert"}; }
sub target_cert($) { return $_[0]->{"target_cert"}; }
sub hrn($) { return $_[0]->{"target_cert"}->hrn(); }
sub target_uri($) { return $_[0]->{"target_cert"}->uri(); }
sub owner_uri($) { return $_[0]->{"owner_cert"}->uri(); }
sub target_urn($) { return $_[0]->{"target_cert"}->urn(); }
sub owner_urn($) { return $_[0]->{"owner_cert"}->urn(); }
#
# Stringify for output.
......@@ -385,14 +385,14 @@ sub Sign($$)
return -1;
}
my $target_cert = $self->target_cert()->cert();
my $target_urn = $self->target_uuid();
my $target_urn = $self->target_urn();
if (!defined($self->owner_cert())) {
print STDERR "No owner certificate attached to $self\n";
return -1;
}
my $owner_cert = $self->owner_cert()->cert();
my $owner_urn = $self->owner_uuid();
my $owner_urn = $self->owner_urn();
# Credential expiration: hard-code to 24 hours from now.
my @expt = gmtime( time() + 24 * 60 * 60 );
......
......@@ -397,8 +397,12 @@ sub Register($$$$)
"type" => $type,
"gid" => $cert,
"info" => $info });
return -1
if (!defined($response) || $response->code() != GENIRESPONSE_SUCCESS);
if (!defined($response) || $response->code() != GENIRESPONSE_SUCCESS) {
print STDERR "Could not register object: " .
$response->output() . "\n";
return -1;
}
return 0;
}
......
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