Table of Contents

Class NetworkEndpoint

Namespace
Openshell.Sandbox.V1
Assembly
OpenShell.Sdk.dll

A network endpoint (host + port) with optional L7 inspection config.

public sealed class NetworkEndpoint : IMessage<NetworkEndpoint>, IEquatable<NetworkEndpoint>, IDeepCloneable<NetworkEndpoint>, IBufferMessage, IMessage
Inheritance
NetworkEndpoint
Implements
IMessage<NetworkEndpoint>
IDeepCloneable<NetworkEndpoint>
IBufferMessage
IMessage
Inherited Members

Constructors

NetworkEndpoint()

public NetworkEndpoint()

NetworkEndpoint(NetworkEndpoint)

public NetworkEndpoint(NetworkEndpoint other)

Parameters

other NetworkEndpoint

Fields

AccessFieldNumber

Field number for the "access" field.

public const int AccessFieldNumber = 6

Field Value

int

AdvisorProposedFieldNumber

Field number for the "advisor_proposed" field.

public const int AdvisorProposedFieldNumber = 18

Field Value

int

AllowEncodedSlashFieldNumber

Field number for the "allow_encoded_slash" field.

public const int AllowEncodedSlashFieldNumber = 11

Field Value

int

AllowUninspectedCredentialsFieldNumber

Field number for the "allow_uninspected_credentials" field.

public const int AllowUninspectedCredentialsFieldNumber = 25

Field Value

int

AllowedIpsFieldNumber

Field number for the "allowed_ips" field.

public const int AllowedIpsFieldNumber = 8

Field Value

int

CredentialBindingFieldNumber

Field number for the "credential_binding" field.

public const int CredentialBindingFieldNumber = 24

Field Value

int

CredentialSigningFieldNumber

Field number for the "credential_signing" field.

public const int CredentialSigningFieldNumber = 19

Field Value

int

DenyRulesFieldNumber

Field number for the "deny_rules" field.

public const int DenyRulesFieldNumber = 10

Field Value

int

EnforcementFieldNumber

Field number for the "enforcement" field.

public const int EnforcementFieldNumber = 5

Field Value

int

GraphqlMaxBodyBytesFieldNumber

Field number for the "graphql_max_body_bytes" field.

public const int GraphqlMaxBodyBytesFieldNumber = 14

Field Value

int

GraphqlPersistedQueriesFieldNumber

Field number for the "graphql_persisted_queries" field.

public const int GraphqlPersistedQueriesFieldNumber = 13

Field Value

int

HostFieldNumber

Field number for the "host" field.

public const int HostFieldNumber = 1

Field Value

int

JsonRpcMaxBodyBytesFieldNumber

Field number for the "json_rpc_max_body_bytes" field.

public const int JsonRpcMaxBodyBytesFieldNumber = 22

Field Value

int

McpFieldNumber

Field number for the "mcp" field.

public const int McpFieldNumber = 23

Field Value

int

PathFieldNumber

Field number for the "path" field.

public const int PathFieldNumber = 15

Field Value

int

PersistedQueriesFieldNumber

Field number for the "persisted_queries" field.

public const int PersistedQueriesFieldNumber = 12

Field Value

int

PortFieldNumber

Field number for the "port" field.

public const int PortFieldNumber = 2

Field Value

int

PortsFieldNumber

Field number for the "ports" field.

public const int PortsFieldNumber = 9

Field Value

int

ProtocolFieldNumber

Field number for the "protocol" field.

public const int ProtocolFieldNumber = 3

Field Value

int

ProviderCredentialedFieldNumber

Field number for the "provider_credentialed" field.

public const int ProviderCredentialedFieldNumber = 26

Field Value

int

RequestBodyCredentialRewriteFieldNumber

Field number for the "request_body_credential_rewrite" field.

public const int RequestBodyCredentialRewriteFieldNumber = 17

Field Value

int

RulesFieldNumber

Field number for the "rules" field.

public const int RulesFieldNumber = 7

Field Value

int

SigningRegionFieldNumber

Field number for the "signing_region" field.

public const int SigningRegionFieldNumber = 21

Field Value

int

SigningServiceFieldNumber

Field number for the "signing_service" field.

public const int SigningServiceFieldNumber = 20

