Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-763 Ozone S3 gateway (phase two)
  3. HDDS-892

Parse aws v2 headers without spaces in Ozone s3 gateway

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.4.0
    • S3
    • None

    Description

      As of now s3g can't be used with s3cmd (which is seems to be an other popular s3 cli) as it doesn't add any space to the authorization headers.

      Example command:

      ```
      s3cmd ls --no-ssl --host localhost:9878 --host-bucket '%(bucket)s.localhost:9878' s3://b1qwe
      ```

      Result:

      ERROR: S3 error: 404 (AuthorizationHeaderMalformed): The authorization header you provided is invalid.
      

      With the debug option the header could be checked:

      DEBUG: Processing request, please wait...
      DEBUG: get_hostname(b1qwe): b1qwe.localhost:9878
      DEBUG: ConnMan.get(): creating new connection: http://b1qwe.localhost:9878
      DEBUG: non-proxied HTTPConnection(b1qwe.localhost, 9878)
      DEBUG: format_uri(): /?delimiter=%2F
      DEBUG: Sending request method_string='GET', uri='/?delimiter=%2F', headers={'x-amz-date': '20181203T103324Z', 'Authorization': 'AWS4-HMAC-SHA256 Credential=AKIAJGCRGUGIL3DUFDHA/20181203/US/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=762a2dbe21a01fdd1699fb71336ee06b53302f64cd099055ca54088a9ecfc787', 'x-amz-content-sha256': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'}, body=(0 bytes)
      DEBUG: ConnMan.put(): connection put back to pool (http://b1qwe.localhost:9878#1)
      

      The problem here is that we have no spaces between the segments of the authorization headers but we expect them in the AuthorizationHeaderV4 class.

      Attachments

        1. HDDS-892.001.patch
          6 kB
          Marton Elek
        2. HDDS-892.002.patch
          6 kB
          Marton Elek

        Activity

          People

            elek Marton Elek
            elek Marton Elek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: