Metadata-Version: 2.4
Name: aeris-license
Version: 1.0.0
Summary: Aeris License Manager — RSA node-lock, floating daemon, cloud tier
Author-email: sang-kyo_shin <sang-kyo_shin@keysight.com>
License: Proprietary — Keysight Technologies
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: cryptography>=42.0
Requires-Dist: psutil>=5.9
Requires-Dist: requests>=2.31
Provides-Extra: daemon
Requires-Dist: flask>=3.0; extra == "daemon"
Requires-Dist: click>=8.0; extra == "daemon"
Provides-Extra: dev
Requires-Dist: aeris-license[daemon]; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Requires-Dist: setuptools>=70; extra == "dev"
Provides-Extra: build
Requires-Dist: nuitka>=2.0; extra == "build"
Requires-Dist: build>=1.0; extra == "build"
Requires-Dist: twine>=5.0; extra == "build"
Requires-Dist: setuptools>=70; extra == "build"

# Aeris License Manager

Licensing library for Keysight Aeris products (`aeris-channel`, `aeris-scene`,
`aeris-netplanner`, `aeris-6gr`). Product packages install it automatically as
a dependency.

---

## Requirements

- Python 3.11 or later
- A valid `aeris.lic` license file from Keysight
- Supported platforms for this release: Windows and Linux (macOS not currently supported)

---

## Installation

```bash
pip install aeris-channel   # or aeris-scene, aeris-netplanner, etc.
```

For normal product use, `aeris-license` is installed automatically as a
dependency. Install it directly when you are setting up the license daemon.

---

## Activating your license

Save the `aeris.lic` file you received from Keysight to a permanent location,
then set the `AERIS_LICENSE_FILE` environment variable to that path.

**Recommended locations:**
- All platforms: `~/.keysight/aeris.lic`
- Windows: `C:\Program Files\Keysight\aeris.lic`
- Linux: `/etc/keysight/aeris.lic`

**Windows (PowerShell — permanent, per user):**
```powershell
[System.Environment]::SetEnvironmentVariable(
    "AERIS_LICENSE_FILE",
    "C:\Program Files\Keysight\aeris.lic",
    "User"    # scope — saves to current user's profile, no admin rights needed
)
```

**Linux:**
```bash
echo 'export AERIS_LICENSE_FILE=/etc/keysight/aeris.lic' >> ~/.bashrc
source ~/.bashrc
```

If `AERIS_LICENSE_FILE` is not set, the package searches these locations in order:

1. `aeris.lic` in the **current working directory** (the folder you launch Python from)
2. `~/.keysight/aeris.lic`
3. The platform-specific location above

Note: the search is **not** relative to your virtual environment or the
installed package. Copying `aeris.lic` into a venv folder (for example
`.venv/` or `site-packages/`) will **not** be found. Use `AERIS_LICENSE_FILE`
(recommended) or one of the locations above.

Restart your terminal or IDE, then import the product package. Product
packages call `aeris_license.load_license()` as part of their startup and
verify the license automatically. The `aeris-license` package itself does not
verify a license merely because it is imported.

Quick verify (node-locked):
```bash
python -m aeris_license check
python -c "import your_product_package"  # replace with your installed Aeris product package
```

---

## Diagnosing a license problem

```bash
python -m aeris_license check
```

This prints the license file location, expiry date, licensed products, and
whether the current machine's MAC address is authorised.

---

## Floating license server (multi-seat teams)

If your organisation uses a shared floating license, your IT administrator
sets up the Aeris License Manager daemon on a central server. The signed
floating license lives **only on the server** — workstations do not receive
a license file.

Each workstation sets `AERIS_LICENSE_SERVER=host:port` to point at the daemon.
Clients do not install or run the daemon, and they do not need node-locked
licenses. At startup `load_license()` checks out a seat from the server.

For this release, floating licenses are MAC-bound. For production deployment,
use a native OS service:
- Windows: NSSM service via `install_windows.ps1`
- Linux: systemd service (`aeris-license.service`)

The server setup guide for your IT administrator is bundled with this package.
On the license server, first install the daemon extra:
```bash
pip install "aeris-license[daemon]"
```

Then the bundled server files are available from the installed package:
```bash
python -c "import importlib.resources as r, aeris_license.server as s; print(r.files('aeris_license.server'))"
```

The same package directory also contains `install_windows.ps1` and
`aeris-license.service` for server setup.

On Linux, `/opt/keysight/aeris_license/` is the recommended daemon service
directory. Because it is not a default license search path, set
`AERIS_LICENSE_FILE` explicitly when the license is stored there.

Or start the daemon directly on the license server, specifying the license
file explicitly:
```bash
AERIS_LICENSE_FILE=/opt/keysight/aeris_license/aeris.lic aeris-license-daemon
```

Quick verify (floating):
```bash
# On server host
curl http://localhost:27010/v1/health

# On client workstation (no local .lic file)
export AERIS_LICENSE_SERVER=<license-server-host>:27010
python -m aeris_license check
python -c "import your_product_package"  # replace with your installed Aeris product package
```

---

## Requesting a license

Contact **support.aeris@keysight.com** with:

1. Your name and company
2. The MAC address of your workstation (or license server for floating)

   **Windows (PowerShell):**
   ```powershell
   getmac /v /fo list | Select-String "Physical Address|Connection Name"
   # or
   ipconfig /all | Select-String "Physical Address"
   ```

   **Linux:**
   ```bash
   ip link show | grep "link/ether"
   ```

    **Python (reference command; requires `psutil`):**
   ```bash
   python -c "
   import psutil
   for nic, addrs in psutil.net_if_addrs().items():
       for a in addrs:
           if a.family == psutil.AF_LINK and a.address not in ('', '00:00:00:00:00:00'):
               print(nic, a.address)
   "
   ```

3. The product(s) and features you need
4. Preferred license term (trial / annual / perpetual)

---

## License

Proprietary — Keysight Technologies. All rights reserved.
Unauthorized use, copying, or distribution without a valid license
agreement from Keysight Technologies is prohibited.
