No description
Find a file
Jon Vanvik 6bb65d2aa3 Remove self-signed TLS option (system trust only); add session changelog
Parity with the Android client: drop the "Allow self-signed certificate"
escape hatch. The app now performs system TLS trust only — a self-signed
appliance must have its CA installed on the device (MDM/profile). A code-only
public-key pinning policy remains (no UI).

- ServerTrustEvaluator: remove ServerTrustPolicy.allowSelfSignedForHost and its
  challenge handler; keep .system (default) and .pinPublicKeySHA256.
- SettingsView: remove the self-signed toggle/state/prefill; makeConfig uses
  the default .system policy.
- MCMSConnection / APIConfiguration: update usage-sketch + doc comments.
- README / GUI-NOTES / MCMS_API.md: document system-trust-only; self-signed
  boxes need their CA installed on the device.
- Add CHANGELOG.md for this session, flagged for the Android port.

Note: configs previously persisted with the self-signed policy fail to decode
and reset to defaults (one-time re-entry of the server URL).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 17:15:38 +02:00
Assets.xcassets/AppIcon.appiconset initial commit 2026-05-31 14:11:29 +02:00
323-1961-302_mcms_6_2_pon_manager_user_guide.pdf initial commit 2026-05-31 14:11:29 +02:00
323-1961-306_mcms_6_2_rest_api_developer_guide.pdf initial commit 2026-05-31 14:11:29 +02:00
APIClient.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
APIConfiguration.swift Remove self-signed TLS option (system trust only); add session changelog 2026-05-31 17:15:38 +02:00
APIEnvelope.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
APIError.swift initial commit 2026-05-31 14:11:29 +02:00
APIQuery.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
AppEnvironment.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
AuthModels.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
AuthRepository.swift initial commit 2026-05-31 14:11:29 +02:00
CHANGELOG.md Remove self-signed TLS option (system trust only); add session changelog 2026-05-31 17:15:38 +02:00
Components.swift initial commit 2026-05-31 14:11:29 +02:00
DashboardDrilldownViews.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
DashboardView.swift initial commit 2026-05-31 14:11:29 +02:00
DashboardViewModel.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
DeviceModels.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
DeviceRepositories.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
Firmware.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
FirmwareUpdateSheet.swift initial commit 2026-05-31 14:11:29 +02:00
Format.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
GUI-NOTES.md Remove self-signed TLS option (system trust only); add session changelog 2026-05-31 17:15:38 +02:00
HANDOFF.md initial commit 2026-05-31 14:11:29 +02:00
KeychainStore.swift initial commit 2026-05-31 14:11:29 +02:00
LoginView.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
MCMS_API.md Remove self-signed TLS option (system trust only); add session changelog 2026-05-31 17:15:38 +02:00
MCMSConnection.swift Remove self-signed TLS option (system trust only); add session changelog 2026-05-31 17:15:38 +02:00
MCMSEndpoint.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
MCMSMobileApp.swift initial commit 2026-05-31 14:11:29 +02:00
MongoTimestamp.swift initial commit 2026-05-31 14:11:29 +02:00
OLTDetailView.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
OLTDetailViewModel.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
OLTListView.swift initial commit 2026-05-31 14:11:29 +02:00
OLTListViewModel.swift Fix build: annotate list-VM merge locals so .sorted infers its element 2026-05-31 16:58:56 +02:00
ONUDetailView.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
ONUDetailViewModel.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
ONUListView.swift initial commit 2026-05-31 14:11:29 +02:00
ONUListViewModel.swift Fix build: annotate list-VM merge locals so .sorted infers its element 2026-05-31 16:58:56 +02:00
ONURepository.swift Apply code-review fixes: identity/pagination, load races, TLS pin, leaks 2026-05-31 16:36:49 +02:00
README.md Remove self-signed TLS option (system trust only); add session changelog 2026-05-31 17:15:38 +02:00
ResetConfirmSheet.swift initial commit 2026-05-31 14:11:29 +02:00
ServerTrustEvaluator.swift Remove self-signed TLS option (system trust only); add session changelog 2026-05-31 17:15:38 +02:00
SessionStore.swift initial commit 2026-05-31 14:11:29 +02:00
SettingsView.swift Remove self-signed TLS option (system trust only); add session changelog 2026-05-31 17:15:38 +02:00