Field Value

int

TlsFieldNumber

Field number for the "tls" field.

public const int TlsFieldNumber = 4

Field Value

int

TokenGrantOwnerFieldNumber

Field number for the "token_grant_owner" field.

public const int TokenGrantOwnerFieldNumber = 27

Field Value

int

WebsocketCredentialRewriteFieldNumber

Field number for the "websocket_credential_rewrite" field.

public const int WebsocketCredentialRewriteFieldNumber = 16

Field Value

int

Properties

Access

Access preset shorthand. Unspecified means no preset. Mutually exclusive with rules.

public NetworkAccessPreset Access { get; set; }

Property Value

NetworkAccessPreset

AdvisorProposed

Internal provenance marker for policy-advisor generated endpoints. Advisor-proposed endpoints must not satisfy exact-host SSRF trust unless they are converted through an explicit user-authored policy path.

public bool AdvisorProposed { get; set; }

Property Value

bool

AllowEncodedSlash

When true, percent-encoded '/' (%2F) is preserved in path segments rather than rejected by the L7 path canonicalizer. Required for upstreams like GitLab that embed %2F in namespaced resource paths. Defaults to false (strict).

public bool AllowEncodedSlash { get; set; }

Property Value

bool

AllowUninspectedCredentials

Explicitly permits credential-bearing traffic to use paths that OpenShell cannot inspect or rewrite. Defaults to false. This is a security-sensitive escape hatch and must be explicitly approved.

public bool AllowUninspectedCredentials { get; set; }

Property Value

bool

AllowedIps

Allowed resolved IP addresses or CIDR ranges for this endpoint. When non-empty, the SSRF internal-IP check is replaced by an allowlist check:

  • If host is also set: domain must resolve to an IP in this list.
  • If host is empty: any domain is allowed as long as it resolves to an IP in this list. Supports exact IPs ("10.0.5.20") and CIDR notation ("10.0.5.0/24"). Loopback (127.0.0.0/8) and link-local (169.254.0.0/16) are always blocked regardless of this field.
public RepeatedField<string> AllowedIps { get; }

Property Value

RepeatedField<string>

CredentialBinding

Explicit binding authority for static credentials from an attached endpointless provider profile. Profiles that already define endpoints continue to use those profile endpoints as their credential boundary.

public NetworkCredentialBinding CredentialBinding { get; set; }

Property Value

NetworkCredentialBinding

CredentialSigning

Proxy-side credential signing mode: "sigv4" for AWS SigV4 re-signing. When set, the proxy strips the client's Authorization header and computes a fresh SigV4 signature using real credentials from the provider.

public string CredentialSigning { get; set; }

Property Value

string

DenyRules

Explicit L7 deny rules. When present, requests matching any deny rule are blocked even if they match an allow rule or access preset. Deny rules take precedence over allow rules.

public RepeatedField<L7DenyRule> DenyRules { get; }

Property Value

RepeatedField<L7DenyRule>

Descriptor

public static MessageDescriptor Descriptor { get; }

Property Value

MessageDescriptor

Enforcement

Enforcement mode. Unspecified preserves the audit default.

public NetworkEnforcementMode Enforcement { get; set; }

Property Value

NetworkEnforcementMode

GraphqlMaxBodyBytes

Maximum GraphQL request body bytes to buffer for inspection. Defaults to 65536 when unset.

public uint GraphqlMaxBodyBytes { get; set; }

Property Value

uint

GraphqlPersistedQueries

Trusted GraphQL persisted-query registry keyed by hash or service-specific ID. Only used when persisted_queries is "allow_registered".

public MapField<string, GraphqlOperation> GraphqlPersistedQueries { get; }

Property Value

MapField<string, GraphqlOperation>

Host

Hostname or host glob pattern. Exact match is case-insensitive. Glob patterns use "." as delimiter: "*.example.com" matches a single subdomain label, "**.example.com" matches across labels.

public string Host { get; set; }

Property Value

string

JsonRpcMaxBodyBytes

Maximum JSON-RPC-over-HTTP request body bytes to buffer for inspection. Defaults to 65536 when unset.

public uint JsonRpcMaxBodyBytes { get; set; }

Property Value

uint

Mcp

