Add support for custom license action handling.
Review Request #14470 — Created June 23, 2025 and updated
License Providers that register custom actions can now handle them in
requests from the client. This is done by registering the action name in
the License Provider'scustom_actions
set and then adding a
handle_<actionid>_action()
method to handle the response.
BaseLicenseProvider.call_action()
has been added to invoke these
actions. This does the work formerly done by the view, making it more
generally-useful outside of HTTP handling. This takes the action ID,
action request data, the license information to operate off of, and an
optional HTTP request (which may be needed by some actions).The action data may be any arbitrary JSON-safe data. Previously, when
the view handled an action, it expected keys and values in the HTTP POST
data to be used as arguments, but now it requires an explicit
action_data
JSON field, which can then be deserialized and passed to
action handlers.The built-in actions (
license-update-check
,process-license-update
,
andupload-license
) now live onBaseLicenseProvider
instead of the
view, givingcall_action()
access to them.
Unit tests pass.
Manually tested the license update flow and some custom actions.
Summary | ID |
---|---|
95f572b5922db1463a1d3200e5a0363c56d673a9 |
Description | From | Last Updated |
---|---|---|
'typing.Mapping' imported but unused Column: 1 Error code: F401 |
![]() |
|
'typing.Protocol' imported but unused Column: 1 Error code: F401 |
![]() |
|
I think the TypeAlias import can be in TYPE_CHECKING |
|
|
Can you add a docstring to this method? |
|
|
This is missing a bunch of args. |
|
|
undefined name 'e' Column: 20 Error code: F821 |
![]() |
- Change Summary:
-
Removed unused imports.
- Commits:
-
Summary ID ed8b9a94128de4d03cdea5fe43bfaf5b82de7249 4b30f67dd7a699d3848a37165703c9d7c2156bd8 - Diff:
-
Revision 2 (+1894 -868)
Checks run (2 succeeded)
- Change Summary:
-
- Brought in all the changes just made to /r/14405/.
- Added missing docs and fixed a wrong copy/pasted docstring in the test providers.
- Moved the
TypeAlias
import intoTYPE_CHECKING
.
- Commits:
-
Summary ID 4b30f67dd7a699d3848a37165703c9d7c2156bd8 2a121ad29d481b6d5d555aeab9dcb013bf23663b - Diff:
-
Revision 3 (+1984 -880)
- Change Summary:
-
Added a line missing during
git add -p
. - Commits:
-
Summary ID 2a121ad29d481b6d5d555aeab9dcb013bf23663b 95f572b5922db1463a1d3200e5a0363c56d673a9 - Diff:
-
Revision 4 (+1984 -880)