Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::runtime::OnlineActivation Struct Reference

Online license activation flow. More...

#include <license.hpp>

Static Public Member Functions

static std::optional< std::string > activate (std::string_view server_url, std::string_view serial_number, std::string_view product_id, const OnlineActivationOptions &options={})
 Activate online with a serial number.
static bool deactivate (std::string_view server_url, std::string_view license_key, const OnlineActivationOptions &options={})
 Deactivate a license (free up a machine slot).
static LicenseStatus check_status (std::string_view server_url, std::string_view license_key, const OnlineActivationOptions &options={})
 Check license status with the server.
static bool server_url_allowed (std::string_view server_url, const OnlineActivationOptions &options={})
 True when server_url is an https:// origin, or http:// and the options allow it.
static LicenseStatus parse_status_response (std::string_view body)
 Exact parse of a /status response body: a JSON object whose status member is the string "valid" or "expired" maps to Valid / Expired; anything else (other values, other fields, non-objects, malformed JSON) is InvalidSignature.

Detailed Description

Online license activation flow.

Every exchange is a JSON POST to an https license server; the serial, license key and machine id travel in the request body, never in the URL.

Member Function Documentation

◆ activate()

std::optional< std::string > pulp::runtime::OnlineActivation::activate ( std::string_view server_url,
std::string_view serial_number,
std::string_view product_id,
const OnlineActivationOptions & options = {} )
static

Activate online with a serial number.

Returns the license key on success.

◆ check_status()

LicenseStatus pulp::runtime::OnlineActivation::check_status ( std::string_view server_url,
std::string_view license_key,
const OnlineActivationOptions & options = {} )
static

Check license status with the server.

Returns NotFound when the server is refused or unreachable, and InvalidSignature when it answered but did not vouch for the key (see parse_status_response).

◆ deactivate()

bool pulp::runtime::OnlineActivation::deactivate ( std::string_view server_url,
std::string_view license_key,
const OnlineActivationOptions & options = {} )
static

Deactivate a license (free up a machine slot).

◆ parse_status_response()

LicenseStatus pulp::runtime::OnlineActivation::parse_status_response ( std::string_view body)
static

Exact parse of a /status response body: a JSON object whose status member is the string "valid" or "expired" maps to Valid / Expired; anything else (other values, other fields, non-objects, malformed JSON) is InvalidSignature.

The word "valid" appearing elsewhere in the body is not a verdict.

◆ server_url_allowed()

bool pulp::runtime::OnlineActivation::server_url_allowed ( std::string_view server_url,
const OnlineActivationOptions & options = {} )
static

True when server_url is an https:// origin, or http:// and the options allow it.

Nothing is sent to a URL this rejects.


The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/core/runtime/include/pulp/runtime/license.hpp