Skip to content

Commit

Permalink
Fix some test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenachbaur-okta committed Jan 31, 2025
1 parent 1758ef0 commit 828b975
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Sources/AuthFoundation/Debugging/APIRequestObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
// See the License for the specific language governing permissions and limitations under the License.
//

import Foundation
import OSLog

// **Note:** It would be preferable to use `Logger` for this, but this would mean setting the minimum OS version to iOS 14.
//
// Since this is a debug feature, It isn't worthwhile to update the minimum supported OS version for just this.
//
// If the minimum supported version of this SDK is to increase in the future, this class should be updated to use the modern Logger struct.

#if DEBUG
#if DEBUG && canImport(OSLog)
import Foundation
import OSLog

/// Convenience class used for debugging SDK network operations.
///
/// Developers can use this to assist in debugging interactions with the Client SDK, and any network operations that are performed on behalf of the user via this SDK.
Expand Down
6 changes: 1 addition & 5 deletions Sources/OktaDirectAuth/DirectAuthFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,7 @@ public class DirectAuthenticationFlow: AuthenticationFlow {
public let supportedGrantTypes: [GrantType]

/// The context that stores the state for the current authentication session.
public internal(set) var context: Context? {
didSet {
print("Reset context")
}
}
public internal(set) var context: Context?

/// Any additional query string parameters you would like to supply to the authorization server for all requests from this flow.
public let additionalParameters: [String: APIRequestArgument]?
Expand Down
6 changes: 3 additions & 3 deletions Sources/WebAuthenticationUI/WebAuthentication.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ public class WebAuthentication {
provider = nil
}

#if os(iOS) || os(visionOS)
#if os(iOS) || os(visionOS) || os(tvOS)
/// Attempts to resume sign in when the app is launched from a redirect URI.
///
/// This is a convenience method that can simplify apps that use a UISceneDelegate. Scene-based applications receive URLs when the `UIWindowSceneDelegate.scene(_:openURLContexts:)` method is called; the set of contexts can be supplied to this method, which will filter out only those URLs that match the URL scheme defined in the client configuration. If no matching URLs are found, the call is ignored.
/// - Parameter URLContexts: Set of `UIOpenURLContext` objects from which to attempt to resume authentication.
@available(iOS 13.0, *)
@available(iOS 13.0, tvOS 13.0, macCatalyst 13.1, visionOS 1.0, *)
public final func resume(with URLContexts: Set<UIOpenURLContext>) throws {
try URLContexts
.filter { $0.url.scheme?.lowercased() == signInFlow.redirectUri.scheme?.lowercased() }
.filter { $0.url.scheme?.lowercased() == signInFlow.client.configuration.redirectUri?.scheme?.lowercased() }
.map(\.url)
.forEach(resume(with:))
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/AuthFoundationTests/APIRetryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class APIRetryTests: XCTestCase {
client = MockApiClient(configuration: configuration,
session: urlSession,
baseURL: issuerURL)
apiRequest = MockApiRequest(url: issuerURL.appending(path: "/oauth2/v1/token"))
apiRequest = MockApiRequest(url: URL(string: "\(issuerURL.absoluteString)/oauth2/v1/token")!)
}

func testShouldNotRetry() throws {
Expand Down
2 changes: 1 addition & 1 deletion Tests/AuthFoundationTests/PKCETests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import XCTest

@testable import OktaOAuth2
@testable import AuthFoundation

final class PKCETests: XCTestCase {
func testPKCE() throws {
Expand Down

0 comments on commit 828b975

Please sign in to comment.