Skip to content

Commit acf504c

Browse files
committed
chore: remove deprecated code
1 parent 21425be commit acf504c

Some content is hidden

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

43 files changed

+81
-4525
lines changed

Examples/Examples.xcodeproj/project.pbxproj

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@
436436
attributes = {
437437
BuildIndependentTargetsInParallel = 1;
438438
LastSwiftUpdateCheck = 1510;
439-
LastUpgradeCheck = 1510;
439+
LastUpgradeCheck = 2600;
440440
TargetAttributes = {
441441
793895C52954ABFF0044F2B8 = {
442442
CreatedOnToolsVersion = 14.1;
@@ -625,6 +625,7 @@
625625
CURRENT_PROJECT_VERSION = 1;
626626
DEAD_CODE_STRIPPING = YES;
627627
DEBUG_INFORMATION_FORMAT = dwarf;
628+
DEVELOPMENT_TEAM = ELTTE7K8TT;
628629
ENABLE_STRICT_OBJC_MSGSEND = YES;
629630
ENABLE_TESTABILITY = YES;
630631
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -654,6 +655,7 @@
654655
MTL_FAST_MATH = YES;
655656
ONLY_ACTIVE_ARCH = YES;
656657
SDKROOT = iphoneos;
658+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
657659
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
658660
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
659661
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -699,6 +701,7 @@
699701
CURRENT_PROJECT_VERSION = 1;
700702
DEAD_CODE_STRIPPING = YES;
701703
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
704+
DEVELOPMENT_TEAM = ELTTE7K8TT;
702705
ENABLE_NS_ASSERTIONS = NO;
703706
ENABLE_STRICT_OBJC_MSGSEND = YES;
704707
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -721,6 +724,7 @@
721724
MTL_ENABLE_DEBUG_INFO = NO;
722725
MTL_FAST_MATH = YES;
723726
SDKROOT = iphoneos;
727+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
724728
SWIFT_COMPILATION_MODE = wholemodule;
725729
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
726730
SWIFT_OPTIMIZATION_LEVEL = "-O";
@@ -737,9 +741,11 @@
737741
CODE_SIGN_ENTITLEMENTS = Examples/Examples.entitlements;
738742
CODE_SIGN_STYLE = Automatic;
739743
DEVELOPMENT_ASSET_PATHS = "\"Examples/Preview Content\"";
740-
DEVELOPMENT_TEAM = ELTTE7K8TT;
744+
ENABLE_APP_SANDBOX = YES;
741745
ENABLE_HARDENED_RUNTIME = YES;
746+
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
742747
ENABLE_PREVIEWS = YES;
748+
ENABLE_USER_SELECTED_FILES = readonly;
743749
GENERATE_INFOPLIST_FILE = YES;
744750
INFOPLIST_FILE = Examples/Info.plist;
745751
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@@ -763,9 +769,11 @@
763769
CODE_SIGN_ENTITLEMENTS = Examples/Examples.entitlements;
764770
CODE_SIGN_STYLE = Automatic;
765771
DEVELOPMENT_ASSET_PATHS = "\"Examples/Preview Content\"";
766-
DEVELOPMENT_TEAM = ELTTE7K8TT;
772+
ENABLE_APP_SANDBOX = YES;
767773
ENABLE_HARDENED_RUNTIME = YES;
774+
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
768775
ENABLE_PREVIEWS = YES;
776+
ENABLE_USER_SELECTED_FILES = readonly;
769777
GENERATE_INFOPLIST_FILE = YES;
770778
INFOPLIST_FILE = Examples/Info.plist;
771779
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@@ -790,9 +798,11 @@
790798
CODE_SIGN_STYLE = Automatic;
791799
CURRENT_PROJECT_VERSION = 1;
792800
DEVELOPMENT_ASSET_PATHS = "\"SlackClone/Preview Content\"";
793-
DEVELOPMENT_TEAM = ELTTE7K8TT;
801+
ENABLE_APP_SANDBOX = YES;
794802
ENABLE_HARDENED_RUNTIME = YES;
803+
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
795804
ENABLE_PREVIEWS = YES;
805+
ENABLE_USER_SELECTED_FILES = readonly;
796806
GENERATE_INFOPLIST_FILE = YES;
797807
INFOPLIST_FILE = SlackClone/Info.plist;
798808
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
@@ -830,9 +840,11 @@
830840
CODE_SIGN_STYLE = Automatic;
831841
CURRENT_PROJECT_VERSION = 1;
832842
DEVELOPMENT_ASSET_PATHS = "\"SlackClone/Preview Content\"";
833-
DEVELOPMENT_TEAM = ELTTE7K8TT;
843+
ENABLE_APP_SANDBOX = YES;
834844
ENABLE_HARDENED_RUNTIME = YES;
845+
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
835846
ENABLE_PREVIEWS = YES;
847+
ENABLE_USER_SELECTED_FILES = readonly;
836848
GENERATE_INFOPLIST_FILE = YES;
837849
INFOPLIST_FILE = SlackClone/Info.plist;
838850
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
@@ -870,9 +882,11 @@
870882
CODE_SIGN_STYLE = Automatic;
871883
CURRENT_PROJECT_VERSION = 1;
872884
DEVELOPMENT_ASSET_PATHS = "\"UserManagement/Preview Content\"";
873-
DEVELOPMENT_TEAM = ELTTE7K8TT;
885+
ENABLE_APP_SANDBOX = YES;
874886
ENABLE_HARDENED_RUNTIME = YES;
887+
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
875888
ENABLE_PREVIEWS = YES;
889+
ENABLE_USER_SELECTED_FILES = readonly;
876890
GENERATE_INFOPLIST_FILE = YES;
877891
INFOPLIST_FILE = UserManagement/Info.plist;
878892
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
@@ -910,9 +924,11 @@
910924
CODE_SIGN_STYLE = Automatic;
911925
CURRENT_PROJECT_VERSION = 1;
912926
DEVELOPMENT_ASSET_PATHS = "\"UserManagement/Preview Content\"";
913-
DEVELOPMENT_TEAM = ELTTE7K8TT;
927+
ENABLE_APP_SANDBOX = YES;
914928
ENABLE_HARDENED_RUNTIME = YES;
929+
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
915930
ENABLE_PREVIEWS = YES;
931+
ENABLE_USER_SELECTED_FILES = readonly;
916932
GENERATE_INFOPLIST_FILE = YES;
917933
INFOPLIST_FILE = UserManagement/Info.plist;
918934
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;

Examples/Examples.xcodeproj/xcshareddata/xcschemes/Examples.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1510"
3+
LastUpgradeVersion = "2600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

Examples/Examples.xcodeproj/xcshareddata/xcschemes/SlackClone.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1520"
3+
LastUpgradeVersion = "2600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

Examples/Examples.xcodeproj/xcshareddata/xcschemes/UserManagement.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1510"
3+
LastUpgradeVersion = "2600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

Examples/Examples/Examples.entitlements

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
<array>
77
<string>Default</string>
88
</array>
9-
<key>com.apple.security.app-sandbox</key>
10-
<true/>
11-
<key>com.apple.security.files.user-selected.read-only</key>
12-
<true/>
13-
<key>com.apple.security.network.client</key>
14-
<true/>
159
<key>keychain-access-groups</key>
1610
<array/>
1711
</dict>
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>com.apple.security.app-sandbox</key>
6-
<true/>
7-
<key>com.apple.security.files.user-selected.read-only</key>
8-
<true/>
9-
<key>com.apple.security.network.client</key>
10-
<true/>
11-
</dict>
4+
<dict/>
125
</plist>
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>com.apple.security.app-sandbox</key>
6-
<true/>
7-
<key>com.apple.security.files.user-selected.read-only</key>
8-
<true/>
9-
<key>com.apple.security.network.client</key>
10-
<true/>
11-
</dict>
4+
<dict/>
125
</plist>

Sources/Auth/AuthError.swift

Lines changed: 0 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -118,128 +118,6 @@ extension ErrorCode {
118118
}
119119

120120
public enum AuthError: LocalizedError, Equatable {
121-
@available(
122-
*,
123-
deprecated,
124-
message:
125-
"Error used to be thrown when no exp claim was found in JWT during setSession(accessToken:refreshToken:) method."
126-
)
127-
case missingExpClaim
128-
129-
@available(
130-
*,
131-
deprecated,
132-
message:
133-
"Error used to be thrown when provided JWT wasn't valid during setSession(accessToken:refreshToken:) method."
134-
)
135-
case malformedJWT
136-
137-
@available(*, deprecated, renamed: "sessionMissing")
138-
public static var sessionNotFound: AuthError { .sessionMissing }
139-
140-
/// Error thrown during PKCE flow.
141-
@available(
142-
*,
143-
deprecated,
144-
renamed: "pkceGrantCodeExchange",
145-
message: "Error was grouped in `pkceGrantCodeExchange`, please use it instead of `pkce`."
146-
)
147-
public static func pkce(_ reason: PKCEFailureReason) -> AuthError {
148-
switch reason {
149-
case .codeVerifierNotFound:
150-
.pkceGrantCodeExchange(message: "A code verifier wasn't found in PKCE flow.")
151-
case .invalidPKCEFlowURL:
152-
.pkceGrantCodeExchange(message: "Not a valid PKCE flow url.")
153-
}
154-
}
155-
156-
@available(*, deprecated, message: "Use `pkceGrantCodeExchange` instead.")
157-
public enum PKCEFailureReason: Sendable {
158-
/// Code verifier not found in the URL.
159-
case codeVerifierNotFound
160-
161-
/// Not a valid PKCE flow URL.
162-
case invalidPKCEFlowURL
163-
}
164-
165-
@available(*, deprecated, renamed: "implicitGrantRedirect")
166-
public static var invalidImplicitGrantFlowURL: AuthError {
167-
.implicitGrantRedirect(message: "Not a valid implicit grant flow url.")
168-
}
169-
170-
@available(
171-
*,
172-
deprecated,
173-
message:
174-
"This error is never thrown, if you depend on it, you can remove the logic as it never happens."
175-
)
176-
case missingURL
177-
178-
@available(
179-
*,
180-
deprecated,
181-
message:
182-
"Error used to be thrown on methods which required a valid redirect scheme, such as signInWithOAuth. This is now considered a programming error an a assertion is triggered in case redirect scheme isn't provided."
183-
)
184-
case invalidRedirectScheme
185-
186-
@available(
187-
*,
188-
deprecated,
189-
renamed: "api(message:errorCode:underlyingData:underlyingResponse:)"
190-
)
191-
public static func api(_ error: APIError) -> AuthError {
192-
let message = error.msg ?? error.error ?? error.errorDescription ?? "Unexpected API error."
193-
if let weakPassword = error.weakPassword {
194-
return .weakPassword(message: message, reasons: weakPassword.reasons)
195-
}
196-
197-
return .api(
198-
message: message,
199-
errorCode: .unknown,
200-
underlyingData: (try? AuthClient.Configuration.jsonEncoder.encode(error)) ?? Data(),
201-
underlyingResponse: HTTPURLResponse(
202-
url: defaultAuthURL,
203-
statusCode: error.code ?? 500,
204-
httpVersion: nil,
205-
headerFields: nil
206-
)!
207-
)
208-
}
209-
210-
/// An error returned by the API.
211-
@available(
212-
*,
213-
deprecated,
214-
renamed: "api(message:errorCode:underlyingData:underlyingResponse:)"
215-
)
216-
public struct APIError: Error, Codable, Sendable, Equatable {
217-
/// A basic message describing the problem with the request. Usually missing if
218-
/// ``AuthError/APIError/error`` is present.
219-
public var msg: String?
220-
221-
/// The HTTP status code. Usually missing if ``AuthError/APIError/error`` is present.
222-
public var code: Int?
223-
224-
/// Certain responses will contain this property with the provided values.
225-
///
226-
/// Usually one of these:
227-
/// - `invalid_request`
228-
/// - `unauthorized_client`
229-
/// - `access_denied`
230-
/// - `server_error`
231-
/// - `temporarily_unavailable`
232-
/// - `unsupported_otp_type`
233-
public var error: String?
234-
235-
/// Certain responses that have an ``AuthError/APIError/error`` property may have this property
236-
/// which describes the error.
237-
public var errorDescription: String?
238-
239-
/// Only returned when signing up if the password used is too weak. Inspect the
240-
/// ``WeakPassword/reasons`` and ``AuthError/APIError/msg`` property to identify the causes.
241-
public var weakPassword: WeakPassword?
242-
}
243121

244122
/// Error thrown when a session is required to proceed, but none was found, either thrown by the client, or returned by the server.
245123
case sessionMissing
@@ -274,11 +152,6 @@ public enum AuthError: LocalizedError, Equatable {
274152
let .implicitGrantRedirect(message),
275153
let .jwtVerificationFailed(message):
276154
message
277-
// Deprecated cases
278-
case .missingExpClaim: "Missing expiration claim in the access token."
279-
case .malformedJWT: "A malformed JWT received."
280-
case .invalidRedirectScheme: "Invalid redirect scheme."
281-
case .missingURL: "Missing URL."
282155
}
283156
}
284157

@@ -289,8 +162,6 @@ public enum AuthError: LocalizedError, Equatable {
289162
case let .api(_, errorCode, _, _): errorCode
290163
case .pkceGrantCodeExchange, .implicitGrantRedirect: .unknown
291164
case .jwtVerificationFailed: .invalidJWT
292-
// Deprecated cases
293-
case .missingExpClaim, .malformedJWT, .invalidRedirectScheme, .missingURL: .unknown
294165
}
295166
}
296167

Sources/Auth/AuthStateChangeListener.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import ConcurrencyExtras
99
import Foundation
1010

11-
1211
/// A listener that can be removed by calling ``AuthStateChangeListenerRegistration/remove()``.
1312
///
1413
/// - Note: Listener is automatically removed on deinit.
@@ -17,7 +16,11 @@ public protocol AuthStateChangeListenerRegistration: Sendable {
1716
func remove()
1817
}
1918

20-
extension ObservationToken: AuthStateChangeListenerRegistration {}
19+
extension ObservationToken: AuthStateChangeListenerRegistration {
20+
public func remove() {
21+
cancel()
22+
}
23+
}
2124

2225
public typealias AuthStateChangeListener = @Sendable (
2326
_ event: AuthChangeEvent,

0 commit comments

Comments
 (0)