From 5d3513e3a36656e4626cf0292ecaf9f7f1690ad8 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Thu, 13 Mar 2025 09:59:23 -0500 Subject: [PATCH] make gen --- enterprise/cli/proxyserver.go | 2 +- enterprise/wsproxy/wsproxy.go | 8 ++++---- site/src/api/typesGenerated.ts | 8 +++++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/enterprise/cli/proxyserver.go b/enterprise/cli/proxyserver.go index a4a989ae04..a88fdc3e51 100644 --- a/enterprise/cli/proxyserver.go +++ b/enterprise/cli/proxyserver.go @@ -264,7 +264,7 @@ func (r *RootCmd) proxyServer() *serpent.Command { Tracing: tracer, PrometheusRegistry: prometheusRegistry, APIRateLimit: int(cfg.RateLimit.API.Value()), - SecureAuthCookie: cfg.SecureAuthCookie.Value(), + CookieConfig: cfg.HTTPCookies, DisablePathApps: cfg.DisablePathApps.Value(), ProxySessionToken: proxySessionToken.Value(), AllowAllCors: cfg.Dangerous.AllowAllCors.Value(), diff --git a/enterprise/wsproxy/wsproxy.go b/enterprise/wsproxy/wsproxy.go index af4d5064f4..c247c0f817 100644 --- a/enterprise/wsproxy/wsproxy.go +++ b/enterprise/wsproxy/wsproxy.go @@ -70,7 +70,7 @@ type Options struct { TLSCertificates []tls.Certificate APIRateLimit int - SecureAuthCookie bool + CookieConfig codersdk.HTTPCookieConfig DisablePathApps bool DERPEnabled bool DERPServerRelayAddress string @@ -310,8 +310,8 @@ func New(ctx context.Context, opts *Options) (*Server, error) { Logger: s.Logger.Named("proxy_token_provider"), }, - DisablePathApps: opts.DisablePathApps, - SecureAuthCookie: opts.SecureAuthCookie, + DisablePathApps: opts.DisablePathApps, + Cookies: opts.CookieConfig, AgentProvider: agentProvider, StatsCollector: workspaceapps.NewStatsCollector(opts.StatsCollectorOptions), @@ -362,7 +362,7 @@ func New(ctx context.Context, opts *Options) (*Server, error) { }, // CSRF is required here because we need to set the CSRF cookies on // responses. - httpmw.CSRF(s.Options.SecureAuthCookie), + httpmw.CSRF(s.Options.CookieConfig), ) // Attach workspace apps routes. diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index 6fdfb5ea9d..85ea48b100 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -640,7 +640,7 @@ export interface DeploymentValues { readonly telemetry?: TelemetryConfig; readonly tls?: TLSConfig; readonly trace?: TraceConfig; - readonly secure_auth_cookie?: boolean; + readonly http_cookies?: HTTPCookieConfig; readonly strict_transport_security?: number; readonly strict_transport_security_options?: string; readonly ssh_keygen_algorithm?: string; @@ -958,6 +958,12 @@ export interface GroupSyncSettings { readonly legacy_group_name_mapping?: Record; } +// From codersdk/deployment.go +export interface HTTPCookieConfig { + readonly secure_auth_cookie?: boolean; + readonly same_site?: string; +} + // From health/model.go export type HealthCode = | "EACS03"