-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating EOS file endpoint to send raw input (#43)
* Updating EOS file endpoint to send raw input * cleanup * Updating get file * doc updates * optional raw byte * defaulting raw bytes to false * get file updates * minor cleanup * build fixes * more swagger updates
- Loading branch information
1 parent
bb66eb0
commit 65efc06
Showing
9 changed files
with
85 additions
and
111 deletions.
There are no files selected for viewing
7 changes: 1 addition & 6 deletions
7
service/src/main/kotlin/io/provenance/api/domain/objectStore/ObjectStore.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
package io.provenance.api.domain.objectStore | ||
|
||
import com.google.protobuf.Message | ||
import io.provenance.api.models.eos.store.StoreProtoResponse | ||
import io.provenance.scope.encryption.proto.Encryption | ||
import io.provenance.scope.objectstore.client.OsClient | ||
import java.security.PrivateKey | ||
import java.security.PublicKey | ||
|
||
interface ObjectStore { | ||
fun getDIME(client: OsClient, hash: ByteArray, publicKey: PublicKey): Encryption.DIME | ||
fun retrieve(client: OsClient, hash: ByteArray, publicKey: PublicKey): ByteArray | ||
fun retrieveWithDIME(client: OsClient, hash: ByteArray, publicKey: PublicKey): Pair<Encryption.DIME, ByteArray> | ||
fun retrieveAndDecrypt(client: OsClient, hash: ByteArray, publicKey: PublicKey, privateKey: PrivateKey): ByteArray | ||
fun storeMessage(client: OsClient, message: Message, publicKey: PublicKey, additionalAudiences: Set<PublicKey>): StoreProtoResponse | ||
fun <T> store(client: OsClient, message: T, publicKey: PublicKey, additionalAudiences: Set<PublicKey>): StoreProtoResponse | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...tlin/io/provenance/api/domain/usecase/objectStore/store/models/StoreFileRequestWrapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
package io.provenance.api.domain.usecase.objectStore.store.models | ||
|
||
import java.util.UUID | ||
import org.springframework.http.HttpEntity | ||
import org.springframework.http.codec.multipart.FilePart | ||
import org.springframework.http.codec.multipart.Part | ||
|
||
data class StoreFileRequestWrapper( | ||
val uuid: UUID, | ||
val request: Map<String, Part>, | ||
val storeRawBytes: Boolean = false, | ||
) | ||
|
||
data class SwaggerStoreFileRequestWrapper( | ||
val objectStoreAddress: String, | ||
val id: UUID, | ||
val file: FilePart, | ||
val storeRawBytes: Boolean, | ||
) | ||
|
||
data class SwaggerGetFileResponse( | ||
val value: HttpEntity<ByteArray> | ||
val value: ByteArray | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters