24 Commits
Author SHA1 Message Date
Gustavo Medori 6d906dc57b Migrating PR from gravitational/teleport repo (#232)
Export-Source-Commit: ead22275e58458e55a2316e849ff5fed138eea27
2026-08-25 11:35:10 -05:00
Maja Cieślak a93db5895b Add missing license header (#69648) 2026-08-13 20:51:11 +00:00
Gustavo Medori 8ff3d34581 iOS: Logging Part 1 – Infrastructure (#69394)
* Add LogBackends module

* Add basic demonstration of simple log handler

* Dial in formatting of the ConsoleLogHandler

* Naively update loggers from OSLog to swift-log

* Update log statements to use structured metadata

* Update complex types to expose log metadata instead of debug descriptions

* Add comment explaining why we evaluate originTimestamp in ConsoleLogHandler's init

* Move Logger.Level formatting into its own file

* Update formatting in VerifyApp.swift

* Update timestamp formatting for ConsoleLogHandler
2026-08-13 17:18:21 +00:00
Gustavo Medori adfaab0cec iOS: Add SystemClients library to retrieve device metadata (#69341)
* Add TeleportKit package

* Add TeleportKit as a package dependency

* Update Package.swift to set swift settings all at once at the end

* Add new SystemClients module to TeleportKit

* Move the SerialNumberClient into SystemClients

* Collect device data inside of EnrollClient.swift

* Remove TeleportKit target
2026-08-13 16:58:38 +00:00
Gustavo Medori 67a3854c83 Add production path for serial number retrieval (#69156) 2026-08-03 21:52:25 +00:00
Gustavo Medori c4ec12dd59 iOS: Debug Serial Number (#69017)
* Move SQLite files into a SQLite subfolder

* Add a debug-only user defaults store

* Add a client for retrieving the device serial number

In debug builds, the serial number is not available (because it's only available through MDM managed configs) so we fake it by reaching into the debug user defaults and storing something there.

* Add a debug settings view

This is where we can noodle/iterate on settings that only affect debug build behaviors.

* Resolve some Xcode 27 warnings

* Remove code signing from intermediate build products, deferring them to the final build

* Update FakeSerialNumberGenerator doc comment (and change it to an enum)
2026-08-03 18:19:32 +00:00
Gustavo Medori a1b7a53be0 iOS: Device Trust credential storage (#68777)
* Initial secure storage implementation

* Added base infrastructure for Device Trust Credential Demo

* Add the concept of a "location" for storing device trust credentials (2 options, "app" or "demo")

* Add view + view model that demos the lifecycle of the device trust credential

* Improve the names of various device trust operations to better reflect their actual purpose

* Improve the user-facing copy of the secure enclave demo

* Improve doc comment of `.emptyChallenge` error
2026-07-29 17:25:04 +00:00
Gustavo Medori 9afb63eeef iOS: Add plumbing for new DebugView (#68648)
* Add a new SheetPresentable protocol codifying the need for an ID for presentation purposes

* Update existing presentationID in EnrollCameraScannerViewModel.swift to be conformant to SheetPresentable

* Add new empty Debugging feature

* Wire up DebugView to new button in `LandingView.toolbar`

* Fix typo
2026-07-28 16:13:43 +00:00
Gustavo Medori a143283dd3 iOS: Add "Delete all clusters" button (#68599)
* Add SwiftUI preview-specific database with stub data

* Wire together LandingView and the new preview database to show post-enrollment previews

* Add menu item for deleting all clusters, and all the associated infrastructure that went with it.

This includes a new alert for confirming deletion and a helper for deleting clusters and managing failure

* Move app tint color into Assets.xcassets

This is required because tinting at the root level has the unintended side effect of tinting things like menu icons. Using the AccentColor asset catalog item works well here, leaving semantic colors intact. The downside is that it's a duplicate of the `teleport` color inside of Color.xcassets, but a little duplication is ok for the behavior we're getting.

* Update casing of "Delete All Clusters" button

* Update wording around the delete all clusters button
2026-07-20 22:57:00 +00:00
Gustavo Medori c97d82c0b9 iOS: Post-enrollment Landing View (#68517)
* Refactor LandingView into two separate paths, for enrolled vs unenrolled devices

* Move Enrollment under Features/

* Update sequencing of VerifyAppModel initialization

* Simulate enrollment of a new cluster

* Add array helper for accessing via index sets

* Add some convenience functions to Cluster.swift

* Add behavior to PostEnrollmentLandingView, including adopting AlertState for alert presentation

This also dials in the visual treatment slightly. More to come.

* Update LandingView to share more chrome between pre- and post- enrollment views

* Update Cluster.url to be constructed using URLComponents

* Add some doc comments to the landing view types

* Replace ... with … in error message (multiple chars vs single unicode char)

* Set default port in deep link construction
2026-07-16 17:23:29 +00:00
Gustavo Medori de26054320 iOS: Add persistence via GRDB (#68471)
* Add GRDB and SQLiteData as dependencies

* Whitelist "db" as an allowed two-letter identifier in .swiftlint.yml

* Remove MainActor-by-default isolation

* Add initial database setup

This setup includes the infrastructure to initialize the database, plus
an initial migration that creates the database's first table.

* Tweak some more swiftlint settings that were getting in the way

* Add Cluster.swift and update some variables/linting

* Add the ability to reset the database with a command line argument

* Update schema of the cluster table to have a unique constraint on host+port

* Add missing port to Cluster model

* Change working "function" -> "property"

* Update sql tracing to use a command line argument instead of an env variable (and add an associated scheme)

* Update AppDatabase.makeLiveDatabase to fallback to an in-memory database if initialization fails

* Remove try from AppDatabase initialization

* Apply missing migration to in-memory database

* Fix release build failure
2026-07-14 21:08:53 +00:00
Gustavo Medori 459f93513d Update bundle ID (#68554) 2026-07-13 19:24:32 +00:00
Gustavo Medori f1f552b7fc iOS: Make an event timeline view to communicate longrunning processes (#68355)
* Add initial sketch of EventStackView

* Improve size scaling and accessibilty of EventStackView

* Branch the event management of EventStackView into its own view model

* Polish the layout of EventStackView and include a demo in EnrollDeviceViewModel

* Fix typo
2026-07-06 22:16:23 +00:00
Gustavo Medori ab6da07259 iOS: Add color design tokens (#68317)
* Add Color assets

* Update Icon.swift and LandingView.swift to use the new color tokens

* Add non-default foreground colors

* Remove unused primaryBackgroundPressed color

* Update LandingView to use new foreground color tokens

* Update EnrollDeviceView to use new color tokens
2026-07-06 21:09:29 +00:00
Gustavo Medori 32bbec3c73 iOS: Revise EnrollDeviceView (#68225)
* Rename LandingViewModel's deviceEnrollment destination to enrollDevice

This naming matches the destination view's name

* Add EnrollDeviceView preview

* Add Icon.swift

* Add a PrimaryButtonStyle that looks correct in both light and dark mode

* Update LandingView to use the new Icon type

* Restructure EnrollDeviceView to support large dynamic type sizes

* Refactor EnrollDeviceView for overall structure/readability

* Rename EnrollDeviceViewModel.attempt -> loadingState

* Commit Verify.xcscheme (which for some reason wasn't already present)

* Incorporate Dependencies into EnrollDeviceViewModel
2026-07-02 20:24:35 +00:00
Gustavo Medori f08b36fbac iOS: QR Code Scanner (#68181)
* Add initial implementation of QRScannerView

* Wire up QRScannerView to navigate to device enrollment

* Consolidate validateScan and onScan API calls

* Add handling for various camera permission states
2026-07-02 15:43:12 +00:00
Gustavo Medori 2cf918b555 iOS: Landing View (#68067)
* Add Icon.swift file as a resuable icon in a rounded rect

* Spruce up the UI for the landing page

* Improve code organization and indentation in LandingView.swift

* Remove stray space in LandingView copy

* Remove Icon.swift since we didn't end up using it

* Address comment/copy PR comments
2026-07-01 17:13:57 +00:00
Gustavo Medori 15c29cf57f iOS: Add Test Target (#68062)
* Add VerifyTests target with an initial deep link test

* Add more comprehensive tests for the DeepLink initializer
2026-06-30 17:30:30 +00:00
Gustavo Medori 827a04ffcd iOS: Implement RFD Architecture (#68026)
* Move VerifyApp to App Lifecycle folder and add some architecture documentation to it

* Add VerifyAppModel.swift

* Tuck existing files into their own subfolders

* Add SwiftUINavigation as a dependency to support Destination-style navigation

(More on Destination-style navigation in a future commit)

* Add convenient logger initializers

* Move openDeepLink up to VerifyApp

* Move LandingView into the App Lifecycle folder

* Wire up parsing failures to new alert destination

* Swift-ify DeepLink parsing

* Rename Atempt -> LoadingState

* Update LandingView to navigate correctly to EnrollMobileDeviceView

* Rename EnrollMobileDeviceView -> EnrollDeviceView to make it more concise

* Improve names of LandingViewModel.Destination

* Add delegate relationship between LandingViewModel and EnrollDeviceViewModel to support the cancellation button

Since this view is now in a navigation stack, we might actually do away
with the cancel button entirely because you can just tap the back button
to do the same thing.

* Remove ContentView since it's no longer used

* Further break apart DeepLink.swift

* Remove stray reference to ContentView

* Add URL to debug log in VerifyAppModel
2026-06-26 20:54:34 +00:00
Gustavo Medori 7553f927f7 iOS: Core Framework (#67939)
* Add Core framework with initial EnrollClient implementation

* Adopt EnrollClient in EnrollMobileDeviceViewModel

* Update Package.resolved

* Format EnrollClient.swift
2026-06-25 22:09:54 +00:00
Gustavo Medori 90299cb6a5 iOS: Add linting and formatting utilities (#67897)
* Add initial .swiftformat file with sensible defaults

* Apply swiftformat formatting to all code

* Remove file creation header from VerifyApp.swift

* Move .swiftformat to be near the Xcode project, closer to other iOS-specific configs

* Add .swiftlint configuration with a couple common sense rules and some funky TODO regular expressions

* Apply swiftlint rules and add it as a build plugin

* Remove swiftformat as a package dependency, using the CLI instead

* Remove custom TODO lint rules

* Update .swiftformat rules
2026-06-18 20:53:44 +00:00
Gustavo Medori 83e07c510a iOS: Build Enroll.xcframework using gomobile as part of the Xcode build (#67635)
* Embedded Enroll.xcframework building into the main Xcode build

* Remove xcframework generation from Makefile

Now that Enroll.xcframework is built as part of the Xcode build, we no
longer need to maintain a separate step to build it manually.

* Add a README file with basic instructions on how to integrate Swift with Go packages

* Disable user script sandboxing

This ensures that our build scripts can read/write whatever files
necessary. In particular, this avoids issues when building xcframeworks
with `gomobile` that may touch files not declared in your file inputs.

* Fix typo in build-enroll-framework.sh

* Update build-enroll-framework.sh to call `gomobile` via `go tool`

* Resolve shellcheck lint failure SC2155
2026-06-17 17:30:13 +00:00
Gustavo Medori 9691b677d4 iOS: Update Xcode settings and add OSS file header (#67632)
* Add OSS preamble to file header template

* Apply automatic project file changes from using Xcode 26.5

* Update Verify project files to generate symbols for string catalog entries

* Improve formatting of template file header to reduce extra whitespace

* Update file header to automatically use the current year
2026-06-16 19:52:17 +00:00
Maja Cieślak 813776fd7a Add Xcode project for Teleport Verify; add gomobile as tool dep (#67750)
* Generate Xcode project for Verify

* Set Swift version to 6; remove macOS and Vision as destinations

* Handle `teleport://` links and add enrollment screen

* Avoid building macOS-specific stuff on iOS

This is needed for gomobile to build our stuff from lib/mobile from the
next commit.

* Add `lib/mobile/verify/enroll` compiled with gomobile

* `lib/mobile`: Temporarily use private Device Trust service

The public gRPC service exists on the demo branch but not on this
branch. In order to make it possible to compile
`lib/mobile/verify/enroll`, temporarily use the private service which
has similar RPCs.

* Run `make go-mod-tidy-all`

* Make Swift app connect to public DT service on "Request Now" tap

* mobile: Add sheet for enroll request status

* Revert go.mod changes

This reverts commit b9af7a7614 and
2c00ecd7fa.

* Add `build.assets/tools/gomobile`

* Move gomobile back to main go.mod

This reverts commits 9b2a6c4ea3 and
a83c2959fa.
2026-06-16 17:29:26 +00:00