-
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.
Audience Updates + Object Store Use Cases (#20)
* swagger / updating endpoint for audiences on contract execute * changing how audiences work * Running tests on build + workflow updates to publish test results. * cleanup * updating lint * disabling test * using the right annotation * EOS endpoint updates * File download, configurable parser * test fixes * ignoring test * Member ids for test * fixing parsing for configurable types
- Loading branch information
1 parent
56b8cd6
commit 8688991
Showing
58 changed files
with
702 additions
and
419 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Test Results | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build"] | ||
types: | ||
- completed | ||
permissions: {} | ||
|
||
jobs: | ||
test-results: | ||
name: Test Results | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
checks: write | ||
if: github.event.workflow_run.conclusion != 'skipped' | ||
|
||
steps: | ||
- name: Download and Extract Artifacts | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
mkdir -p artifacts && cd artifacts | ||
artifacts_url=${{ github.event.workflow_run.artifacts_url }} | ||
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact | ||
do | ||
IFS=$'\t' read name url <<< "$artifact" | ||
gh api $url > "$name.zip" | ||
unzip -d "$name" "$name.zip" | ||
done | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
with: | ||
commit: ${{ github.event.workflow_run.head_sha }} | ||
event_file: artifacts/Event File/event.json | ||
event_name: ${{ github.event.workflow_run.event }} | ||
files: "artifacts/**/*.xml" |
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: 6 additions & 0 deletions
6
models/src/main/kotlin/io/provenance/api/models/cee/ParserConfig.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.provenance.api.models.cee | ||
|
||
data class ParserConfig( | ||
val name: String, | ||
val descriptors: List<String> | ||
) |
6 changes: 6 additions & 0 deletions
6
models/src/main/kotlin/io/provenance/api/models/eos/GetFileRequest.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.provenance.api.models.eos | ||
|
||
data class GetFileRequest( | ||
val hash: String, | ||
val objectStoreAddress: String | ||
) |
6 changes: 2 additions & 4 deletions
6
...venance/api/models/eos/GetAssetRequest.kt → ...venance/api/models/eos/GetProtoRequest.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,9 +1,7 @@ | ||
package io.provenance.api.models.eos | ||
|
||
import java.util.UUID | ||
|
||
data class GetAssetRequest( | ||
val originatorUuid: UUID, | ||
data class GetProtoRequest( | ||
val hash: String, | ||
val objectStoreAddress: String, | ||
val type: String | ||
) |
13 changes: 0 additions & 13 deletions
13
models/src/main/kotlin/io/provenance/api/models/eos/StoreAssetRequest.kt
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
models/src/main/kotlin/io/provenance/api/models/eos/StoreProtoRequest.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.provenance.api.models.eos | ||
|
||
import io.provenance.api.models.p8e.PermissionInfo | ||
|
||
data class StoreProtoRequest( | ||
val objectStoreAddress: String, | ||
val permissions: PermissionInfo?, | ||
val message: Any, | ||
val type: String, | ||
) |
13 changes: 13 additions & 0 deletions
13
models/src/main/kotlin/io/provenance/api/models/p8e/Audience.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.provenance.api.models.p8e | ||
|
||
import java.util.UUID | ||
|
||
data class Audience( | ||
val uuid: UUID?, | ||
var keys: AudienceKeyPair? | ||
) | ||
|
||
data class AudienceKeyPair( | ||
val encryptionKey: String, | ||
val signingKey: String | ||
) |
2 changes: 1 addition & 1 deletion
2
models/src/main/kotlin/io/provenance/api/models/p8e/PermissionInfo.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,7 +1,7 @@ | ||
package io.provenance.api.models.p8e | ||
|
||
data class PermissionInfo( | ||
val audiences: Set<String> = emptySet(), | ||
val audiences: Set<Audience> = emptySet(), | ||
val permissionDart: Boolean = false, | ||
val permissionPortfolioManager: Boolean = false, | ||
) |
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
27 changes: 27 additions & 0 deletions
27
service/src/main/kotlin/io/provenance/onboarding/domain/extensions/ByteExtensions.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.provenance.onboarding.domain.extensions | ||
|
||
import org.springframework.http.ContentDisposition | ||
import org.springframework.http.HttpEntity | ||
import org.springframework.http.HttpHeaders | ||
import org.springframework.http.InvalidMediaTypeException | ||
import org.springframework.http.MediaType | ||
|
||
@Suppress("SwallowedException") | ||
fun ByteArray.toByteResponse( | ||
filename: String, | ||
contentType: String | ||
) = let { bytes -> | ||
bytes to HttpHeaders().also { | ||
it.contentDisposition = ContentDisposition.builder("inline").filename(filename).build() | ||
it.contentLength = bytes.size.toLong() | ||
|
||
contentType.run { | ||
try { | ||
MediaType.parseMediaType(contentType) | ||
} catch (e: InvalidMediaTypeException) { | ||
// ignored | ||
MediaType.APPLICATION_OCTET_STREAM | ||
} | ||
}.run { it.contentType = this } | ||
} | ||
}.let { (bytes, headers) -> HttpEntity(bytes, headers) } |
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
4 changes: 2 additions & 2 deletions
4
...in/io/provenance/onboarding/domain/usecase/cee/common/client/model/CreateClientRequest.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,13 +1,13 @@ | ||
package io.provenance.onboarding.domain.usecase.cee.common.client.model | ||
|
||
import io.provenance.api.models.account.AccountInfo | ||
import io.provenance.api.models.account.Participant | ||
import io.provenance.api.models.eos.ObjectStoreConfig | ||
import io.provenance.api.models.p8e.AudienceKeyPair | ||
import java.util.UUID | ||
|
||
data class CreateClientRequest( | ||
val uuid: UUID, | ||
val account: AccountInfo = AccountInfo(), | ||
val client: ObjectStoreConfig, | ||
val affiliates: List<Participant> = emptyList(), | ||
val affiliates: Set<AudienceKeyPair> = emptySet() | ||
) |
Oops, something went wrong.