This repository has been archived on 2026-10-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Paul Hitt b88d638085 The wire layer, recovery codes, share links, and a command-line client
Everything between the engine and an app: server discovery, the account
service, the file API, and a session that ties them together.

Recovery codes and share links move into the engine, and both agree with
the browser character for character — the vectors file now carries codes
generated by the JavaScript implementation, including one containing a Q,
because folding Q is the mistake that once corrupted a third of all codes.

`filesctl` exists so the cryptography can be exercised without an app, a
simulator, or a person tapping. `smoke` registers, signs in fresh so the
stored record has to actually open, uploads across four chunks, reads the
name back, compares bytes, and checks a password-protected link is refused
without its password. Verified against the Android engine as well: one
uploads, the other downloads, and the digests match.

Registration now sends the identity with the account rather than after it,
and a session with no identity for this product enrols one instead of
refusing — which is what an account created before Files existed needs.

MIT, matching the server. CI runs the suite on a Linux Swift image, which
is the point of keeping the crypto in a package rather than in app code.
2026-08-21 18:17:26 -04:00

30 lines
1.2 KiB
Swift

// swift-tools-version:6.0
import PackageDescription
let package = Package(
name: "FlamenetFiles",
platforms: [.iOS(.v16), .macOS(.v13)],
products: [
.library(name: "FilesEngine", targets: ["FilesEngine"]),
.library(name: "FilesClient", targets: ["FilesClient"]),
],
targets: [
// The engine is a package rather than app code so it can be tested with
// `swift test` on the command line. Requiring Xcode to run the crypto
// tests would mean they get run rarely.
.target(name: "FilesEngine"),
// The wire layer, kept out of the app target for the same reason: it
// can be exercised from the command line against a real server.
.target(name: "FilesClient", dependencies: ["FilesEngine"]),
// Not shipped in the app. It exercises the engine and the wire layer
// against a real server from the command line, which is the only way
// these paths get tested often enough to matter.
.executableTarget(name: "filesctl", dependencies: ["FilesEngine", "FilesClient"]),
.testTarget(
name: "FilesEngineTests",
dependencies: ["FilesEngine"],
resources: [.copy("vectors")]
),
]
)