hirosystems / chainhook

Extract transactions from Stacks and Bitcoin and build event driven re-org resistant indexers and databases.
GNU General Public License v3.0
144 stars 57 forks source link

Chainhook is not forwarding the auth header to webhook url for stacks predicates #438

Closed BLuEScioN closed 11 months ago

BLuEScioN commented 11 months ago

@micaiah There is a customer who is saying their auth header is not being added to the requests to their webhook url Here is what platform is sending to chainhook api

{
    "name": "For localhost",
    "chain": "stacks",
    "version": 1,
    "networks": {
        "testnet": {
            "if_this": {
                "scope": "contract_call",
                "method": "create-gig",
                "contract_identifier": "ST2GW18TVQR75W1VT53HYGBRGKFRV5BFYNAYRBHF4.Cerulean-marketplace-v1"
            },
            "end_block": null,
            "then_that": {
                "http_post": {
                    "url": "https://update-zero.vercel.app/api/chainhook/updateGig",
                    "authorization_header": "abcdefg"
                }
            },
            "start_block": 107542,
            "decode_clarity_values": true,
            "expire_after_occurrence": null
        }
    }
}

Here is the customer's predicate json, which I uploaded using the file upload feature

{
  "name": "For localhost",
  "chain": "stacks",
  "version": 1,
  "networks": {
    "testnet": {
      "if_this": {
        "scope": "contract_call",
        "method": "create-gig",
        "contract_identifier": "ST2GW18TVQR75W1VT53HYGBRGKFRV5BFYNAYRBHF4.Cerulean-marketplace-v1"
      },
      "end_block": null,
      "then_that": {
        "http_post": {
          "url": "https://update-zero.vercel.app/api/chainhook/updateGig",
          "authorization_header": "abcdefg"
        }
      },
      "start_block": 107542,
      "decode_clarity_values": true,
      "expire_after_occurrence": null
    }
  }
}

It seems like platform is sending the data correctly. Can you check this from your side please? Here is the link to the thread in Discord - https://discord.com/channels/621759717756370964/1086336958546071666/1161310372700110879 cc @sabby

MicaiahReid commented 11 months ago

It looks like we only forward the authorization_header field for bitcoin hooks and not for stacks.

github-actions[bot] commented 11 months ago

:tada: This issue has been resolved in version 1.1.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: