Skip to content

Commit c583270

Browse files
committed
Merge branch 'main' into replace-HTTPRequest
# Conflicts: # Sources/Auth/AuthError.swift # Sources/Auth/Internal/APIClient.swift # Sources/Auth/Internal/Contants.swift # Sources/Auth/Internal/SessionManager.swift # Sources/Helpers/URLSession+AsyncAwait.swift # Sources/Helpers/Version.swift # Sources/Storage/MultipartFormData.swift # Sources/Storage/StorageFileApi.swift # Tests/AuthTests/SessionManagerTests.swift # Tests/IntegrationTests/StorageFileIntegrationTests.swift # Tests/StorageTests/SupabaseStorageTests.swift
2 parents 8a624e0 + 8f5b94f commit c583270

File tree

62 files changed

+1249
-762
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1249
-762
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77
pull_request:
88
branches:
9-
- '*'
9+
- "*"
1010
workflow_dispatch:
1111

1212
concurrency:
@@ -19,9 +19,13 @@ jobs:
1919
runs-on: macos-14
2020
strategy:
2121
matrix:
22-
command: [test, '']
23-
platform: [iOS, macOS, tvOS, watchOS, visionOS, macCatalyst]
24-
xcode: [15.4, '16.0']
22+
command: [test, ""]
23+
platform: [IOS, MAC_CATALYST, MACOS, TVOS, VISIONOS, WATCHOS]
24+
xcode: [15.4, "16.0"]
25+
exclude:
26+
- { platform: VISIONOS }
27+
include:
28+
- { command: test, skip_release: 1 }
2529
steps:
2630
- uses: actions/checkout@v4
2731
- name: Select Xcode ${{ matrix.xcode }}
@@ -35,15 +39,16 @@ jobs:
3539
deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift') }}
3640
restore-keys: |
3741
deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-
38-
- name: Set IgnoreFileSystemDeviceInodeChanges flag
42+
- name: Set IgnoreFileSystemDeviceInodeChanges flag
3943
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
40-
- name: Update mtime for incremental builds
44+
- name: Update mtime for incremental builds
4145
uses: chetan/git-restore-mtime-action@v2
46+
- run: make dot-env
4247
- name: Debug
43-
run: make COMMAND="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild
48+
run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild
4449
- name: Release
4550
if: matrix.skip_release != '1'
46-
run: make COMMAND="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild
51+
run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild
4752

4853
linux:
4954
name: linux
@@ -69,7 +74,6 @@ jobs:
6974
- name: Run tests
7075
run: swift test --skip IntegrationTests
7176

72-
7377
# library-evolution:
7478
# name: Library (evolution)
7579
# runs-on: macos-14
@@ -100,9 +104,8 @@ jobs:
100104
- name: Update mtime for incremental builds
101105
uses: chetan/git-restore-mtime-action@v2
102106
- name: Examples
103-
run: make SCHEME="Examples" build-example
107+
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="Examples" XCODEBUILD_ARGUMENT=build xcodebuild
104108
- name: SlackClone
105-
run: make SCHEME="SlackClone" build-example
109+
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="SlackClone" XCODEBUILD_ARGUMENT=build xcodebuild
106110
- name: UserManagement
107-
run: make SCHEME="UserManagement" build-example
108-
111+
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="UserManagement" XCODEBUILD_ARGUMENT=build xcodebuild

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.20.1"
2+
".": "2.20.4"
33
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"Supabase",
99
"whitespaces",
1010
"xctest"
11-
]
11+
],
12+
"makefile.configureOnOpen": false
1213
}

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Changelog
22

3+
## [2.20.4](https://github.com/supabase/supabase-swift/compare/v2.20.3...v2.20.4) (2024-10-23)
4+
5+
6+
### Bug Fixes
7+
8+
* **storage:** cache control ([#551](https://github.com/supabase/supabase-swift/issues/551)) ([8a2b196](https://github.com/supabase/supabase-swift/commit/8a2b19690cf165c80454ff6388cb9a202b04172c))
9+
10+
## [2.20.3](https://github.com/supabase/supabase-swift/compare/v2.20.2...v2.20.3) (2024-10-22)
11+
12+
13+
### Bug Fixes
14+
15+
* remove kSecUseDataProtectionKeychain ([#574](https://github.com/supabase/supabase-swift/issues/574)) ([554f916](https://github.com/supabase/supabase-swift/commit/554f91689eb13c1a923a53bddb5d194e6b80328a))
16+
17+
## [2.20.2](https://github.com/supabase/supabase-swift/compare/v2.20.1...v2.20.2) (2024-10-17)
18+
19+
20+
### Bug Fixes
21+
22+
* general auth improvements ([#561](https://github.com/supabase/supabase-swift/issues/561)) ([5f4c0f2](https://github.com/supabase/supabase-swift/commit/5f4c0f256c74beb47ce2a42951014504ba798dd6))
23+
* replace to HTTPTypes Components from Helpers Components ([#564](https://github.com/supabase/supabase-swift/issues/564)) ([71dee2a](https://github.com/supabase/supabase-swift/commit/71dee2ac35204c40e11d7aa3c3c6f5def95520f9))
24+
* Swift 6 now has URLSession async method ([#565](https://github.com/supabase/supabase-swift/issues/565)) ([5786dd6](https://github.com/supabase/supabase-swift/commit/5786dd6c06ceead5851fb6527a48d0cee48654af))
25+
326
## [2.20.1](https://github.com/supabase/supabase-swift/compare/v2.20.0...v2.20.1) (2024-10-09)
427

528

Examples/Examples.xcodeproj/project.pbxproj

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
794C61D62BAD1E12000E6B0F /* UserIdentityList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794C61D52BAD1E12000E6B0F /* UserIdentityList.swift */; };
2121
794EF1222955F26A008C9526 /* AddTodoListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794EF1212955F26A008C9526 /* AddTodoListView.swift */; };
2222
794EF1242955F3DE008C9526 /* TodoListRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794EF1232955F3DE008C9526 /* TodoListRow.swift */; };
23-
7956405E2954ADE00088A06F /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7956405D2954ADE00088A06F /* Secrets.swift */; };
23+
7956405E2954ADE00088A06F /* SupabaseConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7956405D2954ADE00088A06F /* SupabaseConfig.swift */; };
2424
795640602954AE140088A06F /* AuthController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7956405F2954AE140088A06F /* AuthController.swift */; };
2525
795640622955AD2B0088A06F /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 795640612955AD2B0088A06F /* HomeView.swift */; };
2626
795640662955AE9C0088A06F /* TodoListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 795640652955AE9C0088A06F /* TodoListView.swift */; };
@@ -75,6 +75,7 @@
7575
79FEFFC52B078D7900D36347 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FEFFC42B078D7900D36347 /* Models.swift */; };
7676
79FEFFC72B078FB000D36347 /* SwiftUIHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FEFFC62B078FB000D36347 /* SwiftUIHelpers.swift */; };
7777
79FEFFC92B0797F600D36347 /* AvatarImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FEFFC82B0797F600D36347 /* AvatarImage.swift */; };
78+
79FFA5B32CC04F8B00F8A807 /* Supabase.plist in Resources */ = {isa = PBXBuildFile; fileRef = 79FFA5B22CC04F8B00F8A807 /* Supabase.plist */; };
7879
/* End PBXBuildFile section */
7980

8081
/* Begin PBXFileReference section */
@@ -93,7 +94,7 @@
9394
794C61D52BAD1E12000E6B0F /* UserIdentityList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIdentityList.swift; sourceTree = "<group>"; };
9495
794EF1212955F26A008C9526 /* AddTodoListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTodoListView.swift; sourceTree = "<group>"; };
9596
794EF1232955F3DE008C9526 /* TodoListRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodoListRow.swift; sourceTree = "<group>"; };
96-
7956405D2954ADE00088A06F /* Secrets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Secrets.swift; sourceTree = "<group>"; };
97+
7956405D2954ADE00088A06F /* SupabaseConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupabaseConfig.swift; sourceTree = "<group>"; };
9798
7956405F2954AE140088A06F /* AuthController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthController.swift; sourceTree = "<group>"; };
9899
795640612955AD2B0088A06F /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
99100
795640652955AE9C0088A06F /* TodoListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodoListView.swift; sourceTree = "<group>"; };
@@ -146,6 +147,7 @@
146147
79FEFFC42B078D7900D36347 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = "<group>"; };
147148
79FEFFC62B078FB000D36347 /* SwiftUIHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIHelpers.swift; sourceTree = "<group>"; };
148149
79FEFFC82B0797F600D36347 /* AvatarImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvatarImage.swift; sourceTree = "<group>"; };
150+
79FFA5B22CC04F8B00F8A807 /* Supabase.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Supabase.plist; sourceTree = "<group>"; };
149151
/* End PBXFileReference section */
150152

151153
/* Begin PBXFrameworksBuildPhase section */
@@ -215,7 +217,7 @@
215217
793895C92954ABFF0044F2B8 /* ExamplesApp.swift */,
216218
793895D02954AC000044F2B8 /* Preview Content */,
217219
793895CB2954ABFF0044F2B8 /* RootView.swift */,
218-
7956405D2954ADE00088A06F /* Secrets.swift */,
220+
7956405D2954ADE00088A06F /* SupabaseConfig.swift */,
219221
795640612955AD2B0088A06F /* HomeView.swift */,
220222
795640652955AE9C0088A06F /* TodoListView.swift */,
221223
795640672955AEB30088A06F /* Models.swift */,
@@ -230,6 +232,7 @@
230232
797EFB672BABD90500098D6B /* Stringfy.swift */,
231233
79B1C80D2BAC017C00D991AA /* AnyJSONView.swift */,
232234
79401F342BC708C8004C9C0F /* UIViewControllerWrapper.swift */,
235+
79FFA5B22CC04F8B00F8A807 /* Supabase.plist */,
233236
);
234237
path = Examples;
235238
sourceTree = "<group>";
@@ -465,6 +468,7 @@
465468
isa = PBXResourcesBuildPhase;
466469
buildActionMask = 2147483647;
467470
files = (
471+
79FFA5B32CC04F8B00F8A807 /* Supabase.plist in Resources */,
468472
793895D22954AC000044F2B8 /* Preview Assets.xcassets in Resources */,
469473
793895CE2954AC000044F2B8 /* Assets.xcassets in Resources */,
470474
);
@@ -514,7 +518,7 @@
514518
79E2B55C2B97A2310042CD21 /* UIApplicationExtensions.swift in Sources */,
515519
794EF1222955F26A008C9526 /* AddTodoListView.swift in Sources */,
516520
7928145D2CAB2CE2000B4ADB /* ResetPasswordView.swift in Sources */,
517-
7956405E2954ADE00088A06F /* Secrets.swift in Sources */,
521+
7956405E2954ADE00088A06F /* SupabaseConfig.swift in Sources */,
518522
795640682955AEB30088A06F /* Models.swift in Sources */,
519523
79B1C80C2BABFF8000D991AA /* ProfileView.swift in Sources */,
520524
795640662955AE9C0088A06F /* TodoListView.swift in Sources */,
@@ -723,7 +727,13 @@
723727
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
724728
PRODUCT_BUNDLE_IDENTIFIER = "com.supabase.swift-examples";
725729
PRODUCT_NAME = "$(TARGET_NAME)";
730+
REGISTER_APP_GROUPS = NO;
731+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
732+
SUPPORTS_MACCATALYST = NO;
733+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
734+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
726735
SWIFT_EMIT_LOC_STRINGS = YES;
736+
TARGETED_DEVICE_FAMILY = 1;
727737
};
728738
name = Debug;
729739
};
@@ -743,7 +753,13 @@
743753
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
744754
PRODUCT_BUNDLE_IDENTIFIER = "com.supabase.swift-examples";
745755
PRODUCT_NAME = "$(TARGET_NAME)";
756+
REGISTER_APP_GROUPS = NO;
757+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
758+
SUPPORTS_MACCATALYST = NO;
759+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
760+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
746761
SWIFT_EMIT_LOC_STRINGS = YES;
762+
TARGETED_DEVICE_FAMILY = 1;
747763
};
748764
name = Release;
749765
};

Examples/Examples/Auth/AuthView.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ struct AuthView: View {
1414
case signInWithPhone
1515
case signInWithApple
1616
case signInWithOAuth
17-
case signInWithOAuthUsingUIKit
17+
#if canImport(UIKit)
18+
case signInWithOAuthUsingUIKit
19+
#endif
1820
case googleSignInSDKFlow
1921
case signInAnonymously
2022

@@ -25,7 +27,9 @@ struct AuthView: View {
2527
case .signInWithPhone: "Sign in with Phone"
2628
case .signInWithApple: "Sign in with Apple"
2729
case .signInWithOAuth: "Sign in with OAuth flow"
28-
case .signInWithOAuthUsingUIKit: "Sign in with OAuth flow (UIKit)"
30+
#if canImport(UIKit)
31+
case .signInWithOAuthUsingUIKit: "Sign in with OAuth flow (UIKit)"
32+
#endif
2933
case .googleSignInSDKFlow: "Google Sign in (GIDSignIn SDK Flow)"
3034
case .signInAnonymously: "Sign in Anonymously"
3135
}
@@ -43,7 +47,9 @@ struct AuthView: View {
4347
options
4448
.navigationTitle(options.title)
4549
}
50+
#if !os(macOS)
4651
.navigationBarTitleDisplayMode(.inline)
52+
#endif
4753
}
4854
}
4955
}
@@ -56,8 +62,10 @@ extension AuthView.Option: View {
5662
case .signInWithPhone: SignInWithPhone()
5763
case .signInWithApple: SignInWithApple()
5864
case .signInWithOAuth: SignInWithOAuth()
59-
case .signInWithOAuthUsingUIKit: UIViewControllerWrapper(SignInWithOAuthViewController())
60-
.edgesIgnoringSafeArea(.all)
65+
#if canImport(UIKit)
66+
case .signInWithOAuthUsingUIKit: UIViewControllerWrapper(SignInWithOAuthViewController())
67+
.edgesIgnoringSafeArea(.all)
68+
#endif
6169
case .googleSignInSDKFlow: GoogleSignInSDKFlow()
6270
case .signInAnonymously: SignInAnonymously()
6371
}

Examples/Examples/Auth/AuthWithEmailAndPassword.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,19 @@ struct AuthWithEmailAndPassword: View {
2929
Form {
3030
Section {
3131
TextField("Email", text: $email)
32-
.keyboardType(.emailAddress)
3332
.textContentType(.emailAddress)
3433
.autocorrectionDisabled()
34+
#if !os(macOS)
35+
.keyboardType(.emailAddress)
3536
.textInputAutocapitalization(.never)
37+
#endif
3638

3739
SecureField("Password", text: $password)
3840
.textContentType(.password)
3941
.autocorrectionDisabled()
42+
#if !os(macOS)
4043
.textInputAutocapitalization(.never)
44+
#endif
4145
}
4246

4347
Section {

Examples/Examples/Auth/AuthWithMagicLink.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ struct AuthWithMagicLink: View {
1515
Form {
1616
Section {
1717
TextField("Email", text: $email)
18-
.keyboardType(.emailAddress)
1918
.textContentType(.emailAddress)
2019
.autocorrectionDisabled()
20+
#if !os(macOS)
21+
.keyboardType(.emailAddress)
2122
.textInputAutocapitalization(.never)
23+
#endif
2224
}
2325

2426
Section {

Examples/Examples/Auth/GoogleSignInSDKFlow.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct GoogleSignInSDKFlow: View {
1919
func handleSignIn() {
2020
Task {
2121
do {
22-
let result = try await GIDSignIn.sharedInstance.signIn(withPresenting: rootViewController)
22+
let result = try await GIDSignIn.sharedInstance.signIn(withPresenting: root)
2323

2424
guard let idToken = result.user.idToken?.tokenString else {
2525
debug("No 'idToken' returned by GIDSignIn call.")
@@ -38,9 +38,15 @@ struct GoogleSignInSDKFlow: View {
3838
}
3939
}
4040

41-
var rootViewController: UIViewController {
42-
UIApplication.shared.firstKeyWindow?.rootViewController ?? UIViewController()
43-
}
41+
#if canImport(UIKit)
42+
var root: UIViewController {
43+
UIApplication.shared.firstKeyWindow?.rootViewController ?? UIViewController()
44+
}
45+
#else
46+
var root: NSWindow {
47+
NSApplication.shared.keyWindow ?? NSWindow()
48+
}
49+
#endif
4450
}
4551

4652
#Preview {

0 commit comments

Comments
 (0)