@@ -21,15 +21,15 @@ struct Auth0Authentication: Authentication {
2121 self . telemetry = telemetry
2222 }
2323
24- func login( email: String , code: String , audience: String ? , scope: String ) -> Request < Credentials , AuthenticationError > {
24+ func login( email: String , code: String , audience: String ? , scope: String ) -> any Requestable < Credentials , AuthenticationError > {
2525 return login ( username: email, otp: code, realm: " email " , audience: audience, scope: scope)
2626 }
2727
28- func login( phoneNumber: String , code: String , audience: String ? , scope: String ) -> Request < Credentials , AuthenticationError > {
28+ func login( phoneNumber: String , code: String , audience: String ? , scope: String ) -> any Requestable < Credentials , AuthenticationError > {
2929 return login ( username: phoneNumber, otp: code, realm: " sms " , audience: audience, scope: scope)
3030 }
3131
32- func login( usernameOrEmail username: String , password: String , realmOrConnection realm: String , audience: String ? , scope: String ) -> Request < Credentials , AuthenticationError > {
32+ func login( usernameOrEmail username: String , password: String , realmOrConnection realm: String , audience: String ? , scope: String ) -> any Requestable < Credentials , AuthenticationError > {
3333 let url = URL ( string: " oauth/token " , relativeTo: self . url) !
3434
3535 var payload : [ String : Any ] = [
@@ -52,7 +52,7 @@ struct Auth0Authentication: Authentication {
5252 dpop: self . dpop)
5353 }
5454
55- func loginDefaultDirectory( withUsername username: String , password: String , audience: String ? , scope: String ) -> Request < Credentials , AuthenticationError > {
55+ func loginDefaultDirectory( withUsername username: String , password: String , audience: String ? , scope: String ) -> any Requestable < Credentials , AuthenticationError > {
5656 let url = URL ( string: " oauth/token " , relativeTo: self . url) !
5757
5858 var payload : [ String : Any ] = [
@@ -74,7 +74,7 @@ struct Auth0Authentication: Authentication {
7474 dpop: self . dpop)
7575 }
7676
77- func login( withOTP otp: String , mfaToken: String ) -> Request < Credentials , AuthenticationError > {
77+ func login( withOTP otp: String , mfaToken: String ) -> any Requestable < Credentials , AuthenticationError > {
7878 let url = URL ( string: " oauth/token " , relativeTo: self . url) !
7979
8080 let payload : [ String : Any ] = [
@@ -94,7 +94,7 @@ struct Auth0Authentication: Authentication {
9494 dpop: self . dpop)
9595 }
9696
97- func login( withOOBCode oobCode: String , mfaToken: String , bindingCode: String ? ) -> Request < Credentials , AuthenticationError > {
97+ func login( withOOBCode oobCode: String , mfaToken: String , bindingCode: String ? ) -> any Requestable < Credentials , AuthenticationError > {
9898 let url = URL ( string: " oauth/token " , relativeTo: self . url) !
9999
100100 var payload : [ String : Any ] = [
@@ -118,7 +118,7 @@ struct Auth0Authentication: Authentication {
118118 dpop: self . dpop)
119119 }
120120
121- func login( withRecoveryCode recoveryCode: String , mfaToken: String ) -> Request < Credentials , AuthenticationError > {
121+ func login( withRecoveryCode recoveryCode: String , mfaToken: String ) -> any Requestable < Credentials , AuthenticationError > {
122122 let url = URL ( string: " oauth/token " , relativeTo: self . url) !
123123
124124 let payload : [ String : Any ] = [
@@ -138,7 +138,7 @@ struct Auth0Authentication: Authentication {
138138 dpop: self . dpop)
139139 }
140140
141- func multifactorChallenge( mfaToken: String , types: [ String ] ? , authenticatorId: String ? ) -> Request < Challenge , AuthenticationError > {
141+ func multifactorChallenge( mfaToken: String , types: [ String ] ? , authenticatorId: String ? ) -> any Requestable < Challenge , AuthenticationError > {
142142 let url = URL ( string: " mfa/challenge " , relativeTo: self . url) !
143143 var payload : [ String : String ] = [
144144 " mfa_token " : mfaToken,
@@ -166,7 +166,7 @@ struct Auth0Authentication: Authentication {
166166 fullName: PersonNameComponents ? ,
167167 profile: [ String : Any ] ? ,
168168 audience: String ? ,
169- scope: String ) -> Request < Credentials , AuthenticationError > {
169+ scope: String ) -> any Requestable < Credentials , AuthenticationError > {
170170 var parameters : [ String : Any ] = [ : ]
171171 var profile : [ String : Any ] = profile ?? [ : ]
172172
@@ -192,7 +192,7 @@ struct Auth0Authentication: Authentication {
192192 func login( facebookSessionAccessToken sessionAccessToken: String ,
193193 profile: [ String : Any ] ,
194194 audience: String ? ,
195- scope: String ) -> Request < Credentials , AuthenticationError > {
195+ scope: String ) -> any Requestable < Credentials , AuthenticationError > {
196196 var parameters : [ String : String ] = [ : ]
197197 if let jsonData = try ? JSONSerialization . data ( withJSONObject: profile, options: [ ] ) ,
198198 let json = String ( data: jsonData, encoding: . utf8) {
@@ -205,7 +205,7 @@ struct Auth0Authentication: Authentication {
205205 parameters: parameters)
206206 }
207207
208- func signup( email: String , username: String ? = nil , password: String , connection: String = " Username-Password-Authentication " , userMetadata: [ String : Any ] ? = nil , rootAttributes: [ String : Any ] ? = nil ) -> Request < DatabaseUser , AuthenticationError > {
208+ func signup( email: String , username: String ? = nil , password: String , connection: String = " Username-Password-Authentication " , userMetadata: [ String : Any ] ? = nil , rootAttributes: [ String : Any ] ? = nil ) -> any Requestable < DatabaseUser , AuthenticationError > {
209209 var payload : [ String : Any ] = [
210210 " email " : email,
211211 " password " : password,
@@ -237,7 +237,7 @@ struct Auth0Authentication: Authentication {
237237 connection: String ? ,
238238 audience: String ? ,
239239 scope: String ,
240- organization: String ? ) -> Request < Credentials , AuthenticationError > {
240+ organization: String ? ) -> any Requestable < Credentials , AuthenticationError > {
241241 let url = URL ( string: " oauth/token " , relativeTo: self . url) !
242242 let id = passkey. credentialID. encodeBase64URLSafe ( )
243243
@@ -278,7 +278,7 @@ struct Auth0Authentication: Authentication {
278278
279279 @available ( iOS 16 . 6 , macOS 13 . 5 , visionOS 1 . 0 , * )
280280 func passkeyLoginChallenge( connection: String ? ,
281- organization: String ? ) -> Request < PasskeyLoginChallenge , AuthenticationError > {
281+ organization: String ? ) -> any Requestable < PasskeyLoginChallenge , AuthenticationError > {
282282 let url = URL ( string: " passkey/challenge " , relativeTo: self . url) !
283283
284284 var payload : [ String : String ] = [ " client_id " : self . clientId]
@@ -300,7 +300,7 @@ struct Auth0Authentication: Authentication {
300300 connection: String ? ,
301301 audience: String ? ,
302302 scope: String ,
303- organization: String ? ) -> Request < Credentials , AuthenticationError > {
303+ organization: String ? ) -> any Requestable < Credentials , AuthenticationError > {
304304 let url = URL ( string: " oauth/token " , relativeTo: self . url) !
305305 let id = passkey. credentialID. encodeBase64URLSafe ( )
306306
@@ -344,7 +344,7 @@ struct Auth0Authentication: Authentication {
344344 username: String ? ,
345345 name: String ? ,
346346 connection: String ? ,
347- organization: String ? ) -> Request < PasskeySignupChallenge , AuthenticationError > {
347+ organization: String ? ) -> any Requestable < PasskeySignupChallenge , AuthenticationError > {
348348 let url = URL ( string: " passkey/register " , relativeTo: self . url) !
349349
350350 var userProfile : [ String : Any ] = [ : ]
@@ -370,7 +370,7 @@ struct Auth0Authentication: Authentication {
370370 }
371371 #endif
372372
373- func resetPassword( email: String , connection: String ) -> Request < Void , AuthenticationError > {
373+ func resetPassword( email: String , connection: String ) -> any Requestable < Void , AuthenticationError > {
374374 let payload = [
375375 " email " : email,
376376 " connection " : connection,
@@ -386,7 +386,7 @@ struct Auth0Authentication: Authentication {
386386 telemetry: self . telemetry)
387387 }
388388
389- func startPasswordless( email: String , type: PasswordlessType , connection: String ) -> Request < Void , AuthenticationError > {
389+ func startPasswordless( email: String , type: PasswordlessType , connection: String ) -> any Requestable < Void , AuthenticationError > {
390390 let payload : [ String : Any ] = [
391391 " email " : email,
392392 " connection " : connection,
@@ -404,7 +404,7 @@ struct Auth0Authentication: Authentication {
404404 telemetry: self . telemetry)
405405 }
406406
407- func startPasswordless( phoneNumber: String , type: PasswordlessType , connection: String ) -> Request < Void , AuthenticationError > {
407+ func startPasswordless( phoneNumber: String , type: PasswordlessType , connection: String ) -> any Requestable < Void , AuthenticationError > {
408408 let payload : [ String : Any ] = [
409409 " phone_number " : phoneNumber,
410410 " connection " : connection,
@@ -421,7 +421,7 @@ struct Auth0Authentication: Authentication {
421421 telemetry: self . telemetry)
422422 }
423423
424- func userInfo( withAccessToken accessToken: String , tokenType: String ) -> Request < UserInfo , AuthenticationError > {
424+ func userInfo( withAccessToken accessToken: String , tokenType: String ) -> any Requestable < UserInfo , AuthenticationError > {
425425 let userInfo = URL ( string: " userinfo " , relativeTo: self . url) !
426426 let method = " GET "
427427 let headers = self . baseHeaders ( accessToken: accessToken, tokenType: tokenType)
@@ -436,7 +436,7 @@ struct Auth0Authentication: Authentication {
436436 dpop: dpop)
437437 }
438438
439- func codeExchange( withCode code: String , codeVerifier: String , redirectURI: String ) -> Request < Credentials , AuthenticationError > {
439+ func codeExchange( withCode code: String , codeVerifier: String , redirectURI: String ) -> any Requestable < Credentials , AuthenticationError > {
440440 return self . token ( ) . parameters ( [
441441 " code " : code,
442442 " code_verifier " : codeVerifier,
@@ -445,15 +445,15 @@ struct Auth0Authentication: Authentication {
445445 ] )
446446 }
447447
448- func ssoExchange( withRefreshToken refreshToken: String ) -> Request < SSOCredentials , AuthenticationError > {
448+ func ssoExchange( withRefreshToken refreshToken: String ) -> any Requestable < SSOCredentials , AuthenticationError > {
449449 return self . token ( ) . parameters ( [
450450 " refresh_token " : refreshToken,
451451 " grant_type " : " refresh_token " ,
452452 " audience " : " urn: \( self . url. host!) :session_transfer "
453453 ] )
454454 }
455455
456- func renew( withRefreshToken refreshToken: String , audience: String ? = nil , scope: String ? = nil ) -> Request < Credentials , AuthenticationError > {
456+ func renew( withRefreshToken refreshToken: String , audience: String ? = nil , scope: String ? = nil ) -> any Requestable < Credentials , AuthenticationError > {
457457 let oauthToken = URL ( string: " oauth/token " , relativeTo: self . url) !
458458
459459 var payload : [ String : Any ] = [
@@ -481,7 +481,7 @@ struct Auth0Authentication: Authentication {
481481 dpop: self . dpop)
482482 }
483483
484- func revoke( refreshToken: String ) -> Request < Void , AuthenticationError > {
484+ func revoke( refreshToken: String ) -> any Requestable < Void , AuthenticationError > {
485485 let payload : [ String : Any ] = [
486486 " token " : refreshToken,
487487 " client_id " : self . clientId
@@ -496,7 +496,7 @@ struct Auth0Authentication: Authentication {
496496 telemetry: self . telemetry)
497497 }
498498
499- func jwks( ) -> Request < JWKS , AuthenticationError > {
499+ func jwks( ) -> any Requestable < JWKS , AuthenticationError > {
500500 let jwks = URL ( string: " .well-known/jwks.json " , relativeTo: self . url) !
501501 return Request ( session: session,
502502 url: jwks,
@@ -511,7 +511,7 @@ struct Auth0Authentication: Authentication {
511511 audience: String ? ,
512512 scope: String ,
513513 organization: String ? ,
514- parameters: [ String : Any ] ) -> Request < Credentials , AuthenticationError > {
514+ parameters: [ String : Any ] ) -> any Requestable < Credentials , AuthenticationError > {
515515 return self . tokenExchange ( subjectToken: subjectToken,
516516 subjectTokenType: subjectTokenType,
517517 scope: scope,
@@ -526,7 +526,7 @@ struct Auth0Authentication: Authentication {
526526
527527private extension Auth0Authentication {
528528
529- func login( username: String , otp: String , realm: String , audience: String ? , scope: String ) -> Request < Credentials , AuthenticationError > {
529+ func login( username: String , otp: String , realm: String , audience: String ? , scope: String ) -> any Requestable < Credentials , AuthenticationError > {
530530 let url = URL ( string: " oauth/token " , relativeTo: self . url) !
531531
532532 var payload : [ String : Any ] = [
@@ -554,7 +554,7 @@ private extension Auth0Authentication {
554554 scope: String ,
555555 audience: String ? ,
556556 organization: String ? = nil ,
557- parameters: [ String : Any ] = [ : ] ) -> Request < Credentials , AuthenticationError > {
557+ parameters: [ String : Any ] = [ : ] ) -> any Requestable < Credentials , AuthenticationError > {
558558 var parameters : [ String : Any ] = parameters
559559 parameters [ " client_id " ] = self . clientId
560560 parameters [ " grant_type " ] = " urn:ietf:params:oauth:grant-type:token-exchange "
@@ -575,7 +575,7 @@ private extension Auth0Authentication {
575575 dpop: dpop)
576576 }
577577
578- func token< T: Codable > ( ) -> Request < T , AuthenticationError > {
578+ func token< T: Codable > ( ) -> any Requestable < T , AuthenticationError > {
579579 let token = URL ( string: " oauth/token " , relativeTo: self . url) !
580580 let payload : [ String : Any ] = [ " client_id " : self . clientId]
581581
0 commit comments