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

Sync APIs. @tag-name=gloo-stateful_session_oss #1216

Open
wants to merge 1 commit into
base: gloo-main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
syntax = "proto3";

package stateful_session.options.gloo.solo.io;

option go_package = "github.com/solo-io/solo-apis/pkg/api/gloo.solo.io/v1/enterprise/options/stateful_session";

import "google/protobuf/duration.proto";
import "validate/validate.proto";

// This configures the Envoy [Stateful Session](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/stateful_session_filter) filter for a listener
message StatefulSession {

oneof SessionState {
option (validate.required) = true;
// Configure a cookie based session state - https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/http/stateful_session/cookie/v3/cookie.proto#envoy-v3-api-msg-extensions-http-stateful-session-cookie-v3-cookiebasedsessionstate
// Exactly one of `cookie_based` or `header_based` must be set.
CookieBasedSessionState cookie_based = 1;
// Configure a header based session state - https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/http/stateful_session/cookie/v3/cookie.proto#envoy-v3-api-msg-extensions-http-stateful-session-cookie-v3-cookiebasedsessionstate
// Exactly one of `cookie_based` or `header_based` must be set.
HeaderBasedSessionState header_based = 2;
}

// If set to True, the HTTP request must be routed to the requested destination. If the requested destination is not available, Envoy returns 503. Defaults to False.
bool strict = 3;
}

// Configuration for the [cookie-based session state](https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/http/stateful_session/cookie/v3/cookie.proto#envoy-v3-api-msg-extensions-http-stateful-session-cookie-v3-cookiebasedsessionstate) filter
message CookieBasedSessionState {
message Cookie {
// Required, the name that will be used to obtain cookie value from downstream HTTP request or generate new cookie for downstream.
string name = 1 [(validate.rules).message.required = true];
// Path of cookie. This will be used to set the path of a new cookie when it is generated. If no path is specified here, no path will be set for the cookie.
string path = 2;
// Duration of cookie. This will be used to set the expiry time of a new cookie when it is generated. Set this to 0s to use a session cookie and disable cookie expiration.
google.protobuf.Duration ttl = 3 [
(validate.rules).duration = {
required: true,
gt: {seconds: 0}
}
];
}

// Required, the cookie configuration used to track session state.
Cookie cookie = 1 [(validate.rules).message.required = true];
}


// Configuration for the [header-based session state](https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/http/stateful_session/header/v3/header.proto#extension-envoy-http-stateful-session-header) filter
message HeaderBasedSessionState {
// Required, the header used to track session state.
string header_name = 1 [(validate.rules).message.required = true];
}
4 changes: 4 additions & 0 deletions api/gloo/gloo/v1/options.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import "github.com/solo-io/solo-apis/api/gloo/gloo/v1/enterprise/options/dlp/dlp
import "github.com/solo-io/solo-apis/api/gloo/gloo/v1/enterprise/options/tap/tap.proto";
import "github.com/solo-io/solo-apis/api/gloo/gloo/v1/options/transformation/transformation.proto";
import "github.com/solo-io/solo-apis/api/gloo/gloo/v1/options/dynamic_forward_proxy/dynamic_forward_proxy.proto";
import "github.com/solo-io/solo-apis/api/gloo/gloo/v1/enterprise/options/stateful_session/stateful_session.proto";

import "github.com/solo-io/solo-kit/api/external/envoy/api/v2/core/base.proto";
import "github.com/solo-io/solo-kit/api/external/envoy/api/v2/core/socket_option.proto";
Expand Down Expand Up @@ -227,6 +228,9 @@ message HttpListenerOptions {

// Enterprise only: Tap filter settings (experimental).
tap.options.gloo.solo.io.Tap tap = 34;

// Enterprise only: Listener-level stateful session settings
stateful_session.options.gloo.solo.io.StatefulSession stateful_session = 35;
}

// Optional, feature-specific configuration that lives on tcp listeners
Expand Down
Loading
Loading