Opened 11 years ago

Last modified 11 years ago

#149 new

gmoc.py prepends a URN prefix onto invalid URNs provided by callers

Reported by: chaos@bbn.com Owned by: somebody
Priority: major Milestone:
Component: Clients Version:
Keywords: v1.2.0 Cc:
Dependencies:

Description

When i invoke:

gmoc.Interface(
  'urn:publicid:IDN+rothe008am.gpolab.bbn.com+interface+04:4d:00:26:f1:3f:3b:00:gi0/1',
  resource = <gmoc.Resource object at 0x9cfc12c>, # ID: urn:publicid:IDN+openflow:foam:rothe008am.gpolab.bbn.com+datapath+04:4d:00:26:f1:3f:3b:00
)

the interface id parameter gets set to:

urn:publicid:IDN+gmoc.geni.net+interface+urn:publicid:IDN+rothe008am.gpolab.bbn.com+interface+04:4d:00:26:f1:3f:3b:00:gi0/1

This is because the / character is invalid in a URN, so the check for whether the submitted value is already a valid URN fails, at which point validateInterfaceURN() adds another URN prefix. Whenever gmoc.py generates a URN using a custom prefix, it should:

  1. Fail (either before or after generating the URN) if the resulting URN would not pass a URN validity check
  2. Fail (either before or after generating the URN) if the resulting URN would contain more than one instance of the string urn:publicid:IDN+

All of the validate<type>URN() methods generate URNs, so this should be fixed in all of them.

Change History (2)

comment:1 Changed 11 years ago by chaos@bbn.com

Keywords: v1.2.1 added; v1.1.5 removed

Just updating the keyword to indicate that this issue still exists in 1.2.1. (This is not a surprise.)

comment:2 Changed 11 years ago by chaos@bbn.com

Keywords: v1.2.0 added; v1.2.1 removed

Sorry, that was my stupidity --- i was actually testing against 1.2.0. The implementation of the Interface type is different enough in 1.2.1 that my test doesn't run out of the box, so i'll have to look more carefully.

Note: See TracTickets for help on using tickets.