Skip to content

Commit fbcace8

Browse files
authored
chore(api): Update the function name and add comments (#2904)
1 parent 7326782 commit fbcace8

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

AmplifyPlugins/API/APICategoryPlugin.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
B478F6E12374E0CF00C4F92B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B478F6D52374E0CF00C4F92B /* Assets.xcassets */; };
148148
B478F6E22374E0CF00C4F92B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B478F6D62374E0CF00C4F92B /* LaunchScreen.storyboard */; };
149149
B478F6E32374E0CF00C4F92B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B478F6D82374E0CF00C4F92B /* Main.storyboard */; };
150-
B48D04AF29EE203F000A73BD /* HeaderIAMSigningHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B48D04AE29EE203F000A73BD /* HeaderIAMSigningHelper.swift */; };
150+
B48D04AF29EE203F000A73BD /* IAMHeaderSigningHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B48D04AE29EE203F000A73BD /* IAMHeaderSigningHelper.swift */; };
151151
B4DFA5E0237A611D0013E17B /* MockSessionFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4DFA5C0237A611D0013E17B /* MockSessionFactory.swift */; };
152152
B4DFA5E1237A611D0013E17B /* MockURLSessionTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4DFA5C1237A611D0013E17B /* MockURLSessionTask.swift */; };
153153
B4DFA5E2237A611D0013E17B /* MockURLSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4DFA5C2237A611D0013E17B /* MockURLSession.swift */; };
@@ -525,7 +525,7 @@
525525
B478F6D72374E0CF00C4F92B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
526526
B478F6D92374E0CF00C4F92B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
527527
B478F6DA2374E0CF00C4F92B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
528-
B48D04AE29EE203F000A73BD /* HeaderIAMSigningHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderIAMSigningHelper.swift; sourceTree = "<group>"; };
528+
B48D04AE29EE203F000A73BD /* IAMHeaderSigningHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IAMHeaderSigningHelper.swift; sourceTree = "<group>"; };
529529
B4DFA5C0237A611D0013E17B /* MockSessionFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockSessionFactory.swift; sourceTree = "<group>"; };
530530
B4DFA5C1237A611D0013E17B /* MockURLSessionTask.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockURLSessionTask.swift; sourceTree = "<group>"; };
531531
B4DFA5C2237A611D0013E17B /* MockURLSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockURLSession.swift; sourceTree = "<group>"; };
@@ -902,7 +902,7 @@
902902
21D5286624169E74005186BA /* IAMAuthInterceptor.swift */,
903903
763C857026B0651A005164B2 /* AuthenticationTokenAuthInterceptor.swift */,
904904
6BD4620525380EA200906831 /* OIDCAuthProviderWrapper.swift */,
905-
B48D04AE29EE203F000A73BD /* HeaderIAMSigningHelper.swift */,
905+
B48D04AE29EE203F000A73BD /* IAMHeaderSigningHelper.swift */,
906906
);
907907
path = SubscriptionInterceptor;
908908
sourceTree = "<group>";
@@ -2464,7 +2464,7 @@
24642464
buildActionMask = 2147483647;
24652465
files = (
24662466
21D7A102237B54D90057D00D /* URLSessionBehaviorDelegate.swift in Sources */,
2467-
B48D04AF29EE203F000A73BD /* HeaderIAMSigningHelper.swift in Sources */,
2467+
B48D04AF29EE203F000A73BD /* IAMHeaderSigningHelper.swift in Sources */,
24682468
21D7A0FD237B54D90057D00D /* URLSession+URLSessionBehavior.swift in Sources */,
24692469
212B29212592454400593ED5 /* AppSyncListPayload.swift in Sources */,
24702470
21A4F35A25A4F2E800E1047D /* AppSyncListResponse.swift in Sources */,

AmplifyPlugins/API/AWSAPICategoryPlugin/Interceptor/SubscriptionInterceptor/IAMAuthInterceptor.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class IAMAuthInterceptor: AuthInterceptor {
3131
completion(message)
3232
return
3333
}
34-
guard let helper = HeaderIAMSigningHelper(
34+
guard let helper = IAMHeaderSigningHelper(
3535
endpoint: endpoint,
3636
payload: message.payload?.data ?? "",
3737
region: region) else {
@@ -57,7 +57,7 @@ class IAMAuthInterceptor: AuthInterceptor {
5757
let url = endpoint.appendingPathComponent(RealtimeProviderConstants.iamConnectPath)
5858
let payloadString = SubscriptionConstants.emptyPayload
5959

60-
guard let helper = HeaderIAMSigningHelper(
60+
guard let helper = IAMHeaderSigningHelper(
6161
endpoint: url,
6262
payload: payloadString,
6363
region: region) else {
@@ -139,7 +139,7 @@ class IAMAuthInterceptor: AuthInterceptor {
139139
_ endpoint: URL,
140140
with payload: String) -> IAMAuthenticationHeader? {
141141

142-
guard let helper = HeaderIAMSigningHelper(
142+
guard let helper = IAMHeaderSigningHelper(
143143
endpoint: endpoint,
144144
payload: payload,
145145
region: region) else {
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import Foundation
99
import AWSCore
1010
import AppSyncRealTimeClient
1111

12-
struct HeaderIAMSigningHelper {
12+
/// Helper class to created signed header information for the request
13+
///
14+
struct IAMHeaderSigningHelper {
1315

1416
let host: String
1517
let date: String

AmplifyPlugins/API/AWSAPICategoryPluginTests/Interceptor/SubscriptionInterceptor/IAMAuthInterceptorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class IAMAuthInterceptorTests: XCTestCase {
9898
let request = NSMutableURLRequest(url: url)
9999
request.addValue("headerValue", forHTTPHeaderField: "extra-header")
100100
let signer = MockAWSSignatureV4Signer()
101-
let signingHelper = HeaderIAMSigningHelper(
101+
let signingHelper = IAMHeaderSigningHelper(
102102
endpoint: url,
103103
payload: "payload",
104104
region: .USWest2,

0 commit comments

Comments
 (0)