• 
      

    Allow replacing a GitHub App's private key.

    Review Request #15200 — Created July 28, 2026 and updated

    Information

    Review Board
    release-9.x

    Reviewers

    GitHub lets an administrator regenerate an app's private key and revoke
    the old one. When that happens the key Review Board has stored can no
    longer sign app JWTs, which breaks every installation of the app. There
    was no way to recover short of recreating the whole app, since the
    app-record account is hidden and has no credential-editing UI.

    This adds a "Rotate private key" action to the GitHub App connection. It
    accepts a freshly-generated PEM key, validates that it is a usable RSA
    private key, and stores it on the app-record account, restoring the
    connection in place.

    • Ran unit tests.
    • Generated a new private key and uploaded it successfully.
    Summary ID
    Allow replacing a GitHub App's private key.
    GitHub lets an administrator regenerate an app's private key and revoke the old one. When that happens the key Review Board has stored can no longer sign app JWTs, which breaks every installation of the app. There was no way to recover short of recreating the whole app, since the app-record account is hidden and has no credential-editing UI. This adds a "Rotate private key" action to the GitHub App connection. It accepts a freshly-generated PEM key, validates that it is a usable RSA private key, and stores it on the app-record account, restoring the connection in place. Testing Done: - Ran unit tests. - Generated a new private key and uploaded it successfully.
    nqztrxowytwkkklmvmyunyuwuxvlsyvp

    Description From Last Updated

    continuation line over-indented for visual indent Column: 46 Error code: E127

    reviewbot reviewbot

    continuation line over-indented for visual indent Column: 46 Error code: E127

    reviewbot reviewbot

    I think we like to put all strings on their own lines now so how about: raise ValueError( 'The private …

    maubin maubin

    Same here, we can move the ) to its own line.

    maubin maubin
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    david
    Review request changed
    Commits:
    Summary ID
    Allow replacing a GitHub App's private key.
    GitHub lets an administrator regenerate an app's private key and revoke the old one. When that happens the key Review Board has stored can no longer sign app JWTs, which breaks every installation of the app. There was no way to recover short of recreating the whole app, since the app-record account is hidden and has no credential-editing UI. This adds a "Rotate private key" action to the GitHub App connection. It accepts a freshly-generated PEM key, validates that it is a usable RSA private key, and stores it on the app-record account, restoring the connection in place. Testing Done: - Ran unit tests. - Generated a new private key and uploaded it successfully.
    nqztrxowytwkkklmvmyunyuwuxvlsyvp
    Allow replacing a GitHub App's private key.
    GitHub lets an administrator regenerate an app's private key and revoke the old one. When that happens the key Review Board has stored can no longer sign app JWTs, which breaks every installation of the app. There was no way to recover short of recreating the whole app, since the app-record account is hidden and has no credential-editing UI. This adds a "Rotate private key" action to the GitHub App connection. It accepts a freshly-generated PEM key, validates that it is a usable RSA private key, and stores it on the app-record account, restoring the connection in place. Testing Done: - Ran unit tests. - Generated a new private key and uploaded it successfully.
    nqztrxowytwkkklmvmyunyuwuxvlsyvp

    Checks run (1 failed, 1 succeeded)

    flake8 failed.
    JSHint passed.

    flake8

    david
    maubin
    1. 
        
    2. reviewboard/hostingsvcs/github/app_auth.py (Diff revision 3)
       
       
       
      Show all issues

      I think we like to put all strings on their own lines now so how about:

      raise ValueError(
          'The private key is not a valid PEM private key.'
      ) from e
      
    3. Show all issues

      Same here, we can move the ) to its own line.

    4. 
        
    david
    Review request changed
    Commits:
    Summary ID
    Allow replacing a GitHub App's private key.
    GitHub lets an administrator regenerate an app's private key and revoke the old one. When that happens the key Review Board has stored can no longer sign app JWTs, which breaks every installation of the app. There was no way to recover short of recreating the whole app, since the app-record account is hidden and has no credential-editing UI. This adds a "Rotate private key" action to the GitHub App connection. It accepts a freshly-generated PEM key, validates that it is a usable RSA private key, and stores it on the app-record account, restoring the connection in place. Testing Done: - Ran unit tests. - Generated a new private key and uploaded it successfully.
    nqztrxowytwkkklmvmyunyuwuxvlsyvp
    Allow replacing a GitHub App's private key.
    GitHub lets an administrator regenerate an app's private key and revoke the old one. When that happens the key Review Board has stored can no longer sign app JWTs, which breaks every installation of the app. There was no way to recover short of recreating the whole app, since the app-record account is hidden and has no credential-editing UI. This adds a "Rotate private key" action to the GitHub App connection. It accepts a freshly-generated PEM key, validates that it is a usable RSA private key, and stores it on the app-record account, restoring the connection in place. Testing Done: - Ran unit tests. - Generated a new private key and uploaded it successfully.
    nqztrxowytwkkklmvmyunyuwuxvlsyvp

    Checks run (2 succeeded)

    flake8 passed.
    JSHint passed.
    maubin
    1. Ship It!
    2.