Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-11846

Connect doco fails to mention the need for hex encoding the canonical query string (BB-14287)

    XMLWordPrintable

Details

    Description

      The BB Connect doco about creating the canonical query string fails to mention that after SHA-256 hashing, the resulting byte array needs to be hex-encoded. Here's what it says right now:

      Hash the canonical request bytes using the SHA-256 algorithm
      e.g. The SHA-256 hash of "foo" is `"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae

      In reality, the SHA-256 hash of "foo" is a byte array that in no way resembles the above string until it's hex-encoded using for example org.apache.commons.codec.binary.Hex#encodeHexString, as in the code sample found further down on that page (in the getQueryStringHash method). The reader should be able to get complete and accurate instructions without having to read code samples.

      While you're changing this page, it would also be good to fix the unclosed quote characters in the section I quoted above.

      FWIW, these mistakes seems to have originated on the JIRA/Confluence Connect doco page from which I assume the BB one was copied.

      Attachments

        Activity

          People

            Unassigned Unassigned
            aswan@atlassian.com Andrew S
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: