mirror of
https://github.com/bitwarden/android.git
synced 2026-03-21 22:00:42 -05:00
[PM-19858] Migrate HaveIBeenPwnedApi to network module (#4988)
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package com.x8bit.bitwarden.data.auth.datasource.network.api
|
||||
|
||||
import com.bitwarden.network.model.NetworkResult
|
||||
import okhttp3.ResponseBody
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Path
|
||||
|
||||
/**
|
||||
* Defines endpoints for the "have I been pwned" API. For docs see
|
||||
* https://haveibeenpwned.com/API/v2.
|
||||
*/
|
||||
interface HaveIBeenPwnedApi {
|
||||
|
||||
@GET("/range/{hashPrefix}")
|
||||
suspend fun fetchBreachedPasswords(
|
||||
@Path("hashPrefix")
|
||||
hashPrefix: String,
|
||||
): NetworkResult<ResponseBody>
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.x8bit.bitwarden.data.auth.datasource.network.service
|
||||
|
||||
import com.bitwarden.network.api.HaveIBeenPwnedApi
|
||||
import com.bitwarden.network.util.toResult
|
||||
import com.x8bit.bitwarden.data.auth.datasource.network.api.HaveIBeenPwnedApi
|
||||
import java.security.MessageDigest
|
||||
|
||||
class HaveIBeenPwnedServiceImpl(private val api: HaveIBeenPwnedApi) : HaveIBeenPwnedService {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.x8bit.bitwarden.data.auth.datasource.network.service
|
||||
|
||||
import com.bitwarden.network.api.HaveIBeenPwnedApi
|
||||
import com.bitwarden.network.base.BaseServiceTest
|
||||
import com.x8bit.bitwarden.data.auth.datasource.network.api.HaveIBeenPwnedApi
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import okhttp3.mockwebserver.MockResponse
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
|
||||
Reference in New Issue
Block a user