You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,12 @@
7
7
8
8
AuthForge is a license key validation service. Your app sends a license key + hardware ID to the AuthForge API, gets back a cryptographically signed response, and runs background heartbeats to maintain the session. If the license is revoked or expired, the heartbeat fails and you handle it (typically exit the app).
9
9
10
+
## Billing model (so you can pick sensible intervals)
-**10 heartbeats = 1 credit** (billed on every 10th successful heartbeat per license).
14
+
- Any `heartbeat_interval` is safe — from `1` (server apps) to `900` (15 min, desktop apps). Revocations always take effect on the **next** heartbeat regardless of interval.
15
+
10
16
## Installation
11
17
12
18
Copy `authforge.py` into your project (single file, stdlib only). Requires Python 3.9+.
|`heartbeat_mode`|`str`| yes | — |`"SERVER"` or `"LOCAL"` (case-insensitive) |
58
-
|`heartbeat_interval`|`int`| no |`900`| Seconds between heartbeats |
64
+
|`heartbeat_interval`|`int`| no |`900`| Seconds between heartbeats (any value ≥ 1) |
59
65
|`api_base_url`|`str`| no |`https://auth.authforge.cc`| API base URL |
60
66
|`on_failure`|`Callable[[str, Optional[Exception]], None] \| None`| no |`None`| Called on login/heartbeat/network failure; if omitted, process exits via `os._exit(1)`|
61
67
|`request_timeout`|`int`| no |`15`| HTTP timeout (seconds) |
68
+
|`ttl_seconds`|`int \| None`| no |`None` (server default: 86400) | Requested session token lifetime. Server clamps to `[3600, 604800]`; preserved across heartbeat refreshes. |
-**10 heartbeats on the same license = 1 credit** (billed every 10th successful heartbeat).
55
+
56
+
A desktop app running 6h/day at a 15-minute interval burns ~3–4 credits/day. A server app running 24/7 at a 1-minute interval burns ~145 credits/day — pick the interval based on how fast you need revocations to propagate (they always land on the **next** heartbeat).
0 commit comments