Skip to content

Commit

Permalink
Merge pull request #1592 from stripe-ios/kg-renameauth
Browse files Browse the repository at this point in the history
Financial Connections: renamed instances of AuthorizationSession to AuthSession.
  • Loading branch information
kgaidis-stripe authored Nov 23, 2022
2 parents aeac5b6 + cf7c702 commit 9f92205
Show file tree
Hide file tree
Showing 14 changed files with 125 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@
6ABF20382878786700C10295 /* UIFont+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ABF20372878786700C10295 /* UIFont+Extensions.swift */; };
6AC190E228E7449000417EC5 /* InstitutionSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AC190E128E7449000417EC5 /* InstitutionSearchBar.swift */; };
6AC190E428E752D000417EC5 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6AC190E328E752D000417EC5 /* [email protected] */; };
6AD025C52926876B00C6CBF1 /* UIImage+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD025C42926876B00C6CBF1 /* UIImage+Extensions.swift */; };
6AD025C12925D71C00C6CBF1 /* HitTestStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD025C02925D71C00C6CBF1 /* HitTestStackView.swift */; };
6AD025C32925DA7500C6CBF1 /* HitTestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD025C22925DA7500C6CBF1 /* HitTestView.swift */; };
6AD025C52926876B00C6CBF1 /* UIImage+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD025C42926876B00C6CBF1 /* UIImage+Extensions.swift */; };
6AD025C7292725EF00C6CBF1 /* ConsentBottomSheetModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD025C6292725EF00C6CBF1 /* ConsentBottomSheetModel.swift */; };
6AD025C92927EAC800C6CBF1 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6AD025C82927EAC800C6CBF1 /* [email protected] */; };
6AD025CB292BC89D00C6CBF1 /* BulletPointLabelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD025CA292BC89D00C6CBF1 /* BulletPointLabelView.swift */; };
6AD448B728C25F1F002CABB0 /* ResetFlowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD448B628C25F1F002CABB0 /* ResetFlowViewController.swift */; };
6AD448B928C25F85002CABB0 /* ResetFlowDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD448B828C25F85002CABB0 /* ResetFlowDataSource.swift */; };
6AD5863E290AC9380088522B /* FinancialConnectionsPaymentMethodType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD5863D290AC9380088522B /* FinancialConnectionsPaymentMethodType.swift */; };
6AD58640290AC9590088522B /* FinancialConnectionsAuthorizationSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD5863F290AC9590088522B /* FinancialConnectionsAuthorizationSession.swift */; };
6AD58640290AC9590088522B /* FinancialConnectionsAuthSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD5863F290AC9590088522B /* FinancialConnectionsAuthSession.swift */; };
6AD58642290AC9FA0088522B /* FinancialConnectionsPartnerAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD58641290AC9FA0088522B /* FinancialConnectionsPartnerAccount.swift */; };
6AD58644290ACA200088522B /* FinancialConnectionsPaymentAccountResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD58643290ACA200088522B /* FinancialConnectionsPaymentAccountResource.swift */; };
6AD58646290ACA580088522B /* FinancialConnectionsMixedOAuthParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD58645290ACA580088522B /* FinancialConnectionsMixedOAuthParams.swift */; };
Expand Down Expand Up @@ -369,16 +369,16 @@
6ABF20372878786700C10295 /* UIFont+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+Extensions.swift"; sourceTree = "<group>"; };
6AC190E128E7449000417EC5 /* InstitutionSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstitutionSearchBar.swift; sourceTree = "<group>"; };
6AC190E328E752D000417EC5 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
6AD025C42926876B00C6CBF1 /* UIImage+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Extensions.swift"; sourceTree = "<group>"; };
6AD025C02925D71C00C6CBF1 /* HitTestStackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HitTestStackView.swift; sourceTree = "<group>"; };
6AD025C22925DA7500C6CBF1 /* HitTestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HitTestView.swift; sourceTree = "<group>"; };
6AD025C42926876B00C6CBF1 /* UIImage+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Extensions.swift"; sourceTree = "<group>"; };
6AD025C6292725EF00C6CBF1 /* ConsentBottomSheetModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsentBottomSheetModel.swift; sourceTree = "<group>"; };
6AD025C82927EAC800C6CBF1 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
6AD025CA292BC89D00C6CBF1 /* BulletPointLabelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BulletPointLabelView.swift; sourceTree = "<group>"; };
6AD448B628C25F1F002CABB0 /* ResetFlowViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetFlowViewController.swift; sourceTree = "<group>"; };
6AD448B828C25F85002CABB0 /* ResetFlowDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetFlowDataSource.swift; sourceTree = "<group>"; };
6AD5863D290AC9380088522B /* FinancialConnectionsPaymentMethodType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsPaymentMethodType.swift; sourceTree = "<group>"; };
6AD5863F290AC9590088522B /* FinancialConnectionsAuthorizationSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsAuthorizationSession.swift; sourceTree = "<group>"; };
6AD5863F290AC9590088522B /* FinancialConnectionsAuthSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsAuthSession.swift; sourceTree = "<group>"; };
6AD58641290AC9FA0088522B /* FinancialConnectionsPartnerAccount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsPartnerAccount.swift; sourceTree = "<group>"; };
6AD58643290ACA200088522B /* FinancialConnectionsPaymentAccountResource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsPaymentAccountResource.swift; sourceTree = "<group>"; };
6AD58645290ACA580088522B /* FinancialConnectionsMixedOAuthParams.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsMixedOAuthParams.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -556,7 +556,7 @@
3CAD99BA284E381100B163EB /* FinancialConnectionsInstitution.swift */,
6A370F312901CA2C00A6DB9B /* FinancialConnectionsSynchronize.swift */,
6AD5863D290AC9380088522B /* FinancialConnectionsPaymentMethodType.swift */,
6AD5863F290AC9590088522B /* FinancialConnectionsAuthorizationSession.swift */,
6AD5863F290AC9590088522B /* FinancialConnectionsAuthSession.swift */,
6AD58641290AC9FA0088522B /* FinancialConnectionsPartnerAccount.swift */,
6AD58643290ACA200088522B /* FinancialConnectionsPaymentAccountResource.swift */,
6AD58645290ACA580088522B /* FinancialConnectionsMixedOAuthParams.swift */,
Expand Down Expand Up @@ -1096,7 +1096,7 @@
6AE3F32F28EDF6B10079FD59 /* AuthFlowHelpers.swift in Sources */,
6AD025C32925DA7500C6CBF1 /* HitTestView.swift in Sources */,
3CE96D3627585F01006B7059 /* FinancialConnectionsSessionManifest.swift in Sources */,
6AD58640290AC9590088522B /* FinancialConnectionsAuthorizationSession.swift in Sources */,
6AD58640290AC9590088522B /* FinancialConnectionsAuthSession.swift in Sources */,
6A2318D028AE7EA700F2A7D8 /* RadioButtonView.swift in Sources */,
6ABE2D0A285B7BA20064B3A4 /* SFSafariViewController+Extensions.swift in Sources */,
6AD5863E290AC9380088522B /* FinancialConnectionsPaymentMethodType.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ protocol FinancialConnectionsAPIClient {

func fetchInstitutions(clientSecret: String, query: String) -> Promise<FinancialConnectionsInstitutionList>

func createAuthorizationSession(clientSecret: String, institutionId: String) -> Promise<FinancialConnectionsAuthorizationSession>
func createAuthSession(clientSecret: String, institutionId: String) -> Promise<FinancialConnectionsAuthSession>

func cancelAuthSession(clientSecret: String, authSessionId: String) -> Promise<FinancialConnectionsAuthorizationSession>
func cancelAuthSession(clientSecret: String, authSessionId: String) -> Promise<FinancialConnectionsAuthSession>

func fetchAuthSessionOAuthResults(clientSecret: String, authSessionId: String) -> Future<FinancialConnectionsMixedOAuthParams>

func authorizeAuthSession(clientSecret: String,
authSessionId: String,
publicToken: String?) -> Promise<FinancialConnectionsAuthorizationSession>
publicToken: String?) -> Promise<FinancialConnectionsAuthSession>

func fetchAuthSessionAccounts(
clientSecret: String,
authSessionId: String,
initialPollDelay: TimeInterval
) -> Future<FinancialConnectionsAuthorizationSessionAccounts>
) -> Future<FinancialConnectionsAuthSessionAccounts>

func selectAuthSessionAccounts(clientSecret: String,
authSessionId: String,
selectedAccountIds: [String]) -> Promise<FinancialConnectionsAuthorizationSessionAccounts>
selectedAccountIds: [String]) -> Promise<FinancialConnectionsAuthSessionAccounts>

func markLinkingMoreAccounts(clientSecret: String) -> Promise<FinancialConnectionsSessionManifest>

Expand Down Expand Up @@ -134,23 +134,23 @@ extension STPAPIClient: FinancialConnectionsAPIClient {
parameters: parameters)
}

func createAuthorizationSession(clientSecret: String, institutionId: String) -> Promise<FinancialConnectionsAuthorizationSession> {
func createAuthSession(clientSecret: String, institutionId: String) -> Promise<FinancialConnectionsAuthSession> {
let body: [String:Any] = [
"client_secret": clientSecret,
"institution": institutionId,
"use_mobile_handoff": "false",
"use_abstract_flow": true,
"return_url": "ios",
]
return self.post(resource: APIEndpointAuthorizationSessions, parameters: body)
return self.post(resource: APIEndpointAuthSessions, parameters: body)
}

func cancelAuthSession(clientSecret: String, authSessionId: String) -> Promise<FinancialConnectionsAuthorizationSession> {
func cancelAuthSession(clientSecret: String, authSessionId: String) -> Promise<FinancialConnectionsAuthSession> {
let body = [
"client_secret": clientSecret,
"id": authSessionId,
]
return self.post(resource: APIEndpointAuthorizationSessionsCancel, object: body)
return self.post(resource: APIEndpointAuthSessionsCancel, object: body)
}

func fetchAuthSessionOAuthResults(clientSecret: String, authSessionId: String) -> Future<FinancialConnectionsMixedOAuthParams> {
Expand All @@ -163,7 +163,7 @@ extension STPAPIClient: FinancialConnectionsAPIClient {
guard let self = self else {
return Promise(error: FinancialConnectionsSheetError.unknown(debugDescription: "STPAPIClient deallocated."))
}
return self.post(resource: APIEndpointAuthorizationSessionsOAuthResults, object: body)
return self.post(resource: APIEndpointAuthSessionsOAuthResults, object: body)
},
pollTimingOptions: APIPollingHelper<FinancialConnectionsMixedOAuthParams>.PollTimingOptions(
initialPollDelay: 0,
Expand All @@ -176,20 +176,20 @@ extension STPAPIClient: FinancialConnectionsAPIClient {

func authorizeAuthSession(clientSecret: String,
authSessionId: String,
publicToken: String? = nil) -> Promise<FinancialConnectionsAuthorizationSession> {
publicToken: String? = nil) -> Promise<FinancialConnectionsAuthSession> {
var body = [
"client_secret": clientSecret,
"id": authSessionId,
]
body["public_token"] = publicToken // not all integrations require public_token
return self.post(resource: APIEndpointAuthorizationSessionsAuthorized, object: body)
return self.post(resource: APIEndpointAuthSessionsAuthorized, object: body)
}

func fetchAuthSessionAccounts(
clientSecret: String,
authSessionId: String,
initialPollDelay: TimeInterval
) -> Future<FinancialConnectionsAuthorizationSessionAccounts> {
) -> Future<FinancialConnectionsAuthSessionAccounts> {
let body = [
"client_secret": clientSecret,
"id": authSessionId,
Expand All @@ -199,9 +199,9 @@ extension STPAPIClient: FinancialConnectionsAPIClient {
guard let self = self else {
return Promise(error: FinancialConnectionsSheetError.unknown(debugDescription: "STPAPIClient deallocated."))
}
return self.post(resource: APIEndpointAuthorizationSessionsAccounts, object: body)
return self.post(resource: APIEndpointAuthSessionsAccounts, object: body)
},
pollTimingOptions: APIPollingHelper<FinancialConnectionsAuthorizationSessionAccounts>.PollTimingOptions(
pollTimingOptions: APIPollingHelper<FinancialConnectionsAuthSessionAccounts>.PollTimingOptions(
initialPollDelay: initialPollDelay
)
)
Expand All @@ -210,13 +210,13 @@ extension STPAPIClient: FinancialConnectionsAPIClient {

func selectAuthSessionAccounts(clientSecret: String,
authSessionId: String,
selectedAccountIds: [String]) -> Promise<FinancialConnectionsAuthorizationSessionAccounts> {
selectedAccountIds: [String]) -> Promise<FinancialConnectionsAuthSessionAccounts> {
let body: [String: Any] = [
"client_secret": clientSecret,
"id": authSessionId,
"selected_accounts": selectedAccountIds,
]
return self.post(resource: APIEndpointAuthorizationSessionsSelectedAccounts, parameters: body)
return self.post(resource: APIEndpointAuthSessionsSelectedAccounts, parameters: body)
}

func markLinkingMoreAccounts(clientSecret: String) -> Promise<FinancialConnectionsSessionManifest> {
Expand Down Expand Up @@ -354,7 +354,7 @@ extension STPAPIClient: FinancialConnectionsAPIClient {
]
body["key"] = publishableKey
return self.post(
resource: APIEndpointAuthorizationSessionsEvents,
resource: APIEndpointAuthSessionsEvents,
parameters: body
)
}
Expand All @@ -369,10 +369,10 @@ private let APIEndpointLinkMoreAccounts = "link_account_sessions/link_more_accou
private let APIEndpointComplete = "link_account_sessions/complete"
private let APIEndpointFeaturedInstitutions = "connections/featured_institutions"
private let APIEndpointSearchInstitutions = "connections/institutions"
private let APIEndpointAuthorizationSessions = "connections/auth_sessions"
private let APIEndpointAuthorizationSessionsCancel = "connections/auth_sessions/cancel"
private let APIEndpointAuthorizationSessionsOAuthResults = "connections/auth_sessions/oauth_results"
private let APIEndpointAuthorizationSessionsAuthorized = "connections/auth_sessions/authorized"
private let APIEndpointAuthorizationSessionsAccounts = "connections/auth_sessions/accounts"
private let APIEndpointAuthorizationSessionsSelectedAccounts = "connections/auth_sessions/selected_accounts"
private let APIEndpointAuthorizationSessionsEvents = "connections/auth_sessions/events"
private let APIEndpointAuthSessions = "connections/auth_sessions"
private let APIEndpointAuthSessionsCancel = "connections/auth_sessions/cancel"
private let APIEndpointAuthSessionsOAuthResults = "connections/auth_sessions/oauth_results"
private let APIEndpointAuthSessionsAuthorized = "connections/auth_sessions/authorized"
private let APIEndpointAuthSessionsAccounts = "connections/auth_sessions/accounts"
private let APIEndpointAuthSessionsSelectedAccounts = "connections/auth_sessions/selected_accounts"
private let APIEndpointAuthSessionsEvents = "connections/auth_sessions/events"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import UIKit
@_spi(STP) import StripeUICore

struct FinancialConnectionsAuthorizationSession: Decodable {
struct FinancialConnectionsAuthSession: Decodable {
enum Flow: String, SafeEnumCodable, Equatable {
case directWebview = "direct_webview"
case finicityConnectV2Lite = "finicity_connect_v2_lite"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct FinancialConnectionsDisabledPartnerAccount {
let disableReason: String
}

struct FinancialConnectionsAuthorizationSessionAccounts: Decodable {
struct FinancialConnectionsAuthSessionAccounts: Decodable {
let data: [FinancialConnectionsPartnerAccount]
let nextPane: FinancialConnectionsSessionManifest.NextPane
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct FinancialConnectionsSessionManifest: Decodable {
// MARK: - Properties

let accountholderIsLinkConsumer: Bool?
let activeAuthSession: FinancialConnectionsAuthorizationSession?
let activeAuthSession: FinancialConnectionsAuthSession?
let activeInstitution: FinancialConnectionsInstitution?
let allowManualEntry: Bool
let businessName: String?
Expand Down
Loading

0 comments on commit 9f92205

Please sign in to comment.