Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-322

Implement additional validations for names used as identifiers

XMLWordPrintable

      https://wiki.onap.org/display/DW/CPS-322%3A+Implement+additional+validations+for+names+used+as+identifiers

      Where should this validation be implemented?

      • Dataspace Creation(Cps-Core)
      • Schema Sets(Cps-Core)
      • Anchor Creation (Cps-Core).
      • During CM Handle Registration for cm handle name(Cps-NCMP Extends Anchor creation).
      • NCMP Properties(Potential Future debt fix Cps-NCMP)

       

      The name should not have

      1. comma - which is mostly used to separate name when providing multiple. In CPS Temporal, we need to provide an option to get data for multiple anchors. And, a comma-separated string is a concise way to provide it as a query parameter.

      Note - Look for current network function id's convention.

      https://docs.onap.org/projects/onap-vnfrqts-requirements/en/latest/Chapter5/Heat/ONAP%20Heat%20Resource%20ID%20and%20Parameter%20Naming%20Convention/Resource%20IDs.html

      https://wiki.onap.org/display/DW/VNF+HEAT+Requirements

       

       Potential Implementation proposals

      Use general reg ex string validation. Investigate potential Apache library.

      Use Spring validator at service layer, using @Validated,@Valid tags.

      Throw  Data Validation exception 400 BAD_REQUEST

      Open Issues

      1.  CPS-Core-exact rules for valid names (suggestion: [A-Za-z0-9_]+  consider dash ?!) 
        1. Dataspace
        2. Schemaset
        3. Anchor
      2. CM-handle ID (NCMP interfaces) more strict or same as anchor-names ?!
        1. if same rules apply can we rely on CPS-Core validation (exception thrown) or use early validation
          Might need to change code to attempt to create anchor BEFORE registering
        2. alternative: CPS-Core might expose validation (JAVA) interface lis isValidAnchorName()
      3. Validation on get/query scenarios
        1. recommend not, little value, high costs!

       

      Out-of-scope:

      1.  exception handling/partial failure ->done in separate user story
      2. CSIT Test (not on negative scenarios)

      A/C

      1. Document and agree with team and stakeholders (regex) for valid names (dataspace,schemaset,anchor,cm-handle)
      2. Agree with team and stakeholder where validation is implemented and if exposed as interface
      3. Demo negative scenario's for each
        1. dataspace
        2. schemaset
        3. anchor
        4. cm-handle

       

            dylanb95est dylanb95est
            brusak brusak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: