Swift-Package-Plattform für alle nativen mana-e.V.-Apps. ManaCore (Auth, Transport) + ManaTokens (Vereins-Design). SOT: mana/docs/MANA_SWIFT.md
Find a file
Till JS 923b5d06b5 v1.2.0 — Guest-Mode + Refresh-Resilience
Native-Apps werden gegen mana-auth-Downtime gehärtet und können
einen anonymen Local-First-Modus anbieten. Komplett additiv.

AuthClient.Status um `.guest(id: String)` erweitert — persistente
lokale UUID ohne Server-Account, gleichberechtigt mit `.signedIn` als
"App ist nutzbar"-Zustand.

Neue Methoden:
- enterGuestMode() throws -> String — idempotent
- currentGuestId() -> String?
- clearGuestId()
- signOut(keepGuestMode: Bool = false) — Default-Verhalten unverändert

KeychainStore.Key.guestId neu. wipe() löscht nur Session-Felder
(accessToken/refreshToken/email); Guest-ID überlebt. Für komplettes
Vergessen: neue wipeAll().

refreshAccessToken() wipt nicht mehr blind bei jedem Nicht-200.
Heuristik via AuthError.invalidatesSession:
- Wipe bei invalidCredentials/unauthorized/tokenExpired/tokenInvalid/
  emailNotVerified — Session ist tatsächlich tot.
- Behalten bei serviceUnavailable/serverInternal/networkFailure/
  rateLimited — Apps werden bei mana-auth-Downtime nicht mehr in
  Login geworfen.

Beim Wipe fällt der Status auf .guest(id) zurück, falls eine
Guest-Identität existiert; sonst auf .signedOut.

Tests:
- Mock-Setup auf per-test-ID-Routing migriert (analog mana-swift-ui),
  löst Cross-Suite-Pollution zwischen AuthClient+Account und
  AuthClient Guest-Mode + Resilience.
- 15 neue Tests für Guest-Mode + Refresh-Resilience.
- 54/54 Tests grün.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 22:16:08 +02:00
Sources v1.2.0 — Guest-Mode + Refresh-Resilience 2026-05-13 22:16:08 +02:00
Tests v1.2.0 — Guest-Mode + Refresh-Resilience 2026-05-13 22:16:08 +02:00
.gitignore v1.0.0 — initiale Extraktion aus memoro-native 2026-05-12 19:13:31 +02:00
.swiftformat v1.0.0 — initiale Extraktion aus memoro-native 2026-05-12 19:13:31 +02:00
.swiftlint.yml v1.0.0 — initiale Extraktion aus memoro-native 2026-05-12 19:13:31 +02:00
CHANGELOG.md v1.2.0 — Guest-Mode + Refresh-Resilience 2026-05-13 22:16:08 +02:00
CLAUDE.md v1.0.0 — initiale Extraktion aus memoro-native 2026-05-12 19:13:31 +02:00
Package.swift v1.0.0 — initiale Extraktion aus memoro-native 2026-05-12 19:13:31 +02:00
README.md v1.0.0 — initiale Extraktion aus memoro-native 2026-05-12 19:13:31 +02:00

mana-swift-core

Swift-Package-Plattform für alle nativen mana-e.V.-Apps.

Geteilter Code zwischen memoro-native, cards-native, nutriphi-native und allen weiteren ev.mana.*-Apps. Analog zu @mana/* aus Verdaccio für die Web-Plattform.

Products

  • ManaCore — Auth (mana-auth-Login, JWT-Refresh, Keychain), Transport (URLSession-Wrapper mit 401-Retry).
  • ManaTokens — Verein-Designwerte: Farben, Spacings, Typography, Radius, SF-Symbol-Aliases. Spiegelt mana/docs/THEMING.md.

Verwendung

Im project.yml einer nativen App:

packages:
  ManaSwiftCore:
    url: https://git.mana.how/till/mana-swift-core
    from: 1.0.0

targets:
  YourApp:
    dependencies:
      - package: ManaSwiftCore
        product: ManaCore
      - package: ManaSwiftCore
        product: ManaTokens

Während Entwicklung lokal:

packages:
  ManaSwiftCore:
    path: ../mana-swift-core

Konventionen

Siehe CLAUDE.md für die vollständigen Regeln. Übergeordneter Plan: mana/docs/MANA_SWIFT.md.

Lokal entwickeln

swift build
swift test

iOS + macOS-Targets, Swift 6 strict concurrency, keine externen Dependencies.