7 Replies Latest reply on Jul 29, 2019 7:39 AM by iiliev

    secure string maximum string length validate issue

    nb951 Lurker

      with vRO 7.6 in presenation set maximum string length to 40

      run workflow using REST client fails.

       

      2019-07-27 13:20:54.722+0000 [https-jsse-nio-0.0.0.0-8281-exec-6] ERROR {} [BaseController] Error invoking REST [unknown]

      java.lang.IllegalArgumentException: 1 error(s) found: [ { Password - The maximum number of characters allowed for this field is 40 } ]

              at com.vmware.o11n.web.presentation.service.PresentationServiceImpl.validateParameters(PresentationServiceImpl.java:369)

              at com.vmware.o11n.web.workflow.ExecutionController.startWorkflowExecution(ExecutionController.java:354)

      any known solution to this ?

       

      if i remove maximum string length check it works , if i set it to large number like length = 400 it works

        • 1. Re: secure string maximum string length validate issue
          iiliev Champion
          Community WarriorsVMware Employees

          By default, running a workflow via REST call does validate input parameters, so the error you are seeing is the expected behavior.

           

          There is an undocumented header X-Skip-Validation-Of, which you can pass with your REST request, and if the value of this header is parameters, the parameter validation will be skipped.

           

          Note that skipping input validation may cause the workflow to behave incorrectly. Usually, the validation logic in presentation is put there intentionally, and the workflow scripting code is free to assume that the preconditions defined by presentation constraints are satisfied.

          1 person found this helpful
          • 2. Re: secure string maximum string length validate issue
            nb951 Lurker

            thanks a lot for the tip , it worked ,  i see this confirmation in log :

            2019-07-28 12:53:30.406+0000 [https-jsse-nio-0.0.0.0-8281-exec-6] INFO  {} [ExecutionController] Skipping validation of input parameters in execution context

             

            However this is a limitation : no way to run a workflow via REST without skipping validation on string maximum length for type=SecureString

            or is there some other way besides header skip validation ?

            • 3. Re: secure string maximum string length validate issue
              iiliev Champion
              VMware EmployeesCommunity Warriors

              Out of curiosity, what exactly are you trying to achieve?

              • 4. Re: secure string maximum string length validate issue
                nb951 Lurker

                1 test workflow using REST api

                2 workflow has a presentation input of type=SecureString name=password and has a  "Maximum string length=40" validation set.

                3 when i run the workflow from client UI and input password value in presentation it works as expected

                4 when i run using REST client java code i get exception noted above, for this you gave me a workaround , why do think this is not a bug ?

                • 5. Re: secure string maximum string length validate issue
                  iiliev Champion
                  VMware EmployeesCommunity Warriors

                  OK, maybe I have misinterpreted your question.

                   

                  If the presentation contains a constraint 'maximum length = 40', and when starting the workflow you provide a value that is shorter than 40 characters, then validation should pass. If the validation fails, then this is a bug.

                   

                  I suppose this can happen if the secure string value reaches validation logic in encoded form (which is longer than the plain string value). Could you show the actual code you use to start the workflow plus the request payload?

                   

                  BTW, could you check if the issue still exists in vRO 7.6 Service Pack? A colleague of mine recalled that a similar issue was fixed there.

                  • 6. Re: secure string maximum string length validate issue
                    nb951 Lurker

                    yes this seems to be the root cause : secure string value reaches validation logic in encoded form

                     

                    can you forward link to vRO 7.6 Service Pack ? i dont see any avaialable download

                    • 7. Re: secure string maximum string length validate issue
                      iiliev Champion
                      Community WarriorsVMware Employees

                      The current service pack build for vRO 7.6 is build# 14213675

                       

                      I'm not sure how the service packs are distributed to customers, though. You may need to contact your VMware representative for instructions how to get it.