Skip to content

Commit

Permalink
Update linting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenachbaur-okta committed Feb 14, 2024
1 parent d4daa4d commit b616af7
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 12 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ only_rules:
- operator_usage_whitespace
- return_arrow_whitespace
- trailing_whitespace
- attributes

# Empty
- empty_collection_literal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class OIDCSignInViewController: UIViewController {
object: nil)
}

@objc func dismissProfile() {
@objc
func dismissProfile() {
guard presentedViewController != nil else { return }

self.presentedViewController?.dismiss(animated: true, completion: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ extension SDKVersion.Migration {
NotificationCenter.default.post(name: .credentialMigrated, object: credential)
}

@objc(_OIDCLegacyStateManager) class StateManager: NSObject, NSCoding {
@objc(_OIDCLegacyStateManager)
class StateManager: NSObject, NSCoding {
@objc let authState: AuthState?
@objc let accessibility: String?

Expand All @@ -220,7 +221,8 @@ extension SDKVersion.Migration {
accessibility = coder.decodeObject(forKey: "accessibility") as? String
}

@objc(_OIDCLegacyAuthState) class AuthState: NSObject, NSCoding {
@objc(_OIDCLegacyAuthState)
class AuthState: NSObject, NSCoding {
@objc let refreshToken: String?
@objc let scope: String?
@objc let lastTokenResponse: TokenResponse?
Expand All @@ -236,7 +238,8 @@ extension SDKVersion.Migration {
}
}

@objc(_OIDCLegacyTokenResponse) class TokenResponse: NSObject, NSCoding {
@objc(_OIDCLegacyTokenResponse)
class TokenResponse: NSObject, NSCoding {
@objc let accessToken: String?
@objc let accessTokenExpirationDate: Date?
@objc let tokenType: String?
Expand All @@ -258,7 +261,8 @@ extension SDKVersion.Migration {
}
}

@objc(_OIDCLegacyAuthorizationResponse) class AuthorizationResponse: NSObject, NSCoding {
@objc(_OIDCLegacyAuthorizationResponse)
class AuthorizationResponse: NSObject, NSCoding {
@objc let authorizationCode: String?
@objc let state: String?

Expand Down
3 changes: 1 addition & 2 deletions Sources/AuthFoundation/Utilities/DelegateCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ extension UsesDelegateCollection {
}

public final class DelegateCollection<D> {
@WeakCollection
private var delegates: [AnyObject?]
@WeakCollection private var delegates: [AnyObject?]

public init() {
delegates = []
Expand Down
3 changes: 1 addition & 2 deletions Sources/AuthFoundation/Utilities/TimeCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class DefaultTimeCoordinator: TimeCoordinator, OAuth2ClientDelegate {
Date.coordinator = DefaultTimeCoordinator()
}

@ThreadSafe
private(set) var offset: TimeInterval
@ThreadSafe private(set) var offset: TimeInterval

private var observer: NSObjectProtocol?

Expand Down
2 changes: 1 addition & 1 deletion Sources/OktaDirectAuth/DirectAuthFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public enum DirectAuthenticationFlowError: Error {
/// This enables developers to build native sign-in workflows into their applications, while leveraging MFA to securely authenticate users, without the need to present a browser. Furthermore, this enables passwordless authentication scenarios by giving developers the power to choose which primary and secondary authentication factors to use when challenging a user for their credentials.
public class DirectAuthenticationFlow: AuthenticationFlow {
/// Enumeration defining the list of possible primary authentication factors.
///
///
/// These values are used by the ``DirectAuthenticationFlow/start(_:with:)`` function.
public enum PrimaryFactor: Equatable {
/// Authenticate the user with the given password.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct OOBResponse: Codable, HasTokenParameters {
self.bindingCode = bindingCode
}

var tokenParameters: [String : Any]? {
var tokenParameters: [String: Any]? {
["oob_code": oobCode]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extension WebAuthnChallengeRequest: APIRequest, APIRequestBody {
}

extension WebAuthn.AuthenticatorAssertionResponse: HasTokenParameters {
var tokenParameters: [String : Any]? {
var tokenParameters: [String: Any]? {
var result = [
"clientDataJSON": clientDataJSON,
"authenticatorData": authenticatorData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//
// Copyright (c) 2023-Present, Okta, Inc. and/or its affiliates. All rights reserved.
// The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//
// Copyright (c) 2023-Present, Okta, Inc. and/or its affiliates. All rights reserved.
// The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//
// Copyright (c) 2023-Present, Okta, Inc. and/or its affiliates. All rights reserved.
// The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//
// Copyright (c) 2023-Present, Okta, Inc. and/or its affiliates. All rights reserved.
// The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//
// Copyright (c) 2023-Present, Okta, Inc. and/or its affiliates. All rights reserved.
// The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
//
Expand Down

0 comments on commit b616af7

Please sign in to comment.