Making WordPress.org


Ignore:
Timestamp:
03/04/2022 01:36:09 AM (2 years ago)
Author:
dd32
Message:

HelpScout: Add a webhook endpoint.

Currently used to notify Openverse of new messages, through another webhook.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/common.php

    r10957 r11636  
    77// function to verify signature from HelpScout
    88function isFromHelpScout($data, $signature) {
     9    if ( ! defined( 'HELPSCOUT_SECRET_KEY' ) ) {
     10        return false;
     11    }
     12
    913    $calculated = base64_encode( hash_hmac( 'sha1', $data, HELPSCOUT_SECRET_KEY, true ) );
     14
    1015    return hash_equals( $signature, $calculated );
    1116}
Note: See TracChangeset for help on using the changeset viewer.