Making WordPress.org

Changeset 11099


Ignore:
Timestamp:
07/07/2021 01:52:55 AM (3 years ago)
Author:
dd32
Message:

Trac: Update the GitHub PR Bot & Slack Mentions Bot to use cookie based authentication to access trac.

Location:
sites/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/slack/trac-bot.php

    r9228 r11099  
    22
    33namespace {
    4     require dirname( dirname( __DIR__ ) ) . '/includes/hyperdb/bb-10-hyper-db.php';
    5     require dirname( dirname( __DIR__ ) ) . '/includes/object-cache.php';
     4    require dirname( dirname( __DIR__ ) ) . '/wp-init.php';
    65
    76    require dirname( dirname( __DIR__ ) ) . '/includes/slack-config.php';
    87
    9     require dirname( dirname( __DIR__ ) ) . '/includes/class-IXR.php';
    108    require dirname( dirname( __DIR__ ) ) . '/includes/class-trac.php';
    119}
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/class-trac.php

    r10972 r11099  
    123123                [
    124124                    'Content-Type: application/json',
    125                     'Authorization: Basic ' . base64_encode( $this->credentials[0] . ':' . $this->credentials[1] ),
     125                    'Cookie: ' . LOGGED_IN_COOKIE . '=' . wp_generate_auth_cookie( get_user_by( 'login', $this->credentials[0] )->ID, time()+60, 'logged_in' ),
    126126                ],
    127127            'content'       => json_encode( [
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/index.php

    r10391 r11099  
    22namespace WordPressdotorg\API\Trac\GithubPRs;
    33
    4 require dirname( dirname( dirname( __DIR__ ) ) ) . '/init.php';
    5 require dirname( dirname( dirname( __DIR__ ) ) ) . '/includes/hyperdb/bb-10-hyper-db.php';
    6 require dirname( dirname( dirname( __DIR__ ) ) ) . '/includes/wp-json-encode.php';
    7 require dirname( dirname( dirname( __DIR__ ) ) ) . '/includes/object-cache.php';
    8 \wp_cache_init();
    9 
     4require dirname( dirname( dirname( __DIR__ ) ) ) . '/wp-init.php';
    105require __DIR__ . '/functions.php';
    116
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/webhook.php

    r10809 r11099  
    22namespace WordPressdotorg\API\Trac\GithubPRs;
    33
    4 require dirname( dirname( dirname( __DIR__ ) ) ) . '/init.php';
    5 require dirname( dirname( dirname( __DIR__ ) ) ) . '/includes/hyperdb/bb-10-hyper-db.php';
    6 require dirname( dirname( dirname( __DIR__ ) ) ) . '/includes/object-cache.php';
    7 \wp_cache_init();
    8 
     4require dirname( dirname( dirname( __DIR__ ) ) ) . '/wp-init.php';
    95require __DIR__ . '/functions.php';
    106require __DIR__ . '/class-trac.php';
  • sites/trunk/common/includes/slack/trac/bot.php

    r11021 r11099  
    5353        $tickets      = array();
    5454
    55         // If the channel is not GitHub centric, require the trac to be suffixed like #1234-core
     55        // If the channel is GitHub centric, require the trac to be suffixed like #1234-core
    5656        $require_trac = in_array( $this->get_channel(), self::$github_channels, true );
    5757        $require_trac = $require_trac ? '' : '?'; // regex optional.
Note: See TracChangeset for help on using the changeset viewer.