Add wyby sync: proactive PIN provisioning from wyby admin portal

- wyby_client.py: headless login to admin.wyby.ch (OIDC auth-code flow with
  PKCE, cookie session) + booking extraction from the scheduler API
  (GetWallpaperData); PIN = last 6 digits of transaction Number; rental days
  derived from RentingStartDate / AllotmentRentingEndDate (exclusive midnight)
- wyby_sync.py: for every upcoming booking ensure Glutz user, group membership
  and PIN with full-day validity; idempotent, self-healing against wyby's own
  late interface runs; dry-run default
- deploy: wyby-sync.service + 15-min timer (24/7); extend_pins stays hourly
  as safety net
- 39 tests; requests added via uv (available system-wide for the oneshot)
This commit is contained in:
2026-11-12 11:53:41 +01:00
parent d034d3088c
commit 3056ab97bb
10 changed files with 1000 additions and 5 deletions
+16
View File
@@ -0,0 +1,16 @@
[Unit]
Description=wyby-sync — wyby-Buchungen abholen und PINs in Glutz tageweise setzen
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
User=apps
Group=users
WorkingDirectory=/home/apps/glutz-maintenances
ExecStart=/usr/bin/python3 /home/apps/glutz-maintenances/wyby_sync.py --apply
SyslogIdentifier=wyby-sync
NoNewPrivileges=true
ProtectSystem=full
ProtectHome=read-only
PrivateTmp=true