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

chore: fix swiftlint errors #3921

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Amplify/Categories/Auth/AuthCategory+WebAuthnBehaviour.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extension AuthCategory: AuthCategoryWebAuthnBehaviour {
options: AuthAssociateWebAuthnCredentialRequest.Options? = nil
) async throws {
try await plugin.associateWebAuthnCredential(
presentationAnchor:presentationAnchor,
presentationAnchor: presentationAnchor,
options: options
)
}
Expand All @@ -25,7 +25,7 @@ extension AuthCategory: AuthCategoryWebAuthnBehaviour {
options: AuthAssociateWebAuthnCredentialRequest.Options? = nil
) async throws {
try await plugin.associateWebAuthnCredential(
presentationAnchor:presentationAnchor,
presentationAnchor: presentationAnchor,
options: options
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct VerifySignInChallenge: Action {
environment: environment,
username: username)
return
} else if case .continueSignInWithFirstFactorSelection(_) = currentSignInStep,
} else if case .continueSignInWithFirstFactorSelection = currentSignInStep,
let authFactorType = AuthFactorType(rawValue: confirmSignEventData.answer) {
if (authFactorType == .password || authFactorType == .passwordSRP) {
try await handleContinueSignInWithPassword(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PlatformWebAuthnCredentials: NSObject, WebAuthnCredentialsProtocol {

// - MARK: CredentialAsserterProtocol
@available(iOS 17.4, macOS 13.5, visionOS 1.0, *)
extension PlatformWebAuthnCredentials: CredentialAsserterProtocol{
extension PlatformWebAuthnCredentials: CredentialAsserterProtocol {
func assert(with options: CredentialAssertionOptions) async throws -> CredentialAssertionPayload {
guard assertionContinuation == nil else {
throw WebAuthnError.unknown(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ struct AWSCognitoAuthCredentialStore {
/// - Old Identity Pool Config == New Identity Pool Config
if oldUserPoolConfiguration == nil &&
newIdentityConfigData != nil &&
oldIdentityPoolConfiguration == newIdentityConfigData
{
oldIdentityPoolConfiguration == newIdentityConfigData {
// retrieve data from the old namespace and save with the new namespace
if let oldCognitoCredentialsData = try? keychain._getData(oldNameSpace) {
try? keychain._set(oldCognitoCredentialsData, key: newNameSpace)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ struct SignUpEventData {
var session: String?

init(username: String,
clientMetadata: [String : String]? = nil,
validationData: [String : String]? = nil,
clientMetadata: [String: String]? = nil,
validationData: [String: String]? = nil,
session: String? = nil) {
self.username = username
self.clientMetadata = clientMetadata
Expand All @@ -31,9 +31,9 @@ extension SignUpEventData: CustomDebugDictionaryConvertible {
var debugDictionary: [String: Any] {
[
"username": username.masked(),
"clientMetadata" : clientMetadata ?? "",
"validationData" : validationData ?? "",
"session" : session?.masked() ?? ""
"clientMetadata": clientMetadata ?? "",
"validationData": validationData ?? "",
"session": session?.masked() ?? ""
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
import Foundation

// swiftlint:disable type_body_length
extension SignInState {

// swiftlint:disable:next nesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ extension SignUpState {
switch oldState {
case .notStarted:
return resolveNotStarted(byApplying: signUpEvent, from: oldState)
case .initiatingSignUp(_):
case .initiatingSignUp:
return resolveInitiatingSignUp(byApplying: signUpEvent, from: oldState)
case .awaitingUserConfirmation:
return resolveAwaitingUserConfirmation(byApplying: signUpEvent, from: oldState)
case .confirmingSignUp(_):
case .confirmingSignUp:
return resolveConfirmingSignUp(byApplying: signUpEvent, from: oldState)
case .signedUp:
return resolveSignedUp(byApplying: signUpEvent, from: oldState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AWSAuthSignUpTask: AuthSignUpTask, DefaultLogger {
let stateSequences = await authStateMachine.listen()
log.verbose("Validating current state")
for await state in stateSequences {
guard case .configured(_ , _, let signUpState) = state else {
guard case .configured(_, _, let signUpState) = state else {
continue
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum WebAuthnCredentialError<T>: Error {
}

struct CredentialAssertionOptions: Codable, Equatable {
private enum CodingKeys : String, CodingKey {
private enum CodingKeys: String, CodingKey {
case challengeString = "challenge", relyingPartyId = "rpId"
}
private let challengeString: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import Foundation
protocol AuthAssociateWebAuthnCredentialTask: AmplifyAuthTask where
Request == AuthAssociateWebAuthnCredentialRequest,
Success == Void,
Failure == AuthError
{}
Failure == AuthError {
}

public extension HubPayload.EventName.Auth {
static let associateWebAuthnCredentialAPI = "Auth.associateWebAuthnCredentialAPI"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import Foundation
protocol AuthDeleteWebAuthnCredentialTask: AmplifyAuthTask where
Request == AuthDeleteWebAuthnCredentialRequest,
Success == Void,
Failure == AuthError
{}
Failure == AuthError {
}

public extension HubPayload.EventName.Auth {
static let deleteWebAuthnCredentialAPI = "Auth.deleteWebAuthnCredentialAPI"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import Foundation
protocol AuthListWebAuthnCredentialsTask: AmplifyAuthTask where
Request == AuthListWebAuthnCredentialsRequest,
Success == AuthListWebAuthnCredentialsResult,
Failure == AuthError
{}
Failure == AuthError {
}

public extension HubPayload.EventName.Auth {
static let listWebAuthnCredentialsAPI = "Auth.listWebAuthnCredentialsAPI"
Expand Down
Loading