Skip to content

Commit 2a5472f

Browse files
authored
feat(AWSPluginsCore): Add non-blocking methods to AWSAuthServiceBehavior / deprecate existing blocking methods (#1502)
1 parent d979288 commit 2a5472f

File tree

6 files changed

+249
-19
lines changed

6 files changed

+249
-19
lines changed

Amplify.xcodeproj/project.pbxproj

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@
289289
76C0F4EC26797F4500F0E6AB /* AuthModeStrategyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76C0F4EA26797F3C00F0E6AB /* AuthModeStrategyTests.swift */; };
290290
76FFFC91267966D9001EC92B /* RetryableGraphQLOperationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FFFC90267966D9001EC92B /* RetryableGraphQLOperationTests.swift */; };
291291
8484A17AAAFE78545A932849 /* Pods_Amplify.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A1769ED39B45A981FD1D8AC /* Pods_Amplify.framework */; };
292+
90A8901327619D780042C3C1 /* AWSAuthServiceBehaviorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90A8901227619D780042C3C1 /* AWSAuthServiceBehaviorTests.swift */; };
292293
950A26DB23D15D7E00D92B19 /* PredictionsTranslateTextOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950A26D823D15D7E00D92B19 /* PredictionsTranslateTextOperation.swift */; };
293294
950A26DC23D15D7E00D92B19 /* PredictionsTextToSpeechOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950A26D923D15D7E00D92B19 /* PredictionsTextToSpeechOperation.swift */; };
294295
950A26DD23D15D7E00D92B19 /* PredictionsSpeechToTextOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950A26DA23D15D7E00D92B19 /* PredictionsSpeechToTextOperation.swift */; };
@@ -1147,6 +1148,7 @@
11471148
7D502982E80B9B2796D71A48 /* Pods-Amplify-AWSPluginsCore-AWSPluginsTestConfigs-AWSPluginsTestCommon.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Amplify-AWSPluginsCore-AWSPluginsTestConfigs-AWSPluginsTestCommon.debug.xcconfig"; path = "Target Support Files/Pods-Amplify-AWSPluginsCore-AWSPluginsTestConfigs-AWSPluginsTestCommon/Pods-Amplify-AWSPluginsCore-AWSPluginsTestConfigs-AWSPluginsTestCommon.debug.xcconfig"; sourceTree = "<group>"; };
11481149
852B5530E9E8794DAC86E44E /* Pods-Amplify-AmplifyTestConfigs-AmplifyTestCommon.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Amplify-AmplifyTestConfigs-AmplifyTestCommon.release.xcconfig"; path = "Target Support Files/Pods-Amplify-AmplifyTestConfigs-AmplifyTestCommon/Pods-Amplify-AmplifyTestConfigs-AmplifyTestCommon.release.xcconfig"; sourceTree = "<group>"; };
11491150
8E125EAA66C26B6F0705BB0C /* Pods-Amplify-AmplifyTestConfigs-AmplifyFunctionalTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Amplify-AmplifyTestConfigs-AmplifyFunctionalTests.release.xcconfig"; path = "Target Support Files/Pods-Amplify-AmplifyTestConfigs-AmplifyFunctionalTests/Pods-Amplify-AmplifyTestConfigs-AmplifyFunctionalTests.release.xcconfig"; sourceTree = "<group>"; };
1151+
90A8901227619D780042C3C1 /* AWSAuthServiceBehaviorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSAuthServiceBehaviorTests.swift; sourceTree = "<group>"; };
11501152
950A26D823D15D7E00D92B19 /* PredictionsTranslateTextOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PredictionsTranslateTextOperation.swift; sourceTree = "<group>"; };
11511153
950A26D923D15D7E00D92B19 /* PredictionsTextToSpeechOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PredictionsTextToSpeechOperation.swift; sourceTree = "<group>"; };
11521154
950A26DA23D15D7E00D92B19 /* PredictionsSpeechToTextOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PredictionsSpeechToTextOperation.swift; sourceTree = "<group>"; };
@@ -2372,6 +2374,7 @@
23722374
76C0F4EA26797F3C00F0E6AB /* AuthModeStrategyTests.swift */,
23732375
211A82002718631800C5483D /* AWSAuthorizationTypeTests.swift */,
23742376
6BEE0816253114FD00133961 /* AWSAuthServiceTests.swift */,
2377+
90A8901227619D780042C3C1 /* AWSAuthServiceBehaviorTests.swift */,
23752378
);
23762379
path = Auth;
23772380
sourceTree = "<group>";
@@ -4676,6 +4679,7 @@
46764679
21A3FDB9246494CD00E76120 /* GraphQLRequestAuthRuleTests.swift in Sources */,
46774680
21A3FDB62464590600E76120 /* ModelMultipleOwnerAuthRuleTests.swift in Sources */,
46784681
6B5087BD2565E5AD000AB673 /* QueryPredicateEvaluateGeneratedDoubleTests.swift in Sources */,
4682+
90A8901327619D780042C3C1 /* AWSAuthServiceBehaviorTests.swift in Sources */,
46794683
6B5087C5256632D3000AB673 /* QueryPredicateEvaluateGeneratedStringTests.swift in Sources */,
46804684
76C0F4EC26797F4500F0E6AB /* AuthModeStrategyTests.swift in Sources */,
46814685
2129BE3A2394828B006363A1 /* QueryPredicateGraphQLTests.swift in Sources */,
@@ -5508,6 +5512,7 @@
55085512
baseConfigurationReference = 1FA86170C161C5E46E57A5F9 /* Pods-Amplify-AWSPluginsCore.debug.xcconfig */;
55095513
buildSettings = {
55105514
CLANG_ENABLE_MODULES = YES;
5515+
CODE_SIGN_IDENTITY = "Apple Development";
55115516
CODE_SIGN_STYLE = Automatic;
55125517
DEFINES_MODULE = YES;
55135518
DEVELOPMENT_TEAM = "";
@@ -5536,6 +5541,7 @@
55365541
baseConfigurationReference = 09D90ABD9EDED6D6B1780253 /* Pods-Amplify-AWSPluginsCore.release.xcconfig */;
55375542
buildSettings = {
55385543
CLANG_ENABLE_MODULES = YES;
5544+
CODE_SIGN_IDENTITY = "Apple Development";
55395545
CODE_SIGN_STYLE = Automatic;
55405546
DEFINES_MODULE = YES;
55415547
DEVELOPMENT_TEAM = "";
@@ -5564,7 +5570,7 @@
55645570
buildSettings = {
55655571
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
55665572
CODE_SIGN_STYLE = Automatic;
5567-
DEVELOPMENT_TEAM = W3DRXD72QU;
5573+
DEVELOPMENT_TEAM = "";
55685574
INFOPLIST_FILE = AmplifyPlugins/Core/AWSPluginsCoreTests/Info.plist;
55695575
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
55705576
LD_RUNPATH_SEARCH_PATHS = (
@@ -5608,7 +5614,7 @@
56085614
buildSettings = {
56095615
CODE_SIGN_STYLE = Automatic;
56105616
DEFINES_MODULE = YES;
5611-
DEVELOPMENT_TEAM = W3DRXD72QU;
5617+
DEVELOPMENT_TEAM = "";
56125618
DYLIB_COMPATIBILITY_VERSION = 1;
56135619
DYLIB_CURRENT_VERSION = 1;
56145620
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -5634,7 +5640,7 @@
56345640
buildSettings = {
56355641
CODE_SIGN_STYLE = Automatic;
56365642
DEFINES_MODULE = YES;
5637-
DEVELOPMENT_TEAM = W3DRXD72QU;
5643+
DEVELOPMENT_TEAM = "";
56385644
DYLIB_COMPATIBILITY_VERSION = 1;
56395645
DYLIB_CURRENT_VERSION = 1;
56405646
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -5780,7 +5786,7 @@
57805786
isa = XCBuildConfiguration;
57815787
baseConfigurationReference = 7B9806D365E82306EE138710 /* Pods-Amplify.debug.xcconfig */;
57825788
buildSettings = {
5783-
CODE_SIGN_IDENTITY = "";
5789+
CODE_SIGN_IDENTITY = "Apple Development";
57845790
CODE_SIGN_STYLE = Automatic;
57855791
DEFINES_MODULE = YES;
57865792
DEVELOPMENT_TEAM = "";
@@ -5807,7 +5813,7 @@
58075813
isa = XCBuildConfiguration;
58085814
baseConfigurationReference = D4D30E30A8210AC1B2F74F4C /* Pods-Amplify.release.xcconfig */;
58095815
buildSettings = {
5810-
CODE_SIGN_IDENTITY = "";
5816+
CODE_SIGN_IDENTITY = "Apple Development";
58115817
CODE_SIGN_STYLE = Automatic;
58125818
DEFINES_MODULE = YES;
58135819
DEVELOPMENT_TEAM = "";
@@ -5915,7 +5921,7 @@
59155921
baseConfigurationReference = F8459E074A4A470F48829BEE /* Pods-Amplify-AmplifyTestConfigs-AmplifyTestCommon.debug.xcconfig */;
59165922
buildSettings = {
59175923
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
5918-
CODE_SIGN_IDENTITY = "";
5924+
CODE_SIGN_IDENTITY = "Apple Development";
59195925
CODE_SIGN_STYLE = Automatic;
59205926
DEFINES_MODULE = YES;
59215927
DEVELOPMENT_TEAM = "";
@@ -5948,7 +5954,7 @@
59485954
baseConfigurationReference = 852B5530E9E8794DAC86E44E /* Pods-Amplify-AmplifyTestConfigs-AmplifyTestCommon.release.xcconfig */;
59495955
buildSettings = {
59505956
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
5951-
CODE_SIGN_IDENTITY = "";
5957+
CODE_SIGN_IDENTITY = "Apple Development";
59525958
CODE_SIGN_STYLE = Automatic;
59535959
DEFINES_MODULE = YES;
59545960
DEVELOPMENT_TEAM = "";

AmplifyPlugins/Core/AWSPluginsCore/Auth/AWSAuthService.swift

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,28 @@ public class AWSAuthService: AWSAuthServiceBehavior {
1717
return AmplifyAWSCredentialsProvider()
1818
}
1919

20+
/// Retrieves the identity identifier for this authentication session from Cognito.
21+
/// - Parameter completion: Completion handler defined for the input `Result<String, AuthError>`
22+
public func getIdentityID(completion: @escaping (Result<String, AuthError>) -> Void) {
23+
Amplify.Auth.fetchAuthSession { event in
24+
switch event {
25+
case .success(let session):
26+
guard
27+
let identityID = (session as? AuthCognitoIdentityProvider)?.getIdentityId()
28+
else {
29+
return completion(.failure(.unknown("""
30+
Did not receive a valid response from fetchAuthSession for identityId.
31+
""")))
32+
}
33+
34+
completion(identityID)
35+
case .failure(let error):
36+
completion(.failure(error))
37+
}
38+
}
39+
}
40+
41+
@available(*, deprecated, message: "Use getIdentityID(completion:) instead")
2042
public func getIdentityId() -> Result<String, AuthError> {
2143
var result: Result<String, AuthError>?
2244
let semaphore = DispatchSemaphore(value: 0)
@@ -43,21 +65,22 @@ public class AWSAuthService: AWSAuthServiceBehavior {
4365
}
4466

4567
// This algorithm was heavily based on the implementation here:
46-
// https://github.com/aws-amplify/aws-sdk-ios/blob/main/AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClientExtensions.swift#L29
68+
// swiftlint:disable:next line_length
69+
// https://github.com/aws-amplify/aws-sdk-ios/blob/main/AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClientExtensions.swift#L29
4770
public func getTokenClaims(tokenString: String) -> Result<[String: AnyObject], AuthError> {
4871
let tokenSplit = tokenString.split(separator: ".")
4972
guard tokenSplit.count > 2 else {
5073
return .failure(.validation("", "Token is not valid base64 encoded string.", "", nil))
5174
}
5275

53-
//Add ability to do URL decoding
54-
//https://stackoverflow.com/questions/40915607/how-can-i-decode-jwt-json-web-token-token-in-swift
76+
// Add ability to do URL decoding
77+
// https://stackoverflow.com/questions/40915607/how-can-i-decode-jwt-json-web-token-token-in-swift
5578
let claims = tokenSplit[1]
5679
.replacingOccurrences(of: "-", with: "+")
5780
.replacingOccurrences(of: "_", with: "/")
5881

5982
let paddedLength = claims.count + (4 - (claims.count % 4)) % 4
60-
//JWT is not padded with =, pad it if necessary
83+
// JWT is not padded with =, pad it if necessary
6184
let updatedClaims = claims.padding(toLength: paddedLength, withPad: "=", startingAt: 0)
6285
let encodedData = Data(base64Encoded: updatedClaims, options: .ignoreUnknownCharacters)
6386

@@ -84,6 +107,27 @@ public class AWSAuthService: AWSAuthServiceBehavior {
84107
return .success(convertedDictionary)
85108
}
86109

110+
/// Retrieves the Cognito token from the AuthCognitoTokensProvider
111+
/// - Parameter completion: Completion handler defined for the input `Result<String, AuthError>`
112+
public func getUserPoolAccessToken(completion: @escaping (Result<String, AuthError>) -> Void) {
113+
Amplify.Auth.fetchAuthSession { [weak self] event in
114+
switch event {
115+
case .success(let session):
116+
guard
117+
let tokenResult = self?.getTokenString(from: session)
118+
else {
119+
return completion(.failure(.unknown("""
120+
Did not receive a valid response from fetchAuthSession for get token.
121+
""")))
122+
}
123+
completion(tokenResult)
124+
case .failure(let error):
125+
completion(.failure(error))
126+
}
127+
}
128+
}
129+
130+
@available(*, deprecated, message: "Use getUserPoolAccessToken(completion:) instead")
87131
public func getToken() -> Result<String, AuthError> {
88132
var result: Result<String, AuthError>?
89133
let semaphore = DispatchSemaphore(value: 0)

AmplifyPlugins/Core/AWSPluginsCore/Auth/AWSAuthServiceBehavior.swift

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,67 @@ public protocol AWSAuthServiceBehavior: AnyObject {
1212

1313
func getCredentialsProvider() -> AWSCredentialsProvider
1414

15+
@available(*, deprecated, message: "Use getIdentityID(completion:) instead")
1516
func getIdentityId() -> Result<String, AuthError>
1617

18+
@available(*, deprecated, message: "Use getUserPoolAccessToken(completion:) instead")
1719
func getToken() -> Result<String, AuthError>
1820

1921
func getTokenClaims(tokenString: String) -> Result<[String: AnyObject], AuthError>
22+
23+
/// Retrieves the identity identifier of for the Auth service
24+
/// - Parameter completion: Completion handler defined for the input `Result<String, AuthError>`
25+
func getIdentityID(completion: @escaping (Result<String, AuthError>) -> Void)
26+
27+
/// Retrieves the token from the Auth token provider
28+
/// - Parameter completion: Completion handler defined for the input `Result<String, AuthError>`
29+
func getUserPoolAccessToken(completion: @escaping (Result<String, AuthError>) -> Void)
30+
}
31+
32+
extension AWSAuthServiceBehavior {
33+
// MARK: List of Amplify internal usages of now deprecated AWSAuthServiceBehavior methods.
34+
/**
35+
`StorageAccessLevelAwarePrefixResolver`
36+
- File Path: `AmplifyPlugins/Storage/AWSS3StoragePlugin/Configuration/AWSS3PluginPrefixResolver.swift`
37+
- Uses: `getIdentityId()`
38+
39+
`IncomingAsyncSubscriptionEventPublisher`
40+
- File Path: `AmplifyPlugins/Core/AWSPluginsCore/Auth/AWSAuthServiceBehavior.swift`
41+
- Uses: `getToken()`
42+
43+
`BasicUserPoolTokenProvider`
44+
- File Path: `AmplifyPlugins/Core/AWSPluginsCore/Auth/Provider/AuthTokenProvider.swift`
45+
- Uses: `getToken()`
46+
47+
`AWSOIDCAuthProvider`
48+
- File Path: `AmplifyPlugins/API/AWSAPICategoryPlugin/SubscriptionFactory/AWSOIDCAuthProvider.swift`
49+
- Uses: `getToken()`
50+
51+
`AWSAuthServiceBehavior` protocol extension.
52+
Default implementation of new completion handler APIs to prevent breaking change.
53+
- File Path: `AmplifyPlugins/Core/AWSPluginsCore/Auth/AWSAuthServiceBehavior.swift`
54+
- Uses: `getToken()`, `getIdentityId()`
55+
*/
56+
57+
/// Retrieves the identity identifier of for the Auth service
58+
/// - Parameter completion: Completion handler defined for the input `Result<String, AuthError>`
59+
/// - Note: This default implementation was added to prevent a breaking change,
60+
/// and will be removed when the blocking API versions are removed.
61+
public func getIdentityID(completion: @escaping (Result<String, AuthError>) -> Void) {
62+
DispatchQueue.global().async { [weak self] in
63+
guard let identityIdResult = self?.getIdentityId() else { return }
64+
completion(identityIdResult)
65+
}
66+
}
67+
68+
/// Retrieves the token from the Auth token provider
69+
/// - Parameter completion: Completion handler defined for the input `Result<String, AuthError>`
70+
/// - Note: This default implementation was added to prevent a breaking change,
71+
/// and will be removed when the blocking API versions are removed.
72+
public func getUserPoolAccessToken(completion: @escaping (Result<String, AuthError>) -> Void) {
73+
DispatchQueue.global().async { [weak self] in
74+
guard let tokenResult = self?.getToken() else { return }
75+
completion(tokenResult)
76+
}
77+
}
2078
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
//
2+
// Copyright Amazon.com Inc. or its affiliates.
3+
// All Rights Reserved.
4+
//
5+
// SPDX-License-Identifier: Apache-2.0
6+
//
7+
8+
import XCTest
9+
10+
@testable import Amplify
11+
@testable import AWSPluginsCore
12+
import AWSCore
13+
14+
class AWSAuthServiceBehaviorTests: XCTestCase {
15+
// MARK: Tests for change from blocking to non-blocking
16+
/**
17+
Confirm that calling the non-blocking replacements of `getIdentityId()` (`getIdentityID(completion:)`)
18+
and `getToken()` (`getUserPoolAccessToken(completion:)`) in `AWSAuthServiceBehavior` conforming
19+
objects that have yet to implement the non-blocking methods, will act as a pass through to
20+
the existing blocking methods.
21+
22+
- IMPORTANT: This tests can be removed after the deprecation process of
23+
the blocking methods `getIdentityId` and `getToken` is complete
24+
*/
25+
26+
func testNonBlockingDefaultImplementationSuccess() {
27+
let mockAWSAuthService: AWSAuthServiceBehavior = _MockAWSAuthService.init(
28+
identityID: .success("42"),
29+
userPoolAccessToken: .success("25")
30+
)
31+
32+
/// Calling `getIdentityID(completion:)` on an `AWSAuthServiceBehavior` conforming type
33+
/// without an explicit implementation should use the now deprecated `getIdentityId()` method as a
34+
/// default implementation.
35+
mockAWSAuthService.getIdentityID {
36+
switch $0 {
37+
case .success(let id): XCTAssertEqual(id, "42")
38+
case .failure: XCTFail("This instance of _MockAWSAuthService should return .success")
39+
}
40+
}
41+
42+
/// Calling `getUserPoolAccessToken(completion:)` on an `AWSAuthServiceBehavior` conforming type
43+
/// without an explicit implementation should use the now deprecated `getToken()` method as a
44+
/// default implementation.
45+
mockAWSAuthService.getUserPoolAccessToken {
46+
switch $0 {
47+
case .success(let id): XCTAssertEqual(id, "25")
48+
case .failure: XCTFail("This instance of _MockAWSAuthService should return .success")
49+
}
50+
}
51+
}
52+
53+
func testNonBlockingDefaultImplementationFailure() {
54+
let identityIDErrorDescription = "identityID_description"
55+
let identityIDErrorRecovery = "identityID_recovery"
56+
57+
let userPoolAccessTokenIDErrorDescription = "userPoolAccessToken_description"
58+
let userPoolAccessTokenIDErrorRecovery = "userPoolAccessToken_recovery"
59+
60+
let mockAWSAuthService: AWSAuthServiceBehavior = _MockAWSAuthService.init(
61+
identityID: .failure(
62+
.notAuthorized(
63+
identityIDErrorDescription,
64+
identityIDErrorRecovery
65+
)
66+
),
67+
userPoolAccessToken: .failure(
68+
.invalidState(
69+
userPoolAccessTokenIDErrorDescription,
70+
userPoolAccessTokenIDErrorRecovery
71+
)
72+
)
73+
)
74+
75+
/// Calling `getIdentityID(completion:)` on an `AWSAuthServiceBehavior` conforming type
76+
/// without an explicit implementation should use the now deprecated `getIdentityId()` method as a
77+
/// default implementation.
78+
mockAWSAuthService.getIdentityID {
79+
switch $0 {
80+
case let .failure(.notAuthorized(description, recovery, _)):
81+
XCTAssertEqual(description, identityIDErrorDescription)
82+
XCTAssertEqual(recovery, identityIDErrorRecovery)
83+
default: XCTFail("This instance of _MockAWSAuthService should return .failure(.notAuthorized)")
84+
}
85+
}
86+
87+
/// Calling `getUserPoolAccessToken(completion:)` on an `AWSAuthServiceBehavior` conforming type
88+
/// without an explicit implementation should use the now deprecated `getToken()` method as a
89+
/// default implementation.
90+
mockAWSAuthService.getUserPoolAccessToken {
91+
switch $0 {
92+
case let .failure(.invalidState(description, recovery, _)):
93+
XCTAssertEqual(description, userPoolAccessTokenIDErrorDescription)
94+
XCTAssertEqual(recovery, userPoolAccessTokenIDErrorRecovery)
95+
default: XCTFail("This instance of _MockAWSAuthService should return .failure(.invalidState)")
96+
}
97+
}
98+
}
99+
}
100+
101+
fileprivate class _MockAWSAuthService: AWSAuthServiceBehavior {
102+
let identityID: () -> Result<String, AuthError>
103+
let userPoolAccessToken: () -> Result<String, AuthError>
104+
105+
init(
106+
identityID: @escaping @autoclosure () -> Result<String, AuthError>,
107+
userPoolAccessToken: @escaping @autoclosure () -> Result<String, AuthError>
108+
) {
109+
self.identityID = identityID
110+
self.userPoolAccessToken = userPoolAccessToken
111+
}
112+
113+
func getCredentialsProvider() -> AWSCredentialsProvider {
114+
AWSCognitoCredentialsProvider()
115+
}
116+
117+
func getIdentityId() -> Result<String, AuthError> {
118+
identityID()
119+
}
120+
121+
func getToken() -> Result<String, AuthError> {
122+
userPoolAccessToken()
123+
}
124+
125+
func getTokenClaims(tokenString: String) -> Result<[String: AnyObject], AuthError> {
126+
.success([:])
127+
}
128+
}

0 commit comments

Comments
 (0)