-
Notifications
You must be signed in to change notification settings - Fork 0
feat(egress): add gateway proto contracts #144
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
81cde4e
feat(egress): add gateway proto contracts
casey-brooks d506a53
fix(egress): keep ziti ids internal
casey-brooks e46eaa8
fix(egress): hide OpenZiti identifiers
casey-brooks 8ecc72e
fix(runner): remove workload network policy
casey-brooks d435f1b
fix(runner): restore inline file mounts
casey-brooks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,186 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package agynio.api.egress.v1; | ||
|
|
||
| import "google/protobuf/timestamp.proto"; | ||
|
|
||
| option go_package = "github.com/agynio/api/gen/agynio/api/egress/v1;egressv1"; | ||
|
|
||
| // EgressRulesService manages egress rules and agent attachments. | ||
| service EgressRulesService { | ||
| // --- Egress Rules --- | ||
| rpc CreateEgressRule(CreateEgressRuleRequest) returns (CreateEgressRuleResponse); | ||
| rpc GetEgressRule(GetEgressRuleRequest) returns (GetEgressRuleResponse); | ||
| rpc ListEgressRules(ListEgressRulesRequest) returns (ListEgressRulesResponse); | ||
| rpc UpdateEgressRule(UpdateEgressRuleRequest) returns (UpdateEgressRuleResponse); | ||
| rpc DeleteEgressRule(DeleteEgressRuleRequest) returns (DeleteEgressRuleResponse); | ||
|
|
||
| // --- Egress Rule Attachments --- | ||
| rpc CreateEgressRuleAttachment(CreateEgressRuleAttachmentRequest) returns (CreateEgressRuleAttachmentResponse); | ||
| rpc DeleteEgressRuleAttachment(DeleteEgressRuleAttachmentRequest) returns (DeleteEgressRuleAttachmentResponse); | ||
| rpc ListEgressRuleAttachments(ListEgressRuleAttachmentsRequest) returns (ListEgressRuleAttachmentsResponse); | ||
|
|
||
| // --- Internal --- | ||
| rpc ListEgressRulesByAgent(ListEgressRulesByAgentRequest) returns (ListEgressRulesByAgentResponse); | ||
| rpc CountRulesReferencingSecret(CountRulesReferencingSecretRequest) returns (CountRulesReferencingSecretResponse); | ||
| } | ||
|
|
||
| // Metadata shared by egress resources. | ||
| message EntityMeta { | ||
| string id = 1; | ||
| google.protobuf.Timestamp created_at = 2; | ||
| google.protobuf.Timestamp updated_at = 3; | ||
| } | ||
|
|
||
| // Effect to apply to a request matching an egress rule. | ||
| enum EgressRuleAction { | ||
| EGRESS_RULE_ACTION_UNSPECIFIED = 0; | ||
| EGRESS_RULE_ACTION_ALLOW = 1; | ||
| EGRESS_RULE_ACTION_DENY = 2; | ||
| } | ||
|
|
||
| // Authentication scheme used when emitting an injected header. | ||
| enum HeaderAuthScheme { | ||
| HEADER_AUTH_SCHEME_UNSPECIFIED = 0; | ||
| HEADER_AUTH_SCHEME_BEARER = 1; | ||
| HEADER_AUTH_SCHEME_BASIC = 2; | ||
| } | ||
|
|
||
| // Request attributes matched by an egress rule. | ||
| message EgressRuleMatcher { | ||
| // Hostname pattern. Examples: "api.github.com", "*.github.com". | ||
| string domain_pattern = 1; | ||
| // Destination ports to intercept. Empty means service default ports. | ||
| repeated int32 ports = 2; | ||
| // HTTP methods the rule applies to. Empty means any method. | ||
| repeated string methods = 3; | ||
| // Glob over the request path. Empty means any path. | ||
| string path_pattern = 4; | ||
| } | ||
|
|
||
| // Header credential injected by the egress gateway. | ||
| message EgressRuleHeader { | ||
| string name = 1; | ||
| HeaderAuthScheme scheme = 2; | ||
| oneof credential { | ||
| string value = 3; | ||
| string secret_id = 4; | ||
| } | ||
| } | ||
|
|
||
| // Behavior to apply to requests matching an egress rule. | ||
| message EgressRuleEffect { | ||
| optional EgressRuleAction action = 1; | ||
| repeated EgressRuleHeader inject = 2; | ||
| } | ||
|
|
||
| // Rule mediating outbound HTTP/HTTPS traffic from agent workloads. | ||
| message EgressRule { | ||
| EntityMeta meta = 1; | ||
| string organization_id = 2; | ||
| string name = 3; | ||
| string description = 4; | ||
| EgressRuleMatcher matcher = 5; | ||
| EgressRuleEffect effect = 6; | ||
| } | ||
|
|
||
| // Attachment binding an egress rule to an agent. | ||
| message EgressRuleAttachment { | ||
| EntityMeta meta = 1; | ||
| string rule_id = 2; | ||
| string agent_id = 3; | ||
| } | ||
|
|
||
| message CreateEgressRuleRequest { | ||
| string organization_id = 1; | ||
| string name = 2; | ||
| string description = 3; | ||
| EgressRuleMatcher matcher = 4; | ||
| EgressRuleEffect effect = 5; | ||
| } | ||
|
|
||
| message CreateEgressRuleResponse { | ||
| EgressRule egress_rule = 1; | ||
| } | ||
|
|
||
| message GetEgressRuleRequest { | ||
| string id = 1; | ||
| } | ||
|
|
||
| message GetEgressRuleResponse { | ||
| EgressRule egress_rule = 1; | ||
| } | ||
|
|
||
| message ListEgressRulesRequest { | ||
| string organization_id = 1; | ||
| int32 page_size = 2; | ||
| string page_token = 3; | ||
| } | ||
|
|
||
| message ListEgressRulesResponse { | ||
| repeated EgressRule egress_rules = 1; | ||
| string next_page_token = 2; | ||
| } | ||
|
|
||
| message UpdateEgressRuleRequest { | ||
| string id = 1; | ||
| optional string name = 2; | ||
| optional string description = 3; | ||
| optional EgressRuleMatcher matcher = 4; | ||
| optional EgressRuleEffect effect = 5; | ||
| } | ||
|
|
||
| message UpdateEgressRuleResponse { | ||
| EgressRule egress_rule = 1; | ||
| } | ||
|
|
||
| message DeleteEgressRuleRequest { | ||
| string id = 1; | ||
| } | ||
|
|
||
| message DeleteEgressRuleResponse {} | ||
|
|
||
| message CreateEgressRuleAttachmentRequest { | ||
| string rule_id = 1; | ||
| string agent_id = 2; | ||
| } | ||
|
|
||
| message CreateEgressRuleAttachmentResponse { | ||
| EgressRuleAttachment egress_rule_attachment = 1; | ||
| } | ||
|
|
||
| message DeleteEgressRuleAttachmentRequest { | ||
| string id = 1; | ||
| } | ||
|
|
||
| message DeleteEgressRuleAttachmentResponse {} | ||
|
|
||
| message ListEgressRuleAttachmentsRequest { | ||
| string organization_id = 1; | ||
| optional string rule_id = 2; | ||
| optional string agent_id = 3; | ||
| int32 page_size = 4; | ||
| string page_token = 5; | ||
| } | ||
|
|
||
| message ListEgressRuleAttachmentsResponse { | ||
| repeated EgressRuleAttachment egress_rule_attachments = 1; | ||
| string next_page_token = 2; | ||
| } | ||
|
|
||
| message ListEgressRulesByAgentRequest { | ||
| string agent_id = 1; | ||
| } | ||
|
|
||
| message ListEgressRulesByAgentResponse { | ||
| repeated EgressRule egress_rules = 1; | ||
| } | ||
|
|
||
| message CountRulesReferencingSecretRequest { | ||
| string secret_id = 1; | ||
| } | ||
|
|
||
| message CountRulesReferencingSecretResponse { | ||
| int32 count = 1; | ||
| repeated string egress_rule_ids = 2; | ||
| } |
This file contains hidden or 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,21 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package agynio.api.gateway.v1; | ||
|
|
||
| import "agynio/api/egress/v1/egress.proto"; | ||
|
|
||
| option go_package = "github.com/agynio/api/gen/agynio/api/gateway/v1;gatewayv1"; | ||
|
|
||
| service EgressRulesGateway { | ||
| // --- Egress Rules --- | ||
| rpc CreateEgressRule(agynio.api.egress.v1.CreateEgressRuleRequest) returns (agynio.api.egress.v1.CreateEgressRuleResponse); | ||
| rpc GetEgressRule(agynio.api.egress.v1.GetEgressRuleRequest) returns (agynio.api.egress.v1.GetEgressRuleResponse); | ||
| rpc ListEgressRules(agynio.api.egress.v1.ListEgressRulesRequest) returns (agynio.api.egress.v1.ListEgressRulesResponse); | ||
| rpc UpdateEgressRule(agynio.api.egress.v1.UpdateEgressRuleRequest) returns (agynio.api.egress.v1.UpdateEgressRuleResponse); | ||
| rpc DeleteEgressRule(agynio.api.egress.v1.DeleteEgressRuleRequest) returns (agynio.api.egress.v1.DeleteEgressRuleResponse); | ||
|
|
||
| // --- Egress Rule Attachments --- | ||
| rpc CreateEgressRuleAttachment(agynio.api.egress.v1.CreateEgressRuleAttachmentRequest) returns (agynio.api.egress.v1.CreateEgressRuleAttachmentResponse); | ||
| rpc DeleteEgressRuleAttachment(agynio.api.egress.v1.DeleteEgressRuleAttachmentRequest) returns (agynio.api.egress.v1.DeleteEgressRuleAttachmentResponse); | ||
| rpc ListEgressRuleAttachments(agynio.api.egress.v1.ListEgressRuleAttachmentsRequest) returns (agynio.api.egress.v1.ListEgressRuleAttachmentsResponse); | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.