Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-33271

Alternate addresses hostname missing validation

    XMLWordPrintable

Details

    • Untriaged
    • Unknown

    Description

      I am working on adding support to alternate addresses to the tools and noticed that it seems that the hostname in the external address has no server side validation and will take invalid hostnames.

      E.g.

      > curl -X PUT -u Administrator:asdasd -d hostname='ftp://some rubish here' http://127.0.0.1:9000/node/controller/setupAlternateAddresses/external
       
      > curl -X GET  -u Administrator:asdasd http://localhost:9000/pools/default/nodeServices | json_pp
       
      ...
      "alternateAddresses" : {
                  "external" : {
                     "hostname" : "ftp://some rubish here",
                     "ports" : {
                        "mgmt" : 9000,
                        "kvSSL" : 11996,
                        "projector" : 10000,
                        "capi" : 9500,
                        "capiSSL" : 19500,
                        "mgmtSSL" : 19000,
                        "kv" : 12000
                     }
                  }
      

      It will also take and arbitrary length, I have tested up to 10K characters in length. I was hoping also to know what format is hostname expected to take. If we consider a normal address to be of the form scheme://host:port I would expect hostname to be only the host with out port or scheme, is this the expected behaviour?

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-33271
          # Subject Branch Project Status CR V

          Activity

            People

              ashwin.govindarajulu Ashwin Govindarajulu
              carlos.gonzalez Carlos Gonzalez Betancort (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty