Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update minimum Swift, Xcode, and platform versions #207

Merged
merged 20 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a307d86
Update minimum Swift, Xcode, and platform versions
mikenachbaur-okta Aug 12, 2024
1619320
Reintroduce support for Linux
mikenachbaur-okta Aug 13, 2024
04a17df
Update lint violations
mikenachbaur-okta Aug 15, 2024
f62a5cf
CI runner updates
mikenachbaur-okta Aug 15, 2024
56a083e
Upgrade security scan resource class to work around hanging CI jobs
mikenachbaur-okta Aug 15, 2024
e593c8e
Ensure we test multiple swift versions
mikenachbaur-okta Aug 15, 2024
55f44d2
Matrix test the Xcode unit tests across device types
mikenachbaur-okta Aug 15, 2024
40c6b96
Fix syntax error for macOS platform destionation
mikenachbaur-okta Aug 15, 2024
57897bb
Skip WebAuthenticationUI on unsupported platforms
mikenachbaur-okta Aug 15, 2024
c666e05
Fix syntax
mikenachbaur-okta Aug 15, 2024
e76f423
Introduce vision pro unit tests
mikenachbaur-okta Aug 15, 2024
6c3b368
Update matrix jobs to support downstream job generation
mikenachbaur-okta Aug 15, 2024
de18177
Fix another indentation problem
mikenachbaur-okta Aug 15, 2024
0da97c4
Fix silly yaml syntax errors
mikenachbaur-okta Aug 15, 2024
89563b0
Make Cocoapods build run in parallel
mikenachbaur-okta Aug 15, 2024
927d58a
Remap matrix job to not rely on downstreams
mikenachbaur-okta Aug 15, 2024
4345f2f
Fix another syntax error
mikenachbaur-okta Aug 15, 2024
7055703
Another attempt to skip webauth UI
mikenachbaur-okta Aug 15, 2024
e933af3
Tweak logic for skipping webauth
mikenachbaur-okta Aug 15, 2024
099e739
Fix stupid logic error
mikenachbaur-okta Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ workflows:
jobs:
- general-platform-helpers/job-semgrep-scan:
name: semgrep-scan
resource-class: medium
context:
- static-analysis

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ jobs:
zip -r ~/Build/$(basename "$archive").zip $(basename "$archive")
done
- name: Upload AuthFoundation DocC Archive
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: AuthFoundation.doccarchive.zip
path: ~/Build/AuthFoundation.doccarchive.zip
- name: Upload OktaDirectAuth DocC Archive
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: OktaDirectAuth.doccarchive.zip
path: ~/Build/OktaDirectAuth.doccarchive.zip
- name: Upload OktaOAuth2 DocC Archive
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: OktaOAuth2.doccarchive.zip
path: ~/Build/OktaOAuth2.doccarchive.zip
- name: Upload WebAuthenticationUI DocC Archive
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: WebAuthenticationUI.doccarchive.zip
path: ~/Build/WebAuthenticationUI.doccarchive.zip
95 changes: 57 additions & 38 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,22 @@ on:
- 'Tests/**/*.swift'

env:
DEVELOPER_DIR: /Applications/Xcode_15.3.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
NSUnbufferedIO: YES
iOS_DESTINATION: "platform=iOS Simulator,OS=17.4,name=iPhone 15 Pro Max"
tvOS_DESTINATION: "platform=tvOS Simulator,OS=17.4,name=Apple TV"

jobs:
SwiftBuild:
name: Swift Unit Tests
runs-on: macos-latest-large
strategy:
matrix:
os: [macos-latest-large, ubuntu-latest]
swift_version: ["5.9", "5.10"]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: swift-actions/setup-swift@v2
with:
swift-version: ${{ matrix.swift_version }}
- name: Get swift version
run: swift --version
- uses: actions/checkout@master
Expand All @@ -42,7 +47,7 @@ jobs:

Cocoapods:
name: CocoaPods Build
runs-on: macos-latest-large
runs-on: macos-latest-xlarge # Running on xlarge to use arm64 chipset
timeout-minutes: 10
needs:
- SwiftBuild
Expand All @@ -60,9 +65,29 @@ jobs:

XcodeBuild:
name: Xcode Unit Tests
runs-on: macos-latest-large
runs-on: macos-latest-xlarge
strategy:
matrix:
destination:
- "platform=iOS Simulator,OS=16.4,name=iPhone 14 Pro Max"
- "platform=iOS Simulator,OS=17.5,name=iPhone 15 Pro Max"
- "platform=tvOS Simulator,OS=17.5,name=Apple TV"
- "platform=visionOS Simulator,OS=1.2,name=Apple Vision Pro"
- "platform=watchOS Simulator,OS=10.5,name=Apple Watch Series 7 (45mm)"
- "platform=macOS,name=My Mac"
timeout-minutes: 25
steps:
- name: Set test variables
run: |
echo "DESTINATION=${{matrix.destination}}" >> "$GITHUB_ENV"

destination="${{matrix.destination}}"
if [[ $destination =~ "tvOS" ]] || [[ $destination =~ "watchOS" ]]; then
echo "SKIP_WEBAUTHENTICATIONUI=true" >> "$GITHUB_ENV"
echo "WebAuthenticationUI is unsupported on this platform"
else
echo "SKIP_WEBAUTHENTICATIONUI=false" >> "$GITHUB_ENV"
fi
- uses: actions/checkout@master
- name: Build AuthFoundation
run: |
Expand All @@ -71,61 +96,55 @@ jobs:
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme AuthFoundation \
-sdk iphonesimulator \
-destination "$iOS_DESTINATION" 2>&1
- name: Build OktaDirectAuth
run: |
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaDirectAuth \
-sdk iphonesimulator \
-destination "$iOS_DESTINATION" 2>&1
- name: Build OktaOAuth2
-destination "$DESTINATION" 2>&1
- name: Test AuthFoundation
run: |
set -o pipefail && xcodebuild build \
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaOAuth2 \
-sdk iphonesimulator \
-destination "$iOS_DESTINATION" 2>&1
- name: Build WebAuthenticationUI
-scheme AuthFoundation \
-destination "$DESTINATION" 2>&1
- name: Build OktaDirectAuth
run: |
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme WebAuthenticationUI \
-sdk iphonesimulator \
-destination "$iOS_DESTINATION" 2>&1
- name: Test AuthFoundation
-scheme OktaDirectAuth \
-destination "$DESTINATION" 2>&1
- name: Test OktaDirectAuth
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme AuthFoundation \
-sdk iphonesimulator \
-destination "$iOS_DESTINATION" 2>&1
- name: Test OktaDirectAuth
-scheme OktaDirectAuth \
-destination "$DESTINATION" 2>&1
- name: Build OktaOAuth2
run: |
set -o pipefail && xcodebuild test \
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaDirectAuth \
-sdk iphonesimulator \
-destination "$iOS_DESTINATION" 2>&1
-scheme OktaOAuth2 \
-destination "$DESTINATION" 2>&1
- name: Test OktaOAuth2
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaOAuth2 \
-sdk iphonesimulator \
-destination "$iOS_DESTINATION" 2>&1
-destination "$DESTINATION" 2>&1
- name: Build WebAuthenticationUI
if: env.SKIP_WEBAUTHENTICATIONUI != 'true'
run: |
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme WebAuthenticationUI \
-destination "$DESTINATION" 2>&1
- name: Test WebAuthenticationUI
if: env.SKIP_WEBAUTHENTICATIONUI != 'true'
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme WebAuthenticationUI \
-sdk iphonesimulator \
-destination "$iOS_DESTINATION" 2>&1
-destination "$DESTINATION" 2>&1
20 changes: 11 additions & 9 deletions OktaAuthFoundation.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ Pod::Spec.new do |s|
Provides the foundation and common features used to authenticate users, managing the lifecycle and storage of tokens and credentials, and provide a base for other Okta SDKs to build upon.
DESC
s.platforms = {
:ios => "10.0",
:tvos => "10.0",
:watchos => "7.0",
:osx => "10.12"
:ios => "12.0",
:tvos => "12.0",
:visionos => "1.0",
:watchos => "7.0",
:osx => "10.13"
}
s.ios.deployment_target = "10.0"
s.tvos.deployment_target = "10.0"
s.watchos.deployment_target = "7.0"
s.osx.deployment_target = "10.12"
s.ios.deployment_target = "12.0"
s.tvos.deployment_target = "12.0"
s.visionos.deployment_target = "1.0"
s.watchos.deployment_target = "7.0"
s.osx.deployment_target = "10.13"

s.homepage = "https://github.com/okta/okta-mobile-swift"
s.license = { :type => "APACHE2", :file => "LICENSE" }
s.authors = { "Okta Developers" => "developer@okta.com"}
s.source = { :git => "https://github.com/okta/okta-mobile-swift.git", :tag => s.version.to_s }
s.source_files = "Sources/AuthFoundation/**/*.swift"
s.resource_bundles = { "AuthFoundation" => "Sources/AuthFoundation/Resources/**/*" }
s.swift_version = "5.6"
s.swift_version = "5.9"
end
20 changes: 11 additions & 9 deletions OktaDirectAuth.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@ Pod::Spec.new do |s|
Enables application developers to build native sign in experiences using the Okta Direct Authentication API.
DESC
s.platforms = {
:ios => "10.0",
:tvos => "10.0",
:watchos => "7.0",
:osx => "10.12"
:ios => "12.0",
:tvos => "12.0",
:visionos => "1.0",
:watchos => "7.0",
:osx => "10.13"
}
s.ios.deployment_target = "10.0"
s.tvos.deployment_target = "10.0"
s.watchos.deployment_target = "7.0"
s.osx.deployment_target = "10.12"
s.ios.deployment_target = "12.0"
s.tvos.deployment_target = "12.0"
s.visionos.deployment_target = "1.0"
s.watchos.deployment_target = "7.0"
s.osx.deployment_target = "10.13"

s.homepage = "https://github.com/okta/okta-mobile-swift"
s.license = { :type => "APACHE2", :file => "LICENSE" }
s.authors = { "Okta Developers" => "developer@okta.com"}
s.source = { :git => "https://github.com/okta/okta-mobile-swift.git", :tag => s.version.to_s }
s.source_files = "Sources/OktaDirectAuth/**/*.swift"
s.resource_bundles = { "OktaDirectAuth" => "Sources/OktaDirectAuth/Resources/**/*" }
s.swift_version = "5.6"
s.swift_version = "5.9"

s.dependency "OktaAuthFoundation", "#{s.version.to_s}"
end
20 changes: 11 additions & 9 deletions OktaOAuth2.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@ Pod::Spec.new do |s|
Enables application developers to authenticate users utilizing a variety of OAuth2 authentication flows.
DESC
s.platforms = {
:ios => "10.0",
:tvos => "10.0",
:watchos => "7.0",
:osx => "10.12"
:ios => "12.0",
:tvos => "12.0",
:visionos => "1.0",
:watchos => "7.0",
:osx => "10.13"
}
s.ios.deployment_target = "10.0"
s.tvos.deployment_target = "10.0"
s.watchos.deployment_target = "7.0"
s.osx.deployment_target = "10.12"
s.ios.deployment_target = "12.0"
s.tvos.deployment_target = "12.0"
s.visionos.deployment_target = "1.0"
s.watchos.deployment_target = "7.0"
s.osx.deployment_target = "10.13"

s.homepage = "https://github.com/okta/okta-mobile-swift"
s.license = { :type => "APACHE2", :file => "LICENSE" }
s.authors = { "Okta Developers" => "developer@okta.com"}
s.source = { :git => "https://github.com/okta/okta-mobile-swift.git", :tag => s.version.to_s }
s.source_files = "Sources/OktaOAuth2/**/*.swift"
s.resource_bundles = { "OktaOAuth2" => "Sources/OktaOAuth2/Resources/**/*" }
s.swift_version = "5.6"
s.swift_version = "5.9"

s.dependency "OktaAuthFoundation", "#{s.version.to_s}"
end
12 changes: 7 additions & 5 deletions OktaWebAuthenticationUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ Pod::Spec.new do |s|
Authenticate users using web-based OIDC.
DESC
s.platforms = {
:ios => "10.0",
:osx => "10.12"
:ios => "12.0",
:visionos => "1.0",
:osx => "10.13"
}
s.ios.deployment_target = "10.0"
s.osx.deployment_target = "10.12"
s.ios.deployment_target = "12.0"
s.visionos.deployment_target = "1.0"
s.osx.deployment_target = "10.13"

s.homepage = "https://github.com/okta/okta-mobile-swift"
s.license = { :type => "APACHE2", :file => "LICENSE" }
s.authors = { "Okta Developers" => "developer@okta.com"}
s.source = { :git => "https://github.com/okta/okta-mobile-swift.git", :tag => s.version.to_s }
s.source_files = "Sources/WebAuthenticationUI/**/*.swift"
s.resource_bundles = { "WebAuthenticationUI" => "Sources/WebAuthenticationUI/Resources/**/*" }
s.swift_version = "5.6"
s.swift_version = "5.9"

s.dependency "OktaAuthFoundation", "#{s.version.to_s}"
s.dependency "OktaOAuth2", "#{s.version.to_s}"
Expand Down
9 changes: 5 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.6
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -7,10 +7,11 @@ var package = Package(
name: "AuthFoundation",
defaultLocalization: "en",
platforms: [
.iOS(.v10),
.tvOS(.v10),
.iOS(.v12),
.tvOS(.v12),
.watchOS(.v7),
.macOS(.v10_12),
.visionOS(.v1),
.macOS(.v10_15),
.macCatalyst(.v13)
],
products: [
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,14 @@ Only the last 4 major platform versions are officially supported, unless there a

| Platform | Supported | Best-Effort |
| ----------- | --------- | ----------- |
| iOS | 12.0 | 10.0 |
| tvOS | 12.0 | 10.0 |
| watchOS | 8.0 | 7.0 |
| iOS | 13.0 | 12.0 |
| tvOS | 13.0 | 12.0 |
| watchOS | 7.0 | 7.0 |
| visionOS | 1.0 | 1.0 |
| macCatalyst | 13.0 | 13.0 |
| macOS | 12.0 | 10.12 |
| macOS | 12.0 | 10.15 |

Once a platform version becomes unsupported, dropping support for it will not be considered a breaking change and will be done in a minor release. For example, iOS 12 will cease to be supported when iOS 16 gets released, and might be dropped in a minor release.
Once a platform version becomes unsupported, dropping support for it will not be considered a breaking change and will be done in a minor release. For example, iOS 13 will cease to be supported when iOS 18 gets released, and might be dropped in a minor release.

In the case of macOS, the yearly named releases are considered a major platform version for this Policy, regardless of the actual version numbers.

Expand Down Expand Up @@ -431,7 +432,7 @@ Alternatively, if you wish to run tests within Linux, you can utilize Docker fro

```bash
docker run --rm --privileged --interactive --tty \
--volume "$(pwd):/src" --workdir "/src" swift:5.6.1 \
--volume "$(pwd):/src" --workdir "/src" swift:latest \
swift test
```

Expand Down
2 changes: 1 addition & 1 deletion Sources/AuthFoundation/JWT/Enums/JWTClaim.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public extension HasClaims where ClaimType == JWTClaim {
/// The person's preferred username.
var preferredUsername: String? { self[.preferredUsername] }

#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
/// The person's name components, pre-assigned to a PersonNameComponents object.
///
/// This property can be used as a convenience to generate a string representation of the user's name, based on the user's current locale.
Expand Down
1 change: 0 additions & 1 deletion Sources/AuthFoundation/JWT/Internal/JWK+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Foundation
import CommonCrypto

extension JWK.Algorithm {
@available(iOS 10.0, macCatalyst 13.0, tvOS 10.0, watchOS 3.0, macOS 10.12, *)
var secKeyAlgorithm: SecKeyAlgorithm? {
switch self {
case .rs256:
Expand Down
2 changes: 1 addition & 1 deletion Sources/AuthFoundation/JWT/JWK+Verification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extension JWK {
nil)
}

#if os(iOS) || os(tvOS) || os(watchOS)
#if os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
if #available(iOS 2.0, macCatalyst 13.0, tvOS 9.0, watchOS 2.0, *) {
guard let padding = algorithm.secPadding,
let digest = algorithm.digest(data: data)
Expand Down
Loading