Skip to main content

scalio-tenant

Tenant connection shared by the Scalio apps (scalio-docs ADR 0036). The app makes its own certificate; the private key never leaves the instance. The customer's admin runs a setup script that creates the app registration «Scalio Lesen» (read) or «Scalio Schreiben» (write) in their own tenant with only the public certificate, and pastes the printed connection code back into the app.

import scalio_tenant as st

cert = st.new_certificate("Scalio Lesen (rosetta.kunde.ch)")      # store cert_pem, encrypt key_pem
text = st.script(st.read_profile(), cert, "rosetta.kunde.ch")    # show to the admin (Azure Cloud Shell)
conn = st.parse_code(pasted, st.read_profile(), cert)            # tenant, client_id, object_id, key_id
info = st.check(conn["tenant"], conn["client_id"], cert, st.read_profile())  # organization, missing roles
# right after connecting: st.check(..., settle=60) waits until Entra knows the new key (AADSTS700027 meanwhile)
token = st.get_token(conn["tenant"], conn["client_id"], cert)
if cert.due():                                                   # 30 days before expiry
    r = st.renew(conn["tenant"], conn["client_id"], conn["object_id"], conn["key_id"], cert, name)
    # store r["cert"] and r["key_id"] at once
  • permissions.READ_ROLES: the Graph application permissions of «Scalio Lesen». write_profile(roles) takes the roles of the booked modules (the app knows them).
  • read_profile(exchange_teams=True) (0.3.0): also Exchange.ManageAsApp and the Entra role Global Reader, for the Exchange and Teams admin APIs (tokens for st.EXCHANGE and st.TEAMS). check reports what is missing.
  • GDAP (0.3.0): msp_profile(read_profile(...)) makes one multi-tenant registration «Scalio MSP» in the MSP's partner tenant; gdap_customers(partner, client_id, cert) lists the customers with an active GDAP relationship; consent_script(profile, client_id, customer) is run by the MSP's admin once per customer (GDAP roles Application Administrator and Privileged Role Administrator) and grants the permissions there. Tokens for a customer: get_token(customer_tenant, msp_client_id, msp_cert).
  • Shared «Scalio Lesen» (0.4.0, ADR 0047): the instance that holds the connection attaches the public certificate of another instance of the same customer with add_key(tenant, client_id, object_id, own_cert, other_cert_pem, name) (checked by public_certificate); every instance keeps its own key. remove_key(...) takes a key off, registration_keys(...) lists the keys on the registration, and status_row(...) is what an instance reports to Compass. Not tried against a real tenant yet.
  • Storage (0.5.0, ADR 0063 mandant/M1-M3): Store(db, seal, unseal, max_organizations=, max_connections=) keeps the organizations of an instance and their tenant connections in one shape for every app (collections scalio_organizations, scalio_connections; any Motor-like database). The app seals the private key with its own key; public() and connections() never return it, certificate(conn) unseals it in memory. An organization may have several tenants, a tenant belongs to one organization. Single-tenant apps use own_organization() and limit 1. pending_certificate(slot, name) holds the certificate of a setup script until the code comes back, remove_connection(id, keep_as=slot) keeps it for the same script; extra / update_extra for the app's own fields; record_check, record_renewal, renew_due (worker job), login_tenants(home) and customer_scalio_orgs() (for scalio-identity Binding) and visible_to(staff=, scalio_org_id=, tenant_id=) (organization as hard boundary).
  • App objects, GDAP and shared «Scalio Lesen» in the store (0.9.0, ADR 0063 U4, ADR 0047/0049): a connection may name the app's own object it belongs to (local_id: a Citadel or Foundry tenant, a Rosetta customer; by_local, certificate_of(local_id, name) for the next script, pending_public(slot), remove_local, save_connection(replace=True) for a profile change). save_msp(...) keeps the «Scalio MSP» registration in the partner tenant, save_gdap(org, tenant, profile) a customer tenant connected through it (no own certificate, certificate_for(conn) returns the MSP's, set_profile changes read/write without a code, remove_connection refuses the MSP registration while GDAP connections use it, its renewal updates their thumbprint). Shares: shared_from, shared_with (add_share, drop_share, shareable) and one-time requests (new_share_request, share_request, claim_share_request; collection scalio_share_requests, only the token's sha256, TTL). Sharing(store, app=, own_origin=, compass=, profile=, enabled=) is the whole takeover and approval flow plus the status report for Compass (rows, remove_retired, offers, start, request_cert, complete, incoming, approve, leave); refusals are ShareError(status, code, message), the app maps them to its answer and writes its audit.
  • Licenses (0.6.0, ADR 0080): licenses.evaluate(subscribed_skus) reads what a tenant can use from the service plans of Graph subscribedSkus (AAD_PREMIUM_P2, INTUNE_A, MIP_S_CLP2, ...), not from SKU names, so unknown SKUs such as DEVELOPERPACK_V2_E5 count too. Result: capabilities (stable keys like entra_p2, intune, labels_auto, labels de/en in CAPABILITIES), level (e5, e3, business_premium, basic, none), skus and unknown; has(...), missing(...), to_dict(). Display names come from Microsoft's list «Product names and service plan identifiers for licensing» (data/m365_skus.json, sku_name, plans_of); entries without service plans (simulated tenants, short form {"sku_part_number", "units"}) take them from that list. The workflow «Microsoft-Lizenzliste» refreshes it monthly (tools/update_m365_skus.py) and opens a PR; new service plans that matter go into PLAN_CAPABILITIES by hand. capability_for_resource(type) names the capability a catalog resource type needs (AADRoleEligibility… -> entra_p2, Intune… -> intune; prefixes in RESOURCE_PREFIXES). Needs only Organization.Read.All (already in «Scalio Lesen»).
  • Without Store the app stores the certificate and the encrypted key itself; the rest of the package keeps nothing.
  • Renewal uses Graph addKey/removeKey with a proof signed by a key on the registration: no extra permission and no admin.

Tests run offline (pip install -e ".[dev]", pytest, ruff check .); Microsoft is faked with httpx.MockTransport.

Metadata

Release files for scalio-tenant 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scalio-tenant 0.9.1
File Size Uploaded Provenance Actions
scalio_tenant-0.9.1.tar.gz 91.3 kB With provenance Details for scalio_tenant-0.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scalio-tenant 0.9.1
File Interpreter ABI Platform Actions
scalio_tenant-0.9.1-py3-none-any.whl Python 3 none any Details for scalio_tenant-0.9.1-py3-none-any.whl

Total release size: 167.8 kB

Release files / scalio_tenant-0.9.1.tar.gz

Download URL scalio_tenant-0.9.1.tar.gz
Size 91.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5f2f2534fe905fd208a163116e1ccf8b558abc26e3272f0aaf2a8532ceb9d76c
BLAKE2b-256 checksum
How to use checksums
a581555cbf2596c030a72f648ec9bb8302cb2c062bc018990408c7a934fe1b50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / scalio_tenant-0.9.1-py3-none-any.whl

Download URL scalio_tenant-0.9.1-py3-none-any.whl
Size 76.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2fe6ccd9031026f4ae1d264866f5b122b4f2e7cae124c6f383086928348e5c1
BLAKE2b-256 checksum
How to use checksums
20d68365c7d8324fd386f20e536589587fda64b9de5a3d9a1dd565f810c62f03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for scalio-tenant 0.9.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scalio_tenant-0.9.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page