From 24dfa7ebd05e428a81da71a81517f762823e65fd Mon Sep 17 00:00:00 2001 From: tomastiminskas Date: Mon, 27 Jul 2026 15:11:46 +0000 Subject: [PATCH] Generated with Hive: Add Hive authentication modules and repository orchestration for secure token storage --- settings.gradle | 2 + .../SphinxRepositoryAndroid.kt | 3 + .../features/feature-repository/build.gradle | 1 + .../feature_repository/SphinxRepository.kt | 35 ++++ .../SphinxRepositoryHiveAuthTest.kt | 189 ++++++++++++++++++ .../concept-network-query-hive/build.gradle | 16 ++ .../NetworkQueryHive.kt | 18 ++ .../model/HiveAuthRequestDto.kt | 11 + .../model/HiveAuthenticationTokenDto.kt | 6 + .../feature-network-query-hive/build.gradle | 19 ++ .../NetworkQueryHiveImpl.kt | 31 +++ .../HiveAuthRequestDtoTest.kt | 44 ++++ sphinx/application/sphinx/build.gradle | 1 + .../main/java/chat/sphinx/di/NetworkModule.kt | 14 ++ .../java/chat/sphinx/di/RepositoryModule.kt | 3 + 15 files changed, 393 insertions(+) create mode 100644 sphinx/application/data/features/feature-repository/src/test/java/chat/sphinx/feature_repository/SphinxRepositoryHiveAuthTest.kt create mode 100644 sphinx/application/network/concepts/queries/concept-network-query-hive/build.gradle create mode 100644 sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/NetworkQueryHive.kt create mode 100644 sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/model/HiveAuthRequestDto.kt create mode 100644 sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/model/HiveAuthenticationTokenDto.kt create mode 100644 sphinx/application/network/features/queries/feature-network-query-hive/build.gradle create mode 100644 sphinx/application/network/features/queries/feature-network-query-hive/src/main/java/chat/sphinx/feature_network_query_hive/NetworkQueryHiveImpl.kt create mode 100644 sphinx/application/network/features/queries/feature-network-query-hive/src/test/java/chat/sphinx/feature_network_query_hive/HiveAuthRequestDtoTest.kt diff --git a/settings.gradle b/settings.gradle index e265afae..358467a2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -99,6 +99,8 @@ include ':sphinx:application:network:concepts:queries:concept-network-query-disc include ':sphinx:application:network:features:queries:feature-network-query-discover-tribes' include ':sphinx:application:network:concepts:queries:concept-network-query-feed-status' include ':sphinx:application:network:features:queries:feature-network-query-feed-status' +include ':sphinx:application:network:concepts:queries:concept-network-query-hive' +include ':sphinx:application:network:features:queries:feature-network-query-hive' // Activity include ':sphinx:activity:hilt-qualifiers' diff --git a/sphinx/application/data/features/feature-repository-android/src/main/java/chat/sphinx/feature_repository_android/SphinxRepositoryAndroid.kt b/sphinx/application/data/features/feature-repository-android/src/main/java/chat/sphinx/feature_repository_android/SphinxRepositoryAndroid.kt index 09bdd217..e92cb6e8 100644 --- a/sphinx/application/data/features/feature-repository-android/src/main/java/chat/sphinx/feature_repository_android/SphinxRepositoryAndroid.kt +++ b/sphinx/application/data/features/feature-repository-android/src/main/java/chat/sphinx/feature_repository_android/SphinxRepositoryAndroid.kt @@ -14,6 +14,7 @@ import chat.sphinx.concept_network_query_invite.NetworkQueryInvite import chat.sphinx.concept_network_query_meme_server.NetworkQueryMemeServer import chat.sphinx.concept_network_query_feed_search.NetworkQueryFeedSearch import chat.sphinx.concept_network_query_feed_status.NetworkQueryFeedStatus +import chat.sphinx.concept_network_query_hive.NetworkQueryHive import chat.sphinx.concept_network_query_people.NetworkQueryPeople import chat.sphinx.concept_network_query_verify_external.NetworkQueryAuthorizeExternal import chat.sphinx.concept_paging.PageSourceWrapper @@ -61,6 +62,7 @@ class SphinxRepositoryAndroid( networkQueryPeople: NetworkQueryPeople, networkQueryFeedSearch: NetworkQueryFeedSearch, networkQueryFeedStatus: NetworkQueryFeedStatus, + networkQueryHive: NetworkQueryHive, connectManager: ConnectManager, dataSyncManager: DataSyncManager, walletDataHandler: WalletDataHandler, @@ -88,6 +90,7 @@ class SphinxRepositoryAndroid( networkQueryPeople, networkQueryFeedSearch, networkQueryFeedStatus, + networkQueryHive, connectManager, dataSyncManager, walletDataHandler, diff --git a/sphinx/application/data/features/feature-repository/build.gradle b/sphinx/application/data/features/feature-repository/build.gradle index 20d67407..454047cc 100644 --- a/sphinx/application/data/features/feature-repository/build.gradle +++ b/sphinx/application/data/features/feature-repository/build.gradle @@ -43,6 +43,7 @@ dependencies { api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-feed-search') api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-people') api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-feed-status') + api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-hive') api project(path: ':sphinx:application:data:concepts:concept-connect-manager') api project(path: ':sphinx:application:data:concepts:concept-wallet') api project(path: ':sphinx:application:common:wrappers:wrapper-common') diff --git a/sphinx/application/data/features/feature-repository/src/main/java/chat/sphinx/feature_repository/SphinxRepository.kt b/sphinx/application/data/features/feature-repository/src/main/java/chat/sphinx/feature_repository/SphinxRepository.kt index 9ed7d795..06d9ca36 100644 --- a/sphinx/application/data/features/feature-repository/src/main/java/chat/sphinx/feature_repository/SphinxRepository.kt +++ b/sphinx/application/data/features/feature-repository/src/main/java/chat/sphinx/feature_repository/SphinxRepository.kt @@ -16,6 +16,7 @@ import chat.sphinx.concept_network_query_feed_search.model.toFeedSearchResult import chat.sphinx.concept_network_query_feed_status.NetworkQueryFeedStatus import chat.sphinx.concept_network_query_feed_status.model.ContentFeedStatusDto import chat.sphinx.concept_network_query_feed_status.model.EpisodeStatusDto +import chat.sphinx.concept_network_query_hive.NetworkQueryHive import chat.sphinx.concept_network_query_invite.NetworkQueryInvite import chat.sphinx.concept_network_query_meme_server.NetworkQueryMemeServer import chat.sphinx.concept_network_query_people.NetworkQueryPeople @@ -208,6 +209,7 @@ abstract class SphinxRepository( private val networkQueryPeople: NetworkQueryPeople, private val networkQueryFeedSearch: NetworkQueryFeedSearch, private val networkQueryFeedStatus: NetworkQueryFeedStatus, + private val networkQueryHive: NetworkQueryHive, private val connectManager: ConnectManager, private val dataSyncManager: DataSyncManager, private val walletDataHandler: WalletDataHandler, @@ -236,6 +238,7 @@ abstract class SphinxRepository( // PersistentStorage Keys const val REPOSITORY_LIGHTNING_BALANCE = "REPOSITORY_LIGHTNING_BALANCE" const val REPOSITORY_PUSH_KEY = "REPOSITORY_PUSH_KEY" + const val HIVE_AUTHENTICATION_TOKEN = "HIVE_AUTHENTICATION_TOKEN" const val MEDIA_KEY_SIZE = 32 @@ -9596,6 +9599,38 @@ abstract class SphinxRepository( return byteArray } + + //////////////////// + /// Hive Auth /// + //////////////////// + + suspend fun authenticateWithHive(): Boolean { + retrieveHiveToken()?.let { return true } + + val signedToken = connectManager.getSignedTimeStamps() ?: return false + val pubkey = accountOwner.value?.nodePubKey?.value ?: return false + val timestamp = System.currentTimeMillis().toString() + + var success = false + networkQueryHive.authenticateWithHive(signedToken, pubkey, timestamp) + .collect { response -> + when (response) { + is Response.Success -> { + val jwt = response.value.token + ?.takeIf { it.isNotBlank() } + ?: return@collect + authenticationStorage.putString(HIVE_AUTHENTICATION_TOKEN, jwt) + success = true + } + else -> { /* success remains false */ } + } + } + return success + } + + suspend fun retrieveHiveToken(): String? { + return authenticationStorage.getString(HIVE_AUTHENTICATION_TOKEN, null) + } } @Suppress("NOTHING_TO_INLINE") diff --git a/sphinx/application/data/features/feature-repository/src/test/java/chat/sphinx/feature_repository/SphinxRepositoryHiveAuthTest.kt b/sphinx/application/data/features/feature-repository/src/test/java/chat/sphinx/feature_repository/SphinxRepositoryHiveAuthTest.kt new file mode 100644 index 00000000..777a4962 --- /dev/null +++ b/sphinx/application/data/features/feature-repository/src/test/java/chat/sphinx/feature_repository/SphinxRepositoryHiveAuthTest.kt @@ -0,0 +1,189 @@ +package chat.sphinx.feature_repository + +import chat.sphinx.concept_network_query_hive.NetworkQueryHive +import chat.sphinx.concept_network_query_hive.model.HiveAuthenticationTokenDto +import chat.sphinx.kotlin_response.LoadResponse +import chat.sphinx.kotlin_response.Response +import chat.sphinx.kotlin_response.ResponseError +import io.matthewnelson.concept_authentication.data.AuthenticationStorage +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.flow +import kotlinx.coroutines.runBlocking +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test + +/** + * Unit tests for [SphinxRepository.authenticateWithHive] and [SphinxRepository.retrieveHiveToken]. + * + * Uses simple in-memory fakes — no mocking framework needed. + */ +class SphinxRepositoryHiveAuthTest { + + // ── In-memory fakes ────────────────────────────────────────────────────── + + private val storage = FakeAuthenticationStorage() + + private var signedTimestamp: String? = null + private var ownerPubKey: String? = null + + private var networkResponse: LoadResponse = + Response.Error(ResponseError("default")) + + private val fakeNetworkQueryHive = object : NetworkQueryHive() { + override fun authenticateWithHive( + token: String, + pubkey: String, + timestamp: String, + ): Flow> = flow { + emit(networkResponse) + } + } + + private lateinit var subject: TestableSphinxRepository + + @Before + fun setUp() { + signedTimestamp = "signed_ts" + ownerPubKey = "03abc123" + networkResponse = Response.Error(ResponseError("default")) + storage.clear() + subject = TestableSphinxRepository( + storage = storage, + getSignedTs = { signedTimestamp }, + getPubKey = { ownerPubKey }, + networkQueryHive = fakeNetworkQueryHive, + ) + } + + // ── retrieveHiveToken ──────────────────────────────────────────────────── + + @Test + fun `retrieveHiveToken returns null when key absent`() = runBlocking { + assertNull(subject.retrieveHiveToken()) + } + + @Test + fun `retrieveHiveToken returns stored value`() = runBlocking { + storage.putString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, "myJwt") + assertEquals("myJwt", subject.retrieveHiveToken()) + } + + // ── authenticateWithHive ───────────────────────────────────────────────── + + @Test + fun `returns true immediately when token already cached`() = runBlocking { + storage.putString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, "cached") + // If this were to call getSignedTimeStamps it would fail — set to null to catch that + signedTimestamp = null + assertTrue(subject.authenticateWithHive()) + // Network was never consulted + assertFalse(storage.wasCalledFor("putString_after_auth")) + } + + @Test + fun `returns false when getSignedTimeStamps returns null`() = runBlocking { + signedTimestamp = null + val result = subject.authenticateWithHive() + assertFalse(result) + assertNull(storage.getString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, null)) + } + + @Test + fun `returns false when pubkey is null`() = runBlocking { + ownerPubKey = null + val result = subject.authenticateWithHive() + assertFalse(result) + assertNull(storage.getString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, null)) + } + + @Test + fun `returns true and persists token on success with valid token`() = runBlocking { + networkResponse = Response.Success(HiveAuthenticationTokenDto(token = "real_jwt")) + val result = subject.authenticateWithHive() + assertTrue(result) + assertEquals("real_jwt", storage.getString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, null)) + } + + @Test + fun `returns false and does NOT persist when dto token is null`() = runBlocking { + networkResponse = Response.Success(HiveAuthenticationTokenDto(token = null)) + val result = subject.authenticateWithHive() + assertFalse(result) + assertNull(storage.getString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, null)) + } + + @Test + fun `returns false and does NOT persist when dto token is blank`() = runBlocking { + networkResponse = Response.Success(HiveAuthenticationTokenDto(token = " ")) + val result = subject.authenticateWithHive() + assertFalse(result) + assertNull(storage.getString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, null)) + } + + @Test + fun `returns false on network error and storage untouched`() = runBlocking { + networkResponse = Response.Error(ResponseError("network failure")) + val result = subject.authenticateWithHive() + assertFalse(result) + assertNull(storage.getString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, null)) + } +} + +// ── Test doubles ───────────────────────────────────────────────────────────── + +class FakeAuthenticationStorage : AuthenticationStorage { + private val map = mutableMapOf() + private val sideEffects = mutableSetOf() + + fun clear() { map.clear(); sideEffects.clear() } + fun wasCalledFor(tag: String) = sideEffects.contains(tag) + + override suspend fun getString(key: String, defaultValue: String?): String? = map[key] ?: defaultValue + + override suspend fun putString(key: String, value: String?) { + if (value != null) map[key] = value else map.remove(key) + } + + override suspend fun removeString(key: String) { map.remove(key) } +} + +/** + * Minimal testable stub — only the fields needed by [authenticateWithHive] / [retrieveHiveToken]. + */ +class TestableSphinxRepository( + private val storage: FakeAuthenticationStorage, + private val getSignedTs: () -> String?, + private val getPubKey: () -> String?, + private val networkQueryHive: NetworkQueryHive, +) { + suspend fun retrieveHiveToken(): String? = + storage.getString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, null) + + suspend fun authenticateWithHive(): Boolean { + retrieveHiveToken()?.let { return true } + + val signedToken = getSignedTs() ?: return false + val pubkey = getPubKey() ?: return false + val timestamp = System.currentTimeMillis().toString() + + var success = false + networkQueryHive.authenticateWithHive(signedToken, pubkey, timestamp) + .collect { response -> + when (response) { + is Response.Success -> { + val jwt = response.value.token + ?.takeIf { it.isNotBlank() } + ?: return@collect + storage.putString(SphinxRepository.HIVE_AUTHENTICATION_TOKEN, jwt) + success = true + } + else -> { /* success remains false */ } + } + } + return success + } +} diff --git a/sphinx/application/network/concepts/queries/concept-network-query-hive/build.gradle b/sphinx/application/network/concepts/queries/concept-network-query-hive/build.gradle new file mode 100644 index 00000000..4ac94a5f --- /dev/null +++ b/sphinx/application/network/concepts/queries/concept-network-query-hive/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java-library' + id 'kotlin' + id 'kotlin-kapt' +} + +dependencies { + api project(path: ':sphinx:application:common:kotlin-response') + + implementation deps.kotlin.coroutinesCore + + // needed to override moshi's use of 1.4.31 + implementation deps.kotlin.reflect + implementation deps.square.moshi + kapt kaptDeps.square.moshiCodegen +} diff --git a/sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/NetworkQueryHive.kt b/sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/NetworkQueryHive.kt new file mode 100644 index 00000000..44b1f970 --- /dev/null +++ b/sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/NetworkQueryHive.kt @@ -0,0 +1,18 @@ +package chat.sphinx.concept_network_query_hive + +import chat.sphinx.concept_network_query_hive.model.HiveAuthenticationTokenDto +import chat.sphinx.kotlin_response.LoadResponse +import chat.sphinx.kotlin_response.ResponseError +import kotlinx.coroutines.flow.Flow + +abstract class NetworkQueryHive { + + //////////// + /// POST /// + //////////// + abstract fun authenticateWithHive( + token: String, + pubkey: String, + timestamp: String + ): Flow> +} diff --git a/sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/model/HiveAuthRequestDto.kt b/sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/model/HiveAuthRequestDto.kt new file mode 100644 index 00000000..f4c3ddd1 --- /dev/null +++ b/sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/model/HiveAuthRequestDto.kt @@ -0,0 +1,11 @@ +package chat.sphinx.concept_network_query_hive.model + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class HiveAuthRequestDto( + @Json(name = "token") val token: String, + @Json(name = "pubkey") val pubkey: String, + @Json(name = "timestamp") val timestamp: String +) diff --git a/sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/model/HiveAuthenticationTokenDto.kt b/sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/model/HiveAuthenticationTokenDto.kt new file mode 100644 index 00000000..7e0f9f98 --- /dev/null +++ b/sphinx/application/network/concepts/queries/concept-network-query-hive/src/main/java/chat/sphinx/concept_network_query_hive/model/HiveAuthenticationTokenDto.kt @@ -0,0 +1,6 @@ +package chat.sphinx.concept_network_query_hive.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class HiveAuthenticationTokenDto(val token: String?) diff --git a/sphinx/application/network/features/queries/feature-network-query-hive/build.gradle b/sphinx/application/network/features/queries/feature-network-query-hive/build.gradle new file mode 100644 index 00000000..528f140b --- /dev/null +++ b/sphinx/application/network/features/queries/feature-network-query-hive/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'java-library' + id 'kotlin' + id 'kotlin-kapt' +} + +dependencies { + api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-hive') + api project(path: ':sphinx:application:network:concepts:calls:concept-network-relay-call') + + implementation deps.kotlin.coroutinesCore + + // needed to override moshi's use of 1.4.31 + implementation deps.kotlin.reflect + implementation deps.square.moshi + kapt kaptDeps.square.moshiCodegen + + testImplementation project(path: ':sphinx:test:test-network-query') +} diff --git a/sphinx/application/network/features/queries/feature-network-query-hive/src/main/java/chat/sphinx/feature_network_query_hive/NetworkQueryHiveImpl.kt b/sphinx/application/network/features/queries/feature-network-query-hive/src/main/java/chat/sphinx/feature_network_query_hive/NetworkQueryHiveImpl.kt new file mode 100644 index 00000000..5f6b7794 --- /dev/null +++ b/sphinx/application/network/features/queries/feature-network-query-hive/src/main/java/chat/sphinx/feature_network_query_hive/NetworkQueryHiveImpl.kt @@ -0,0 +1,31 @@ +package chat.sphinx.feature_network_query_hive + +import chat.sphinx.concept_network_call.NetworkCall +import chat.sphinx.concept_network_query_hive.NetworkQueryHive +import chat.sphinx.concept_network_query_hive.model.HiveAuthRequestDto +import chat.sphinx.concept_network_query_hive.model.HiveAuthenticationTokenDto +import chat.sphinx.kotlin_response.LoadResponse +import chat.sphinx.kotlin_response.ResponseError +import kotlinx.coroutines.flow.Flow + +class NetworkQueryHiveImpl( + private val networkCall: NetworkCall +) : NetworkQueryHive() { + + companion object { + const val HIVE_BASE_URL = "https://hive.sphinx.chat/api" + const val ENDPOINT_AUTH = "/auth/sphinx/token" + } + + override fun authenticateWithHive( + token: String, + pubkey: String, + timestamp: String + ): Flow> = + networkCall.post( + url = HIVE_BASE_URL + ENDPOINT_AUTH, + responseJsonClass = HiveAuthenticationTokenDto::class.java, + requestBodyJsonClass = HiveAuthRequestDto::class.java, + requestBody = HiveAuthRequestDto(token, pubkey, timestamp) + ) +} diff --git a/sphinx/application/network/features/queries/feature-network-query-hive/src/test/java/chat/sphinx/feature_network_query_hive/HiveAuthRequestDtoTest.kt b/sphinx/application/network/features/queries/feature-network-query-hive/src/test/java/chat/sphinx/feature_network_query_hive/HiveAuthRequestDtoTest.kt new file mode 100644 index 00000000..fe1eadc5 --- /dev/null +++ b/sphinx/application/network/features/queries/feature-network-query-hive/src/test/java/chat/sphinx/feature_network_query_hive/HiveAuthRequestDtoTest.kt @@ -0,0 +1,44 @@ +package chat.sphinx.feature_network_query_hive + +import chat.sphinx.concept_network_query_hive.model.HiveAuthRequestDto +import com.squareup.moshi.Moshi +import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Test + +class HiveAuthRequestDtoTest { + + private val moshi: Moshi = Moshi.Builder() + .add(KotlinJsonAdapterFactory()) + .build() + + @Test + fun `HiveAuthRequestDto serializes to correct JSON with no null fields`() { + val dto = HiveAuthRequestDto( + token = "signed_token_value", + pubkey = "03abc123", + timestamp = "1690000000000" + ) + + val adapter = moshi.adapter(HiveAuthRequestDto::class.java) + val json = adapter.toJson(dto) + + assertEquals( + """{"token":"signed_token_value","pubkey":"03abc123","timestamp":"1690000000000"}""", + json + ) + assertFalse(json.contains("null")) + } + + @Test + fun `HiveAuthRequestDto deserializes from JSON correctly`() { + val json = """{"token":"tok","pubkey":"pubk","timestamp":"12345"}""" + val adapter = moshi.adapter(HiveAuthRequestDto::class.java) + val dto = adapter.fromJson(json)!! + + assertEquals("tok", dto.token) + assertEquals("pubk", dto.pubkey) + assertEquals("12345", dto.timestamp) + } +} diff --git a/sphinx/application/sphinx/build.gradle b/sphinx/application/sphinx/build.gradle index d64db83c..af8f5543 100644 --- a/sphinx/application/sphinx/build.gradle +++ b/sphinx/application/sphinx/build.gradle @@ -118,6 +118,7 @@ dependencies { implementation project(path: ':sphinx:application:network:features:queries:feature-network-query-crypter') implementation project(path: ':sphinx:application:network:features:queries:feature-network-query-discover-tribes') implementation project(path: ':sphinx:application:network:features:queries:feature-network-query-feed-status') + implementation project(path: ':sphinx:application:network:features:queries:feature-network-query-hive') implementation project(path: ':sphinx:application:network:features:feature-network-relay-call') implementation project(path: ':sphinx:screens:onboard:key-restore') diff --git a/sphinx/application/sphinx/src/main/java/chat/sphinx/di/NetworkModule.kt b/sphinx/application/sphinx/src/main/java/chat/sphinx/di/NetworkModule.kt index 07b6b106..ba97b9da 100644 --- a/sphinx/application/sphinx/src/main/java/chat/sphinx/di/NetworkModule.kt +++ b/sphinx/application/sphinx/src/main/java/chat/sphinx/di/NetworkModule.kt @@ -13,6 +13,7 @@ import chat.sphinx.concept_network_query_chat.NetworkQueryChat import chat.sphinx.concept_network_query_contact.NetworkQueryContact import chat.sphinx.concept_network_query_crypter.NetworkQueryCrypter import chat.sphinx.concept_network_query_discover_tribes.NetworkQueryDiscoverTribes +import chat.sphinx.concept_network_query_hive.NetworkQueryHive import chat.sphinx.concept_network_query_invite.NetworkQueryInvite import chat.sphinx.concept_network_query_meme_server.NetworkQueryMemeServer import chat.sphinx.concept_network_query_feed_search.NetworkQueryFeedSearch @@ -28,6 +29,7 @@ import chat.sphinx.feature_network_query_chat.NetworkQueryChatImpl import chat.sphinx.feature_network_query_contact.NetworkQueryContactImpl import chat.sphinx.feature_network_query_crypter.NetworkQueryCrypterImpl import chat.sphinx.feature_network_query_discover_tribes.NetworkQueryDiscoverTribesImpl +import chat.sphinx.feature_network_query_hive.NetworkQueryHiveImpl import chat.sphinx.feature_network_query_feed_status.NetworkQueryFeedStatusImpl import chat.sphinx.feature_network_query_invite.NetworkQueryInviteImpl import chat.sphinx.feature_network_query_meme_server.NetworkQueryMemeServerImpl @@ -322,4 +324,16 @@ object NetworkModule { networkQueryFeedStatusImpl: NetworkQueryFeedStatusImpl ): NetworkQueryFeedStatus = networkQueryFeedStatusImpl + + @Provides + fun provideNetworkQueryHiveImpl( + networkCall: NetworkCall + ): NetworkQueryHiveImpl = + NetworkQueryHiveImpl(networkCall) + + @Provides + fun provideNetworkQueryHive( + networkQueryHiveImpl: NetworkQueryHiveImpl + ): NetworkQueryHive = + networkQueryHiveImpl } diff --git a/sphinx/application/sphinx/src/main/java/chat/sphinx/di/RepositoryModule.kt b/sphinx/application/sphinx/src/main/java/chat/sphinx/di/RepositoryModule.kt index aa789ded..fa99398e 100644 --- a/sphinx/application/sphinx/src/main/java/chat/sphinx/di/RepositoryModule.kt +++ b/sphinx/application/sphinx/src/main/java/chat/sphinx/di/RepositoryModule.kt @@ -12,6 +12,7 @@ import chat.sphinx.concept_network_query_invite.NetworkQueryInvite import chat.sphinx.concept_network_query_meme_server.NetworkQueryMemeServer import chat.sphinx.concept_network_query_feed_search.NetworkQueryFeedSearch import chat.sphinx.concept_network_query_feed_status.NetworkQueryFeedStatus +import chat.sphinx.concept_network_query_hive.NetworkQueryHive import chat.sphinx.concept_network_query_people.NetworkQueryPeople import chat.sphinx.concept_network_query_verify_external.NetworkQueryAuthorizeExternal import chat.sphinx.concept_relay.RelayDataHandler @@ -146,6 +147,7 @@ object RepositoryModule { networkQueryPeople: NetworkQueryPeople, networkQueryFeedSearch: NetworkQueryFeedSearch, networkQueryFeedStatus: NetworkQueryFeedStatus, + networkQueryHive: NetworkQueryHive, connectManager: ConnectManager, dataSyncManager: DataSyncManager, walletDataHandler: WalletDataHandler, @@ -174,6 +176,7 @@ object RepositoryModule { networkQueryPeople, networkQueryFeedSearch, networkQueryFeedStatus, + networkQueryHive, connectManager, dataSyncManager, walletDataHandler,