PON Go — iOS

Native iOS app for Ciena MCMS 6.2 PON Manager basics on the go — dashboard, ONU and OLT browsing/diagnostics, firmware updates, resets. SwiftUI + URLSession, no external dependencies. Sibling of the Android app (../mcms_android); the REST behaviour and field paths are identical and documented in MCMS_API.md.

App name PON Go (Xcode project/target is currently SVO_MCMS).

⚠️ Source layout — read this first

This folder holds the canonical flat Swift sources (plus docs, the app icon, and the dev-guide PDFs). The actual Xcode project lives elsewhere (~/Documents/mcms_ios_xcode/run<N>/SVO_MCMS/); the workflow so far has been to copy changed .swift files into the Xcode project and build there.

For a clean git repo, consolidate: move these .swift files + Assets.xcassets/ into the Xcode project directory, make that the iOS repo (with docs/MCMS_API.md and the PDFs alongside), and drop the copy-sync dance. Until then, this folder is the source of truth — edit here, copy into Xcode.

Build (Xcode)

  • Xcode 26 (iOS 26 SDK), deployment target iOS 17+. New iOS App (SwiftUI lifecycle); delete the template ContentView.swift / generated App struct (this scaffold provides its own @main in MCMSMobileApp.swift).
  • Build Settings → Default Actor Isolation → nonisolated. Xcode 26 defaults this to MainActor, which makes the pure-data types (APIQuery.empty, JSONValue: Equatable, …) emit ~8 main-actor warnings (errors under Swift 6 mode). The code is designed nonisolated-by-default; only UI/stateful classes are explicitly @MainActor.
  • App name / icon: set the target's Display Name → "PON Go", and drag Assets.xcassets/AppIcon.appiconset into the project's asset catalog (replacing the existing AppIcon).
  • App Transport Security: the app uses system TLS trust only — there is no self-signed bypass (parity with the Android client). A self-signed appliance must have its CA installed on the device (MDM/configuration profile); otherwise the connection fails with APIError.serverTrust. For plain HTTP hosts, add a scoped NSAppTransportSecurityNSExceptionDomains entry for that host in Info.plist — never NSAllowsArbitraryLoads.

Verify off-device (no iOS SDK needed)

The networking core + AppEnvironment + view models import only Foundation/Observation, so they typecheck against the macOS SDK:

swiftc -typecheck -sdk "$(xcrun --show-sdk-path)" \
  <core + AppEnvironment + *ViewModel .swift files> /tmp/loadphase_stub.swift

Add a one-line stub for LoadPhase (it lives in the SwiftUI Components.swift): enum LoadPhase: Equatable { case idle, loading, loaded; case failed(String) }. Target every run: 0 errors, 0 warnings. SwiftUI views that use iOS-only APIs can't be compiled this way — validate those with isolated snippets or in Xcode.

Layout

App:        MCMSMobileApp (@main), RootView routing, AppEnvironment
Networking: APIConfiguration, MCMSConnection, APIClient, APIEnvelope (JSONValue),
            APIError, APIQuery, MCMSEndpoint, SessionStore, ServerTrustEvaluator,
            KeychainStore, MongoTimestamp, Format
Models:     DeviceModels, AuthModels, Firmware
Repos:      AuthRepository, ONURepository, DeviceRepositories
UI:         Components, Login/Settings/Dashboard/ONUList/ONUDetail/OLTList/
            OLTDetail views + view models, ResetConfirmSheet, FirmwareUpdateSheet,
            DashboardDrilldownViews
Docs:       MCMS_API.md (field guide), the two 323-1961-30x dev-guide PDFs

See HANDOFF.md for architecture, the API gotchas, and status. GUI-NOTES.md is early scaffold notes (historical — superseded by this README).