Skip to content

Commit

Permalink
Merge branch 'main' into re-introduce-license
Browse files Browse the repository at this point in the history
  • Loading branch information
piercetrey-figure authored Mar 11, 2021
2 parents 86f9178 + d5adfb8 commit fc6435c
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 129 deletions.
10 changes: 5 additions & 5 deletions os-proto/src/main/proto/os/object.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ service ObjectService {

rpc Get(Sha512Request) returns (stream ChunkBidi) {};

rpc GetByUuid(UUID) returns (stream ChunkBidi) {};
rpc GetByUuid(p8e.UUID) returns (stream ChunkBidi) {};
}

message ChunkBidi {
Expand Down Expand Up @@ -62,8 +62,8 @@ message Item {
}

message Object {
UUID uuid = 1;
UUID object_uuid = 2;
p8e.UUID uuid = 1;
p8e.UUID object_uuid = 2;
bytes unencrypted_sha_512 = 3;
repeated Signature signatures = 4;
string uri = 5;
Expand All @@ -79,8 +79,8 @@ message Object {
}

message ObjectMetadata {
UUID uuid = 1;
UUID document_uuid = 2;
p8e.UUID uuid = 1;
p8e.UUID document_uuid = 2;
bytes sha_512 = 3;
int32 length = 4;
string connector_class = 5;
Expand Down
2 changes: 1 addition & 1 deletion os-proto/src/main/proto/os/public_key.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ message PublicKeyRequest {
}

message PublicKeyResponse {
UUID uuid = 1;
p8e.UUID uuid = 1;
bytes public_key = 2;
google.protobuf.Timestamp created = 3;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import io.p8e.proto.ContractScope.Scope
import io.p8e.proto.ContractSpecs.ContractSpec
import io.p8e.util.toHex
import io.provenance.os.client.OsClient
import io.p8e.proto.Util.Index
import io.p8e.proto.Util.Index.Behavior
import io.p8e.proto.Util.Index.Behavior.*
import io.p8e.proto.IndexProto.Index
import io.p8e.proto.IndexProto.Index.Behavior
import io.p8e.proto.IndexProto.Index.Behavior.*
import io.provenance.p8e.shared.extension.logger
import org.springframework.stereotype.Component
import java.io.ByteArrayInputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ option java_package = "io.provenance.proto.encryption";
import "p8e/util.proto";

message DIME {
UUID uuid = 1; // Unique identifier for this entity on the block chain
p8e.UUID uuid = 1; // Unique identifier for this entity on the block chain
Audience owner = 2; // Convienient structure for enforcing owner specification/encryption access to payload

map<string, string> metadata = 3; // Clear text metadata key/values associated with this payload

repeated Audience audience = 4; // DEKs for Processing and Retrieval
repeated Payload payload = 5; // A set of encrypted payloads

AuditFields audit_fields = 99;
p8e.AuditFields audit_fields = 99;
}

enum ContextType {
Expand Down
107 changes: 20 additions & 87 deletions p8e-proto-internal/src/main/proto/p8e/index.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,104 +2,37 @@ syntax = "proto3";

package p8e;

option go_package="github.com/FigureTechnologies/p8e-proto-go/pkg/p8e";
option java_package = "io.p8e.proto";
option java_outer_classname = "IndexProto";

import "google/protobuf/timestamp.proto";
import "p8e/contract.proto";
import "p8e/contract_scope.proto";
import "p8e/util.proto";
import "p8e/public_key.proto";
import "google/protobuf/descriptor.proto";

option java_outer_classname = "Index";
// Metadata to flag indexing by p8e indexer
message Index {
Behavior index = 1;

service IndexService {
rpc ElasticSearchQuery (ElasticSearchQueryRequest) returns (ScopeWrappers) {};
enum Behavior {
NOT_SET = 0;

rpc Query (QueryRequest) returns (ScopeWrappers) {};
// Never index
NEVER = 1;

rpc ElasticSearchRawQuery (ElasticSearchQueryRequest) returns (RawQueryResults) {};
// Always index
ALWAYS = 2;

rpc RawQuery (QueryRequest) returns (RawQueryResults) {};
// Index unless Parent says otherwise
INDEX_DEFER_PARENT = 3;

rpc FindLatestScopeByUuid (UUID) returns (ScopeWrapper) {};

rpc FindLatestScopesByUuids (ScopesRequest) returns (ScopeWrappers) {};

rpc QueryCount (QueryRequest) returns (QueryCountResponse) {};

rpc QueryWithCount (QueryRequest) returns (QueryScopeWrapper) {};

rpc GetFactHistory (FactHistoryRequest) returns (FactHistoryResponse) {};
}

message ElasticSearchQueryRequest {
string query = 1;
}

message QueryRequest {
string json = 1;
}

message ScopesRequest {
repeated UUID uuids = 1;
}

message ScopeWrappers {
repeated ScopeWrapper scopes = 1;
// Don't index unless Parent says otherwise
NO_INDEX_DEFER_PARENT = 4;
}
}

message ScopeWrapper {
uint64 blockNumber = 1;
uint64 blockTransactionIndex = 2;
p8e.Scope scope = 3;
extend google.protobuf.MessageOptions {
Index message_index = 65534;
}

message RawQueryResults {
repeated RawQueryResult results = 1;
extend google.protobuf.FieldOptions {
Index index = 65535;
}

message RawQueryResult {
string id = 1;
string fieldJson = 2;
}

message QueryCountResponse {
uint64 count = 1;
bool isTerminateEarly = 2;
uint32 successfulShards = 3;
uint32 skippedShards = 4;
uint32 failedShards = 5;
uint32 totalShards = 6;
}

message QueryScopeWrapper {
repeated ScopeWrapper scopes = 1;
uint64 totalHits = 2;
}

message FactHistoryRequest {
UUID scope_uuid = 1;
string fact_name = 2;
string classname = 3;
google.protobuf.Timestamp start_window = 4;
google.protobuf.Timestamp end_window = 5;
}

message FactHistoryResponse {
repeated FactHistoryResponseEntry entries = 1;
}

message FactHistoryResponseEntry {
SigningAndEncryptionPublicKeys executor = 1;
repeated Recital parties = 2;
string contract_jar_hash = 3;
string contract_classname = 4;
string function_name = 5;
string result_name = 6;
string result_hash = 7;
bytes fact_bytes = 8;
AuditFields fact_audit_fields = 9;
uint64 block_number = 10;
uint64 block_transaction_index = 11;
}
105 changes: 105 additions & 0 deletions p8e-proto-internal/src/main/proto/p8e/index_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
syntax = "proto3";

package p8e;

option go_package="github.com/FigureTechnologies/p8e-proto-go/pkg/p8e";
option java_package = "io.p8e.proto";

import "google/protobuf/timestamp.proto";
import "p8e/contract.proto";
import "p8e/contract_scope.proto";
import "p8e/util.proto";
import "p8e/public_key.proto";

option java_outer_classname = "Index";

service IndexService {
rpc ElasticSearchQuery (ElasticSearchQueryRequest) returns (ScopeWrappers) {};

rpc Query (QueryRequest) returns (ScopeWrappers) {};

rpc ElasticSearchRawQuery (ElasticSearchQueryRequest) returns (RawQueryResults) {};

rpc RawQuery (QueryRequest) returns (RawQueryResults) {};

rpc FindLatestScopeByUuid (UUID) returns (ScopeWrapper) {};

rpc FindLatestScopesByUuids (ScopesRequest) returns (ScopeWrappers) {};

rpc QueryCount (QueryRequest) returns (QueryCountResponse) {};

rpc QueryWithCount (QueryRequest) returns (QueryScopeWrapper) {};

rpc GetFactHistory (FactHistoryRequest) returns (FactHistoryResponse) {};
}

message ElasticSearchQueryRequest {
string query = 1;
}

message QueryRequest {
string json = 1;
}

message ScopesRequest {
repeated UUID uuids = 1;
}

message ScopeWrappers {
repeated ScopeWrapper scopes = 1;
}

message ScopeWrapper {
uint64 blockNumber = 1;
uint64 blockTransactionIndex = 2;
p8e.Scope scope = 3;
}

message RawQueryResults {
repeated RawQueryResult results = 1;
}

message RawQueryResult {
string id = 1;
string fieldJson = 2;
}

message QueryCountResponse {
uint64 count = 1;
bool isTerminateEarly = 2;
uint32 successfulShards = 3;
uint32 skippedShards = 4;
uint32 failedShards = 5;
uint32 totalShards = 6;
}

message QueryScopeWrapper {
repeated ScopeWrapper scopes = 1;
uint64 totalHits = 2;
}

message FactHistoryRequest {
UUID scope_uuid = 1;
string fact_name = 2;
string classname = 3;
google.protobuf.Timestamp start_window = 4;
google.protobuf.Timestamp end_window = 5;
}

message FactHistoryResponse {
repeated FactHistoryResponseEntry entries = 1;
}

message FactHistoryResponseEntry {
SigningAndEncryptionPublicKeys executor = 1;
repeated Recital parties = 2;
string contract_jar_hash = 3;
string contract_classname = 4;
string function_name = 5;
string result_name = 6;
string result_hash = 7;
bytes fact_bytes = 8;
AuditFields fact_audit_fields = 9;
uint64 block_number = 10;
uint64 block_transaction_index = 11;
}
33 changes: 2 additions & 31 deletions p8e-proto-internal/src/main/proto/p8e/util.proto
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
syntax = "proto3";

package p8e;

option java_package = "io.p8e.proto";

import "google/protobuf/descriptor.proto";
import "google/protobuf/timestamp.proto";

//UUID stored as a string
Expand All @@ -19,33 +20,3 @@ message AuditFields {
int32 version = 5;
string message = 6;
}

// Metadata to flag indexing by p8e indexer
message Index {
Behavior index = 1;

enum Behavior {
NOT_SET = 0;

// Never index
NEVER = 1;

// Always index
ALWAYS = 2;

// Index unless Parent says otherwise
INDEX_DEFER_PARENT = 3;

// Don't index unless Parent says otherwise
NO_INDEX_DEFER_PARENT = 4;
}
}

extend google.protobuf.MessageOptions {
Index message_index = 65534;
}

extend google.protobuf.FieldOptions {
Index index = 65535;
}

0 comments on commit fc6435c

Please sign in to comment.