$n2l_File = "...filename for DBM database...";
$urn = $ENV{'QUERY_STRING'} ;
# Sanity check on the URN. Minimum length of a valid URN is
# 7 characters - "urn:", a 1-character Namespace ID, ":", and
# a 1-character namespace-specific string. More elaborate
# sanity checks should be part of a real resolver script.
if(length($urn)<7)
{
$error=1;
}
if(!$error)
{
# Convert lexically equivalent versions of a URI into
# a canonical version for DB lookups.
$urn =~ s/^urn:([^:]*):(.*)$/sprintf("urn:%s:%s", lc $1, $2)/ie;
dbmopen(%lu,$n2l_File,0444);
if($lu{$urn})
{
$url=$lu{$urn};
print STDOUT "Location: $url\n\n";
}else{
$error=2;
}
dbmclose(%lu);
}
if($error)
{
print "Content-Type: text/html \n\n";
print "\n";
print "URN Resolution: N2L\n";
print "\n";
print "URN to URL resolution failed for the URN:\n";
print "$urn\n";
print "\n";
print "\n";
}
exit;
RFC 2169 HTTP in URN Resolution June 1997
References:
===========
[1] Daniel, Ron and Michael Mealling, RFC 2168, "Resolution of Uniform
Resource Identifiers using the Domain Name System", June 1997.
[2] Berners-Lee, T, R. Fielding, H. Frystyk, RFC 1945, "Hypertext
Transfer Protocol -- HTTP/1.0", T. Berners-Lee, May 1996.
[3] Fielding, R., J. Gettys, J.C. Mogul, H. Frystyk, T. Berners-Lee,
RFC 2068, "Hypertext Transfer Protocol -- HTTP/1.1", Jan. 1997.
[4] Moats, R., RFC 2141, "URN Syntax", May 1997.
[5] URN-WG. "URN Resolution Services". Work In Progress.
[6] Berners-Lee, T., RFC 1630, "Universal Resource Identifiers in WWW:
A Unifying Syntax for the Expression of Names and Addresses of
Objects on the Network as used in the World-Wide Web", June 1994.
Security Considerations
=======================
Communications with a resolver may be of a sensitive nature. Some
resolvers will hold information that should only be released to
authorized users. The results from resolvers may be the target of
spoofing, especially once electronic commerce transactions are common
and there is money to be made by directing users to pirate
repositories rather than repositories which pay royalties to
rightsholders. Resolution requests may be of interest to traffic
analysts. The requests may also be subject to spoofing.
The requests and responses in this draft are amenable to encoding,
signing, and authentication in the manner of any other HTTP traffic.
Author Contact Information:
===========================
Advanced Computing Lab, MS B287
Los Alamos National Laboratory
Los Alamos, NM, USA, 87545
voice: +1 505 665 0597
fax: +1 505 665 4939
email: rdaniel@lanl.gov
=5= |