From 9455af4e70c4309e96e7e6210c1b5a742b535794 Mon Sep 17 00:00:00 2001 From: Gus Narea Date: Wed, 10 Mar 2021 22:56:34 +0000 Subject: [PATCH] fix(PrivateThirdPartyEndpoint): Swap order of load() params --- .../relaycorp/relaydroid/endpoint/ThirdPartyEndpoint.kt | 6 +++--- .../relaydroid/endpoint/PrivateThirdPartyEndpointTest.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/main/java/tech/relaycorp/relaydroid/endpoint/ThirdPartyEndpoint.kt b/lib/src/main/java/tech/relaycorp/relaydroid/endpoint/ThirdPartyEndpoint.kt index ab17f532..29d68d19 100644 --- a/lib/src/main/java/tech/relaycorp/relaydroid/endpoint/ThirdPartyEndpoint.kt +++ b/lib/src/main/java/tech/relaycorp/relaydroid/endpoint/ThirdPartyEndpoint.kt @@ -25,7 +25,7 @@ public sealed class ThirdPartyEndpoint( thirdPartyPrivateAddress: String ): ThirdPartyEndpoint? = PublicThirdPartyEndpoint.load(thirdPartyPrivateAddress) - ?: PrivateThirdPartyEndpoint.load(firstPartyAddress, thirdPartyPrivateAddress) + ?: PrivateThirdPartyEndpoint.load(thirdPartyPrivateAddress, firstPartyAddress) } } @@ -49,8 +49,8 @@ public class PrivateThirdPartyEndpoint internal constructor( */ @Throws(PersistenceException::class) public suspend fun load( - firstPartyAddress: String, - thirdPartyAddress: String + thirdPartyAddress: String, + firstPartyAddress: String ): PrivateThirdPartyEndpoint? { val key = "${firstPartyAddress}_$thirdPartyAddress" return Storage.thirdPartyAuthorization.get(key)?.let { auth -> diff --git a/lib/src/test/java/tech/relaycorp/relaydroid/endpoint/PrivateThirdPartyEndpointTest.kt b/lib/src/test/java/tech/relaycorp/relaydroid/endpoint/PrivateThirdPartyEndpointTest.kt index a158f08f..e70f5b5e 100644 --- a/lib/src/test/java/tech/relaycorp/relaydroid/endpoint/PrivateThirdPartyEndpointTest.kt +++ b/lib/src/test/java/tech/relaycorp/relaydroid/endpoint/PrivateThirdPartyEndpointTest.kt @@ -45,7 +45,7 @@ internal class PrivateThirdPartyEndpointTest { val firstAddress = UUID.randomUUID().toString() val thirdAddress = UUID.randomUUID().toString() - with(PrivateThirdPartyEndpoint.load(firstAddress, thirdAddress)!!) { + with(PrivateThirdPartyEndpoint.load(thirdAddress, firstAddress)!!) { assertEquals(firstAddress, firstPartyEndpointAddress) assertEquals(PDACertPath.PRIVATE_ENDPOINT.subjectPrivateAddress, address) assertEquals(PDACertPath.PRIVATE_ENDPOINT, pda)