feat(licensing): report active seat quota and usage to upstream license authority
CI Test Suite / Run Component Tests & Pipeline Verification (push) Failing after 21s
CI Test Suite / Run Component Tests & Pipeline Verification (push) Failing after 21s
This commit is contained in:
@@ -900,13 +900,17 @@ def renew_ca_cert_mtls(
|
||||
upstream_ca_pem: Optional[str] = None,
|
||||
requested_seats: Optional[int] = None,
|
||||
seat_increment: int = 0,
|
||||
seats_taken: Optional[int] = None,
|
||||
active_seats: Optional[int] = None,
|
||||
hostname: Optional[str] = None,
|
||||
server_fingerprint: Optional[str] = None,
|
||||
timeout: int = 15,
|
||||
verify_tls: bool = True
|
||||
) -> Tuple[bool, str, Optional[str]]:
|
||||
"""
|
||||
Connects to the master License Authority using mutual TLS (mTLS), authenticating
|
||||
with the server's current ca.crt and ca.key, and requests an automated renewal.
|
||||
Supports requesting seat quota increases or increments during renewal.
|
||||
Supports requesting seat quota increases or increments during renewal and reporting active seat usage.
|
||||
If renewed, writes backup of previous ca.crt and saves new ca.crt in cert_dir.
|
||||
Returns (success, message, new_ca_cert_pem).
|
||||
"""
|
||||
@@ -924,10 +928,15 @@ def renew_ca_cert_mtls(
|
||||
current_pem = f.read()
|
||||
info = extract_license_info_from_cert(current_pem)
|
||||
|
||||
effective_seats_taken = seats_taken if seats_taken is not None else active_seats
|
||||
payload_dict = {
|
||||
"license_id": info.get("license_id"),
|
||||
"fingerprint": info.get("fingerprint"),
|
||||
"current_cert": current_pem
|
||||
"current_cert": current_pem,
|
||||
"seats_taken": effective_seats_taken,
|
||||
"active_seats": effective_seats_taken,
|
||||
"hostname": hostname or "",
|
||||
"server_fingerprint": server_fingerprint or ""
|
||||
}
|
||||
if requested_seats is not None:
|
||||
payload_dict["requested_seats"] = requested_seats
|
||||
|
||||
Reference in New Issue
Block a user