Skip to content

Tech stack

The engine, cache, auth, and sync logic live in the OfemKit Swift Package (Packages/OfemKit/), linked into both the macOS .app host and the File Provider Extension.

OfemKit modules

Authentication

  • MSAL for Apple Platforms (MSAL Swift SDK) — public client app, interactive browser flow, silent refresh, Keychain-backed token cache. Per-account PublicClientApplication instances, one authority per tenant for clean cache scoping.

HTTP & OneLake

  • Alamofire Session over URLSession for OneLake DFS and Fabric REST calls, pooled per (alias, scope) (Packages/OfemKit/Sources/OfemKit/HTTP/SessionPool.swift):
  • Token injection via AuthenticationInterceptor / OfemAuthenticator.
  • RetryAfterRetrier (honors Retry-After, but only on 429 / 503, bounded to maxRetries = 5 and maxDelay = 30s) ahead of JitteredRetryPolicy (a RetryPolicy subclass adding full jitter to the exponential backoff Alamofire would otherwise compute deterministically) in the interceptor chain. Other 5xx statuses (500/502/504) never have Retry-After read — they fall through to JitteredRetryPolicy's jittered backoff alone. Both retriers share request.retryCount / RetryAfterRetrier.maxRetries as the single source of truth for the combined retry budget, so a 429 that keeps re-triggering Retry-After cannot retry indefinitely.
  • Per-host connection cap, scoped per audience: 16 for OneLake DFS, 8 for Fabric REST.

Config & data

  • TOML for config files (Packages/OfemKit/Sources/OfemKit/Config/).
  • SQLite (Swift wrapper) for the local file metadata cache (paths, ETags, mtimes, sync state).

Logging

  • os.log (unified logging) — integrates with Console.app out of the box. Structured log entries with privacy annotations.

Telemetry

  • Custom App Insights client over URLSession — opt-out, anonymous, tenant IDs only (no UPN / workspace names / file paths). See docs/telemetry.md.

IPC (host app ↔ FPE)

  • NSFileProviderService + NSXPCConnection — the standard Apple XPC channel between the host app and the File Provider Extension.

Swift libraries

Host app (OneLake/)

  • SwiftUI (macOS 14+ baseline) for the account-management UI and Settings.
  • ServiceManagement (SMAppService.mainApp) for the "Open at Login" login-item registration.

File Provider Extension (OneLakeFileProvider/)

  • Apple's FileProvider framework.
  • NSFileProviderReplicatedExtension for on-demand (placeholder) sync.
  • NSFileProviderServicing to expose the XPC control service to the host app.

Shared (Shared/)

  • OfemClientControlProtocol — the @objc XPC protocol shared between host and FPE.
  • OfemControlInterface — single factory building the NSXPCInterface for that protocol (including its secure-coding class registrations), so both sides always wire the exact same interface.
  • OfemConfigKey — canonical String-backed enum of setConfig dotted keys; the FPE's setConfig switches exhaustively over it (no default: arm), so a key added here without a matching FPE arm fails to compile.
  • OfemDomainIdentifier — composes/decomposes the ofem.<alias> File Provider domain identifier string.
  • XPCAccountInfo, XPCEngineStatus, XPCPausedWorkspaceNSSecureCoding wrappers for XPC transport.

Swift language versions

All targets build in Swift 6 language mode:

  • OfemKit (Packages/OfemKit/) — swift-tools-version: 6.0 in the package manifest. The CI OfemKit package tests job runs swift test directly against the package.
  • Host app (OneLake/) and File Provider Extension (OneLakeFileProvider/) — SWIFT_VERSION = "6.0" in project.yml.

TOMLKit 0.6.0 compiles cleanly under Swift 6 / Xcode 16.4 with no errors. The Shared/ XPC payload types (XPCEngineStatus, XPCAccountInfo, XPCPausedWorkspace) and XPC service types conform to @unchecked Sendable with justification comments; all other cross-boundary types are value types or already Sendable-conformant.

Build & release

  • xcodebuild builds the Swift .app and .appex from OneLake.xcodeproj (generated by XcodeGen from project.yml).
  • codesign --force --options runtime --sign "Developer ID Application: …" seals the bundle.
  • xcrun notarytool submit … --wait and xcrun stapler staple.
  • DMG via create-dmg (Homebrew formula create-dmg).
  • The release workflow uploads the DMG to GitHub Releases and pushes the rendered cask to the homebrew-ofem tap repo.

See docs/packaging-homebrew.md for the full pipeline.

Repository layout

onelake-explorer-macos/
├── OneLake.xcodeproj            # generated by XcodeGen from project.yml
├── project.yml                  # XcodeGen spec
├── OneLake/                     # host app (Swift)
├── OneLakeFileProvider/         # File Provider Extension (Swift)
├── Shared/                      # XPC protocol + types shared by both targets
├── Packages/
│   └── OfemKit/                 # local Swift Package: engine, auth, cache, sync
├── docs/
├── homebrew/
│   └── Casks/ofem.rb.tmpl       # cask template, rendered by the release workflow
├── .github/
├── LICENSE
├── README.md
├── CONTRIBUTING.md
├── SECURITY.md
├── CODE_OF_CONDUCT.md
└── CLAUDE.md