From 8a1a92d71f1bc462c9dd6f0ba75c41256e77235a Mon Sep 17 00:00:00 2001 From: dtsiflit Date: Mon, 15 Jul 2024 11:16:33 +0300 Subject: [PATCH] [fix] formatting --- .../Entities/Issuance/AuthorizedRequest.swift | 69 +++++++++---------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/Sources/Entities/Issuance/AuthorizedRequest.swift b/Sources/Entities/Issuance/AuthorizedRequest.swift index 1a3dcf0..b4be2a2 100644 --- a/Sources/Entities/Issuance/AuthorizedRequest.swift +++ b/Sources/Entities/Issuance/AuthorizedRequest.swift @@ -36,44 +36,43 @@ public extension CanExpire { } public enum AuthorizedRequest { - case noProofRequired( - accessToken: IssuanceAccessToken, - refreshToken: IssuanceRefreshToken?, - credentialIdentifiers: AuthorizationDetailsIdentifiers?, - timeStamp: TimeInterval - ) - case proofRequired( - accessToken: IssuanceAccessToken, - refreshToken: IssuanceRefreshToken?, - cNonce: CNonce, - credentialIdentifiers: AuthorizationDetailsIdentifiers?, - timeStamp: TimeInterval - ) + case noProofRequired( + accessToken: IssuanceAccessToken, + refreshToken: IssuanceRefreshToken?, + credentialIdentifiers: AuthorizationDetailsIdentifiers?, + timeStamp: TimeInterval + ) + case proofRequired( + accessToken: IssuanceAccessToken, + refreshToken: IssuanceRefreshToken?, + cNonce: CNonce, + credentialIdentifiers: AuthorizationDetailsIdentifiers?, + timeStamp: TimeInterval + ) - - public func isAccessTokenExpired(clock: TimeInterval) -> Bool { - guard let timeStamp = self.timeStamp else { - return true - } - return accessToken?.isExpired(issued: timeStamp, at: clock) ?? false + public func isAccessTokenExpired(clock: TimeInterval) -> Bool { + guard let timeStamp = self.timeStamp else { + return true } + return accessToken?.isExpired(issued: timeStamp, at: clock) ?? false + } - public func isRefreshTokenExpired(clock: TimeInterval) -> Bool { - guard let timeStamp = self.timeStamp else { - return true - } - return accessToken?.isExpired( - issued: timeStamp, - at: clock - ) ?? false + public func isRefreshTokenExpired(clock: TimeInterval) -> Bool { + guard let timeStamp = self.timeStamp else { + return true } - - public var timeStamp: TimeInterval? { - switch self { - case .noProofRequired(_, _, _, let timeStamp): - return timeStamp - case .proofRequired(_, _, _, _, let timeStamp): - return timeStamp + return accessToken?.isExpired( + issued: timeStamp, + at: clock + ) ?? false + } + + public var timeStamp: TimeInterval? { + switch self { + case .noProofRequired(_, _, _, let timeStamp): + return timeStamp + case .proofRequired(_, _, _, _, let timeStamp): + return timeStamp } } @@ -85,7 +84,7 @@ public enum AuthorizedRequest { return nil } } - + public var proofToken: IssuanceAccessToken? { switch self { case .noProofRequired: