[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Fri Jan 2 20:13:24 UTC 2004


mwilkinson
Fri Jan  2 15:13:23 EST 2004
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv26130/MOBY

Modified Files:
	Central.pm 
Log Message:
be more stringent with the authURI and email fields because they are being abused.  Some scoundrel just registered 'HelloWorldService' as a service ontology term and didn't include their email address so I could spank them.

moby-live/Perl/MOBY Central.pm,1.120,1.121
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2003/12/28 20:41:59	1.120
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2004/01/02 20:13:23	1.121
@@ -235,6 +235,8 @@
 		return &_error("Malformed XML; may be missing required parameters objectType, Description, authURI or contactEmail","");
 	}
 	return &_error("Malformed authURI - must not have an http:// prefix","") if $auth =~ '[/:]';
+	return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $auth =~ /\./;
+	return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $email =~ /\S\@\S+\.\S+/;
 
 	# validate that the final ontology will be valid by testing against existing relationships and such
 	while (my ($reltype, $obj) = each %{$relationships}){
@@ -469,6 +471,8 @@
 		return &_error("Malformed XML\n may be missing required parameters serviceType, Description, authURI or contactEmail","");
 	}
 	return &_error("Malformed authURI - must not have an http:// prefix","") if $auth =~ '[/:]';
+	return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $auth =~ /\./;
+	return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $email =~ /\S\@\S+\.\S+/;
 
 	# validate that the final ontology will be valid
 
@@ -683,6 +687,8 @@
 		return &_error("Malformed XML; may be missing required parameters namespaceType, Description, authURI or contactEmail","");
 	}
 	return &_error("Malformed authURI - must not have an http:// prefix","") if $auth =~ '[/:]';
+	return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $auth =~ /\./;
+	return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $email =~ /\S\@\S+\.\S+/;
 
 	my ($exists, $exists_message, $URI) = $OntologyServer->namespaceExists(term => $term); # success = 1 if it does
 	(($exists==1) && return &_error("Namespace $term already exists", $URI));
@@ -1044,8 +1050,10 @@
 	$error .="missing serviceName \n" unless defined $serviceName;
 	$error .="missing serviceType \n" unless defined $serviceType;
 	$error .="missing authURI \n" unless defined $AuthURI;
-	$error .="malformed authURI; must be the domain name only with no http prefix or trailing path information \n" if $AuthURI =~ '[/:]';
 	$error .="missing contactEmail \n" unless defined $contactEmail;
+	return &_error("Malformed authURI - must not have an http:// prefix","") if $AuthURI =~ '[/:]';
+	return &_error("Malformed authURI - must take the form NNN.NNN.NNN","") unless $AuthURI =~ /\./;
+	return &_error("Malformed email - must be a valid email address of the form name\@organization.foo","") unless $contactEmail =~ /\S\@\S+\.\S+/;
 	$error .="missing URL \n" unless defined $URL;
 	$error .="missing description \n" unless defined $desc;
 	$error .="missing Category \n" unless defined $Category;




More information about the MOBY-guts mailing list