Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: delete deprecated proto top-level folder #729

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .buf.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: v2
modules:
- path: hipcheck-common/proto
lint:
use:
- STANDARD
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions hipcheck-common/build.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// SPDX-License-Identifier: Apache-2.0

use anyhow::Result;
use pathbuf::pathbuf;
use tonic_build::compile_protos;
use tonic_build::configure;

fn main() -> Result<()> {
// Compile the Hipcheck gRPC protocol spec to an .rs file
let root = env!("CARGO_MANIFEST_DIR");
let path = pathbuf![root, "proto", "hipcheck", "v1", "hipcheck.proto"];
compile_protos(path)?;
configure().compile_protos(&["proto/hipcheck/v1/plugin_service.proto"], &["proto"])?;

// Make the target available as a compile-time env var for plugin arch
// resolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
syntax = "proto3";
package hipcheck.v1;

import "empty.proto";
import "hipcheck/v1/empty.proto";

/**
* Getting the default policy expression has no params, so we just wrap
* the empty message for maximal forward compatibility.
*/
message DefaultPolicyExprRequest {
Empty empty = 1;
message GetDefaultPolicyExpressionRequest {
Empty empty = 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
syntax = "proto3";
package hipcheck.v1;

message GetDefaultPolicyExpressionResponse {
// A policy expression, if the plugin has a default policy.
// This MUST be filled in with any default values pulled from the plugin's
// configuration. Hipcheck will only request the default policy _after_
// configuring the plugin.
string policy_expression = 1;
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
syntax = "proto3";
package hipcheck.v1;

import "empty.proto";
import "hipcheck/v1/empty.proto";

message ExplainDefaultQueryRequest {
Empty empty = 1;
Empty empty = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package hipcheck.v1;
* The response from the ExplainDefaultQuery RPC call.
*/
message ExplainDefaultQueryResponse {
/**
* An unstructured description of the default query.
*/
string explanation = 1;
/**
* An unstructured description of the default query.
*/
string explanation = 1;
}
212 changes: 0 additions & 212 deletions hipcheck-common/proto/hipcheck/v1/hipcheck.proto

This file was deleted.

69 changes: 69 additions & 0 deletions hipcheck-common/proto/hipcheck/v1/plugin_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
syntax = "proto3";
package hipcheck.v1;

import "hipcheck/v1/default_policy_expr_request.proto";
import "hipcheck/v1/default_policy_expr_response.proto";
import "hipcheck/v1/explain_default_query_request.proto";
import "hipcheck/v1/explain_default_query_response.proto";
import "hipcheck/v1/query.proto";
import "hipcheck/v1/query_response.proto";
import "hipcheck/v1/query_schemas_request.proto";
import "hipcheck/v1/set_configuration_request.proto";
import "hipcheck/v1/set_configuration_response.proto";

service PluginService {
/**
* Get schemas for all supported queries by the plugin.
*
* This is used by Hipcheck to validate that:
*
* - The plugin supports a default query taking a `target` type if used
* as a top-level plugin in the user's policy file.
* - That requests sent to the plugin and data returned by the plugin
* match the schema during execution.
*/
rpc GetQuerySchemas(GetQuerySchemasRequest) returns (stream GetQuerySchemasResponse);

/**
* Hipcheck sends all child nodes for the plugin from the user's policy
* file to configure the plugin.
*/
rpc SetConfiguration(SetConfigurationRequest) returns (SetConfigurationResponse);

/**
* Get the default policy for a plugin, which may additionally depend on
* the plugin's configuration.
*/
rpc GetDefaultPolicyExpression(GetDefaultPolicyExpressionRequest) returns (GetDefaultPolicyExpressionResponse);

/**
* Get an explanation of what the default query returns, to use when
* reporting analysis results to users.
*
* Note that, because users can specify their own policy expression, this
* explanation *should not* assume the user has used the default policy
* expression, if one is provided by the plugin.
*/
rpc ExplainDefaultQuery(ExplainDefaultQueryRequest) returns (ExplainDefaultQueryResponse);

/**
* Open a bidirectional streaming RPC to enable a request/response
* protocol between Hipcheck and a plugin, where Hipcheck can issue
* queries to the plugin, and the plugin may issue queries to _other_
* plugins through Hipcheck.
*
* Queries are cached by the publisher name, plugin name, query name,
* and key, and if a match is found for those four values, then
* Hipcheck will respond with the cached result of that prior matching
* query rather than running the query again.
*/
rpc InitiateQueryProtocol(stream InitiateQueryProtocolRequest) returns (stream InitiateQueryProtocolResponse);
}

message InitiateQueryProtocolRequest {
Query query = 1;
}

message InitiateQueryProtocolResponse {
Query query = 1;
}
Loading
Loading