seek icon indicating copy to clipboard operation
seek copied to clipboard

Short PID errors after validation

Open kdp-cloud opened this issue 10 months ago • 1 comments

Users are able to create sample attributes with a invalid PID. E.g.: 'Source:bacterial culture'. But when the user tries to add a sample to the Sample type, the short_pid function errors out.

  • The validation of the PID should be modified to make these PIDs invalid.
  • In case the PID passes the validation but raises an exception in the short_pid function, it should fail graciously instead just erroring out.

Screen shot: image

kdp-cloud avatar May 03 '24 07:05 kdp-cloud

I've found using URI::regexp sometimes allows invalid uri's before, but URI::ABS_URI might be better to use.

3.1.4 :003 > URI::regexp =~ 'fish:soup'
 => 0
3.1.4 :004 > URI::regexp =~ 'fish:soup pie'
 => 0
3.1.4 :005 > URI::ABS_URI =~ 'fish:soup pie'
 => nil
3.1.4 :006 > URI::ABS_URI =~ 'fish:soup'
 => 0

stuzart avatar May 03 '24 13:05 stuzart