MCP-only policy and inspection options. Only used when protocol is "mcp".

public McpOptions Mcp { get; set; }

Property Value

McpOptions

Parser

public static MessageParser<NetworkEndpoint> Parser { get; }

Property Value

MessageParser<NetworkEndpoint>

Path

Optional HTTP path glob that scopes this L7 endpoint on shared host:port APIs. Example: use path "/graphql" for protocol "graphql" and "/repos/**" for protocol "rest" when both surfaces live under api.example.com:443. Empty means all paths.

public string Path { get; set; }

Property Value

string

PersistedQueries

GraphQL persisted-query behavior for hash-only/saved-query requests: "deny" (default) or "allow_registered".

public string PersistedQueries { get; set; }

Property Value

string

Port

Single port (backwards compat). Use ports for multiple ports. Mutually exclusive with ports — if both are set, ports takes precedence.

public uint Port { get; set; }

Property Value

uint

Ports

Multiple ports. When non-empty, this endpoint covers all listed ports. If port is set and ports is empty, port is normalized to ports: [port]. If both are set, ports takes precedence.

public RepeatedField<uint> Ports { get; }

Property Value

RepeatedField<uint>

Protocol

Endpoint protocol. "tcp" and "" select L4-only handling; "rest", "websocket", "graphql", "sql", "json-rpc", and "mcp" select L7 inspection.

public string Protocol { get; set; }

Property Value

string

ProviderCredentialed

Internal gateway-derived marker indicating that this endpoint belongs to an attached credentialed provider. User-authored values are ignored.

public bool ProviderCredentialed { get; set; }

Property Value

bool

RequestBodyCredentialRewrite

When true on a "rest" endpoint, OpenShell rewrites credential placeholders inside supported textual HTTP request bodies before forwarding upstream. Defaults to false.

public bool RequestBodyCredentialRewrite { get; set; }

Property Value

bool

Rules

Explicit L7 rules (mutually exclusive with access).

public RepeatedField<L7Rule> Rules { get; }

Property Value

RepeatedField<L7Rule>

SigningRegion

AWS region override for SigV4 signing. When set, takes precedence over hostname-based region extraction. Required for non-standard endpoints.

public string SigningRegion { get; set; }

Property Value

string

SigningService

AWS signing service name override. Required when credential_signing is "sigv4" — e.g. "bedrock" for bedrock-runtime endpoints.

public string SigningService { get; set; }

Property Value

string

Tls

TLS handling. Unspecified enables automatic detection and termination.

public NetworkTlsMode Tls { get; set; }

Property Value

NetworkTlsMode

TokenGrantOwner

Internal gateway-derived identity of this endpoint's token-grant authority. It binds the provider record and complete profile policy, or the active global policy, to this endpoint. User-authored values are ignored.

public string TokenGrantOwner { get; set; }

Property Value

string

WebsocketCredentialRewrite

When true on a "rest" endpoint, OpenShell rewrites credential placeholders inside client-to-server WebSocket text messages after an allowed HTTP 101 upgrade. Defaults to false.

public bool WebsocketCredentialRewrite { get; set; }

Property Value

bool

Methods

CalculateSize()

Calculates the size of this message in Protocol Buffer wire format, in bytes.

public int CalculateSize()

Returns

int

The number of bytes required to write this message to a coded output stream.

Clone()

Creates a deep clone of this object.

public NetworkEndpoint Clone()

Returns

NetworkEndpoint

A deep clone of this object.

Equals(NetworkEndpoint)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(NetworkEndpoint other)

Parameters

other NetworkEndpoint

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object other)

Parameters

other object

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

MergeFrom(CodedInputStream)

Merges the data from the specified coded input stream with the current message.

public void MergeFrom(CodedInputStream input)

Parameters

input CodedInputStream

Remarks

See the user guide for precise merge semantics.

MergeFrom(NetworkEndpoint)

Merges the given message into this one.

public void MergeFrom(NetworkEndpoint other)

Parameters

other NetworkEndpoint

Remarks

See the user guide for precise merge semantics.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

WriteTo(CodedOutputStream)

Writes the data to the given coded output stream.

public void WriteTo(CodedOutputStream output)

Parameters

output CodedOutputStream

Coded output stream to write the data to. Must not be null.