@@ -209,7 +209,7 @@ public struct LoginCredentialsProvider: CredentialProvider {
209209 }
210210}
211211
212- // MARK: - Factory
212+ // MARK: - Initializers
213213
214214@available ( macOS 13 . 0 , iOS 14 . 0 , tvOS 14 . 0 , watchOS 7 . 0 , * )
215215extension LoginCredentialsProvider {
@@ -218,19 +218,19 @@ extension LoginCredentialsProvider {
218218 /// - profileName: Name of the profile in ~/.aws/config (defaults to "default")
219219 /// - cacheDirectoryOverride: Optional override for token cache directory
220220 /// - httpClient: HTTP client for making requests
221- /// - Returns: LoginCredentialsProvider instance
222- public static func create (
221+ /// - Throws: AWSLoginCredentialError if configuration cannot be loaded
222+ public init (
223223 profileName: String ? = nil ,
224224 cacheDirectoryOverride: String ? = nil ,
225225 httpClient: AWSHTTPClient
226- ) throws -> LoginCredentialsProvider {
226+ ) throws {
227227 let loader = ProfileConfigurationLoader ( )
228228 let configuration = try loader. loadConfiguration (
229229 profileName: profileName,
230230 cacheDirectoryOverride: cacheDirectoryOverride
231231 )
232232
233- return LoginCredentialsProvider (
233+ self . init (
234234 configuration: configuration,
235235 httpClient: httpClient
236236 )
@@ -256,7 +256,7 @@ extension CredentialProviderFactory {
256256 ) -> CredentialProviderFactory {
257257 . custom { context in
258258 guard
259- let provider = try ? LoginCredentialsProvider . create (
259+ let provider = try ? LoginCredentialsProvider (
260260 profileName: profileName,
261261 cacheDirectoryOverride: cacheDirectoryOverride,
262262 httpClient: context. httpClient
0 commit comments