Support automatic license updates and manual license uploads.

Review Request #14405 — Created April 28, 2025 and updated — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

The new Licenses page now triggers update checks for licenses on load.
This process involves:

  1. POSTing to the Licenses page with a request for a license check.

    The License Provider will either provide an opaque payload that can
    be used for communicating with an external licensing server, or a
    flag stating that checks aren't supported.

  2. POSTing to the licensing server with the payload.

  3. POSTing back to the Licenses page with the response from the
    licensing server.

    The License Provider will process the result, which may involve
    installing a new license or altering the current one.

This whole process is designed to keep the details of any license
updates internal to the License Provider and licensing server. The
state is communicated in the UI, and the license information reloaded
from new attributes provided in the License Provider responses.

Along with this, licenses can be manually updated, if specified in the
license information. When enabled, this will show a button for uploading
a license, which will pop up a file chooser. After selecting a file, the
contents will be sent to the License Provider for processing via a POST
to the Licenses page.

The view for the Licenses page handles all POST requests. It requires a
CSRF token and some identifying information on the action, action target
(license provider and license), and arguments. It then dispatches to the
License Provider and handles any responses or error results.

Right now, there are specific actions that are supported by this view.
The longer-term plan is to enable arbitrary action support, so License
Providers can trigger custom behavior automatically or in response to
user actions.

All Python and JavaScript unit tests pass.

Tested manually uploading valid and invalid licenses for Power Pack
(ported to the new architecture), verifying the results.

Tested automatic license updates for Power Pack.

Tested all error results and display.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Support automatic license updates and manual license uploads.
The new Licenses page now triggers update checks for licenses on load. This process involves: 1. POSTing to the Licenses page with a request for a license check. The License Provider will either provide an opaque payload that can be used for communicating with an external licensing server, or a flag stating that checks aren't supported. 2. POSTing to the licensing server with the payload. 3. POSTing back to the Licenses page with the response from the licensing server. The License Provider will process the result, which may involve installing a new license or altering the current one. This whole process is designed to keep the details of any license updates internal to the License Provider and licensing server. The state is communicated in the UI, and the license information reloaded from new attributes provided in the License Provider responses. Along with this, licenses can be manually updated, if specified in the license information. When enabled, this will show a button for uploading a license, which will pop up a file chooser. After selecting a file, the contents will be sent to the License Provider for processing via a POST to the Licenses page. The view for the Licenses page handles all POST requests. It requires a CSRF token and some identifying information on the action, action target (license provider and license), and arguments. It then dispatches to the License Provider and handles any responses or error results. Right now, there are specific actions that are supported by this view. The longer-term plan is to enable arbitrary action support, so License Providers can trigger custom behavior automatically or in response to user actions.
ace1682608d31e7b2f6599b985f42ea5bfbda75a Christian Hammond
reviewboard/licensing/views.py
reviewboard/licensing/tests/test_licenses_view.py
reviewboard/static/rb/js/admin/models/licenseModel.ts
reviewboard/static/rb/js/admin/models/tests/index.ts
reviewboard/static/rb/js/admin/models/tests/licenseModelTests.ts
reviewboard/static/rb/js/admin/views/licenseView.ts
reviewboard/static/rb/js/admin/views/tests/licenseViewTests.ts
reviewboard/templates/admin/licensing.html
Loading...