Skip to content

Commit

Permalink
Use the new qualifiers in all applicable locations
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperschwartz committed Sep 24, 2022
1 parent 77a88ba commit d6f10be
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import io.provenance.scope.encryption.model.KeyRef
import io.provenance.scope.encryption.util.getAddress
import mu.KLogging
import org.lognet.springboot.grpc.GRpcService
import org.springframework.beans.factory.annotation.Qualifier
import tech.figure.objectstore.gateway.address
import tech.figure.objectstore.gateway.admin.Admin.FetchDataStorageAccountRequest
import tech.figure.objectstore.gateway.admin.Admin.FetchDataStorageAccountResponse
import tech.figure.objectstore.gateway.admin.Admin.PutDataStorageAccountRequest
import tech.figure.objectstore.gateway.admin.Admin.PutDataStorageAccountResponse
import tech.figure.objectstore.gateway.admin.GatewayAdminGrpc.GatewayAdminImplBase
import tech.figure.objectstore.gateway.configuration.BeanQualifiers
import tech.figure.objectstore.gateway.configuration.ProvenanceProperties
import tech.figure.objectstore.gateway.exception.AccessDeniedException
import tech.figure.objectstore.gateway.exception.NotFoundException
Expand All @@ -23,7 +25,7 @@ import tech.figure.objectstore.gateway.server.interceptor.JwtServerInterceptor
@GRpcService(interceptors = [JwtServerInterceptor::class])
class ObjectStoreGatewayAdminServer(
private val accountsRepository: DataStorageAccountsRepository,
private val masterKey: KeyRef,
@Qualifier(BeanQualifiers.OBJECTSTORE_MASTER_KEY) private val masterKey: KeyRef,
private val provenanceProperties: ProvenanceProperties,
) : GatewayAdminImplBase() {
private companion object : KLogging()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import io.provenance.scope.encryption.model.KeyRef
import io.provenance.scope.encryption.util.getAddress
import mu.KLogging
import org.lognet.springboot.grpc.GRpcService
import org.springframework.beans.factory.annotation.Qualifier
import tech.figure.objectstore.gateway.GatewayGrpc
import tech.figure.objectstore.gateway.GatewayOuterClass
import tech.figure.objectstore.gateway.GatewayOuterClass.GrantScopePermissionResponse
import tech.figure.objectstore.gateway.GatewayOuterClass.RevokeScopePermissionResponse
import tech.figure.objectstore.gateway.address
import tech.figure.objectstore.gateway.configuration.BeanQualifiers
import tech.figure.objectstore.gateway.configuration.ProvenanceProperties
import tech.figure.objectstore.gateway.publicKey
import tech.figure.objectstore.gateway.server.interceptor.JwtServerInterceptor
Expand All @@ -23,7 +25,7 @@ import tech.figure.objectstore.gateway.service.ScopePermissionsService

@GRpcService(interceptors = [JwtServerInterceptor::class])
class ObjectStoreGatewayServer(
private val masterKey: KeyRef,
@Qualifier(BeanQualifiers.OBJECTSTORE_MASTER_KEY) private val masterKey: KeyRef,
private val scopeFetchService: ScopeFetchService,
private val scopePermissionsService: ScopePermissionsService,
private val objectService: ObjectService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import io.provenance.scope.objectstore.util.base64Decode
import io.provenance.scope.objectstore.util.toHex
import io.provenance.scope.util.NotFoundException
import io.provenance.scope.util.base64String
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.stereotype.Component
import tech.figure.objectstore.gateway.GatewayOuterClass
import tech.figure.objectstore.gateway.configuration.BeanQualifiers
import tech.figure.objectstore.gateway.configuration.ProvenanceProperties
import tech.figure.objectstore.gateway.exception.AccessDeniedException
import tech.figure.objectstore.gateway.repository.DataStorageAccountsRepository
Expand All @@ -20,7 +22,7 @@ import java.security.PublicKey
class ObjectService(
private val accountsRepository: DataStorageAccountsRepository,
private val objectStoreClient: CachedOsClient,
private val masterKey: KeyRef,
@Qualifier(BeanQualifiers.OBJECTSTORE_MASTER_KEY) private val masterKey: KeyRef,
private val objectPermissionsRepository: ObjectPermissionsRepository,
private val provenanceProperties: ProvenanceProperties,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import io.provenance.scope.objectstore.client.CachedOsClient
import io.provenance.scope.objectstore.util.base64Decode
import io.provenance.scope.sdk.extensions.resultType
import mu.KLogging
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.stereotype.Component
import tech.figure.objectstore.gateway.GatewayOuterClass
import tech.figure.objectstore.gateway.configuration.BeanQualifiers
import tech.figure.objectstore.gateway.configuration.ProvenanceProperties
import tech.figure.objectstore.gateway.exception.AccessDeniedException
import tech.figure.objectstore.gateway.repository.ScopePermissionsRepository
Expand All @@ -23,7 +25,7 @@ class ScopeFetchService(
private val objectStoreClient: CachedOsClient,
private val pbClient: PbClient,
private val scopePermissionsRepository: ScopePermissionsRepository,
private val encryptionKeys: Map<String, KeyRef>,
@Qualifier(BeanQualifiers.OBJECTSTORE_ENCRYPTION_KEYS) private val encryptionKeys: Map<String, KeyRef>,
private val provenanceProperties: ProvenanceProperties,
) {
companion object : KLogging()
Expand Down

0 comments on commit d6f10be

Please sign in to comment.