From f77c804fade1ee482232fb74bcc8f419e13dbd4e Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Wed, 6 Nov 2024 14:28:40 +0000 Subject: [PATCH] fixup! Downgrade gorilla sessions preventing the publishing by traefik hub temporarily. --- main_test.go | 5 ++-- vendor/github.com/gorilla/sessions/LICENSE | 2 +- vendor/github.com/gorilla/sessions/README.md | 6 +---- vendor/github.com/gorilla/sessions/cookie.go | 21 ++++++++--------- .../gorilla/sessions/cookie_go111.go | 21 +++++++++++++++++ vendor/github.com/gorilla/sessions/options.go | 15 ++++-------- .../gorilla/sessions/options_go111.go | 23 +++++++++++++++++++ vendor/modules.txt | 4 ++-- 8 files changed, 64 insertions(+), 33 deletions(-) create mode 100644 vendor/github.com/gorilla/sessions/cookie_go111.go create mode 100644 vendor/github.com/gorilla/sessions/options_go111.go diff --git a/main_test.go b/main_test.go index eeef592..e91728a 100644 --- a/main_test.go +++ b/main_test.go @@ -863,9 +863,8 @@ func TestHandleLogout(t *testing.T) { }, endSessionURL: "https://provider/end-session", expectedStatus: http.StatusFound, - // Fix: The entire URL should be URL-encoded - expectedURL: "https://provider/end-session?id_token_hint=test.id.token&post_logout_redirect_uri=http%3A%2F%2Fexample.com%2F", - host: "test-host", + expectedURL: "https://provider/end-session?id_token_hint=test.id.token&post_logout_redirect_uri=http%3A%2F%2Fexample.com%2F", + host: "test-host", }, { name: "Successful logout without end session endpoint", diff --git a/vendor/github.com/gorilla/sessions/LICENSE b/vendor/github.com/gorilla/sessions/LICENSE index 7fa9009..bb9d80b 100644 --- a/vendor/github.com/gorilla/sessions/LICENSE +++ b/vendor/github.com/gorilla/sessions/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2024 The Gorilla Authors. All rights reserved. +Copyright (c) 2023 The Gorilla Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/vendor/github.com/gorilla/sessions/README.md b/vendor/github.com/gorilla/sessions/README.md index d2cbea6..3aef6a4 100644 --- a/vendor/github.com/gorilla/sessions/README.md +++ b/vendor/github.com/gorilla/sessions/README.md @@ -1,7 +1,4 @@ -# Gorilla Sessions - -> [!IMPORTANT] -> The latest version of this repository requires go 1.23 because of the new partitioned attribute. The last version that is compatible with older versions of go is v1.3.0. +# sessions ![testing](https://github.com/gorilla/sessions/actions/workflows/test.yml/badge.svg) [![codecov](https://codecov.io/github/gorilla/sessions/branch/main/graph/badge.svg)](https://codecov.io/github/gorilla/sessions) @@ -77,7 +74,6 @@ Other implementations of the `sessions.Store` interface: - [github.com/dsoprea/go-appengine-sessioncascade](https://github.com/dsoprea/go-appengine-sessioncascade) - Memcache/Datastore/Context in AppEngine - [github.com/kidstuff/mongostore](https://github.com/kidstuff/mongostore) - MongoDB - [github.com/srinathgs/mysqlstore](https://github.com/srinathgs/mysqlstore) - MySQL -- [github.com/danielepintore/gorilla-sessions-mysql](https://github.com/danielepintore/gorilla-sessions-mysql) - MySQL - [github.com/EnumApps/clustersqlstore](https://github.com/EnumApps/clustersqlstore) - MySQL Cluster - [github.com/antonlindstrom/pgstore](https://github.com/antonlindstrom/pgstore) - PostgreSQL - [github.com/boj/redistore](https://github.com/boj/redistore) - Redis diff --git a/vendor/github.com/gorilla/sessions/cookie.go b/vendor/github.com/gorilla/sessions/cookie.go index fd6f48c..6612662 100644 --- a/vendor/github.com/gorilla/sessions/cookie.go +++ b/vendor/github.com/gorilla/sessions/cookie.go @@ -1,6 +1,5 @@ -// Copyright 2012 The Gorilla Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +//go:build !go1.11 +// +build !go1.11 package sessions @@ -9,15 +8,13 @@ import "net/http" // newCookieFromOptions returns an http.Cookie with the options set. func newCookieFromOptions(name, value string, options *Options) *http.Cookie { return &http.Cookie{ - Name: name, - Value: value, - Path: options.Path, - Domain: options.Domain, - MaxAge: options.MaxAge, - Secure: options.Secure, - HttpOnly: options.HttpOnly, - Partitioned: options.Partitioned, - SameSite: options.SameSite, + Name: name, + Value: value, + Path: options.Path, + Domain: options.Domain, + MaxAge: options.MaxAge, + Secure: options.Secure, + HttpOnly: options.HttpOnly, } } diff --git a/vendor/github.com/gorilla/sessions/cookie_go111.go b/vendor/github.com/gorilla/sessions/cookie_go111.go new file mode 100644 index 0000000..9b58828 --- /dev/null +++ b/vendor/github.com/gorilla/sessions/cookie_go111.go @@ -0,0 +1,21 @@ +//go:build go1.11 +// +build go1.11 + +package sessions + +import "net/http" + +// newCookieFromOptions returns an http.Cookie with the options set. +func newCookieFromOptions(name, value string, options *Options) *http.Cookie { + return &http.Cookie{ + Name: name, + Value: value, + Path: options.Path, + Domain: options.Domain, + MaxAge: options.MaxAge, + Secure: options.Secure, + HttpOnly: options.HttpOnly, + SameSite: options.SameSite, + } + +} diff --git a/vendor/github.com/gorilla/sessions/options.go b/vendor/github.com/gorilla/sessions/options.go index 6ed7934..d33d076 100644 --- a/vendor/github.com/gorilla/sessions/options.go +++ b/vendor/github.com/gorilla/sessions/options.go @@ -1,11 +1,8 @@ -// Copyright 2012 The Gorilla Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +//go:build !go1.11 +// +build !go1.11 package sessions -import "net/http" - // Options stores configuration for a session or session store. // // Fields are a subset of http.Cookie fields. @@ -16,9 +13,7 @@ type Options struct { // deleted after the browser session ends. // MaxAge<0 means delete cookie immediately. // MaxAge>0 means Max-Age attribute present and given in seconds. - MaxAge int - Secure bool - HttpOnly bool - Partitioned bool - SameSite http.SameSite + MaxAge int + Secure bool + HttpOnly bool } diff --git a/vendor/github.com/gorilla/sessions/options_go111.go b/vendor/github.com/gorilla/sessions/options_go111.go new file mode 100644 index 0000000..af9cdf0 --- /dev/null +++ b/vendor/github.com/gorilla/sessions/options_go111.go @@ -0,0 +1,23 @@ +//go:build go1.11 +// +build go1.11 + +package sessions + +import "net/http" + +// Options stores configuration for a session or session store. +// +// Fields are a subset of http.Cookie fields. +type Options struct { + Path string + Domain string + // MaxAge=0 means no Max-Age attribute specified and the cookie will be + // deleted after the browser session ends. + // MaxAge<0 means delete cookie immediately. + // MaxAge>0 means Max-Age attribute present and given in seconds. + MaxAge int + Secure bool + HttpOnly bool + // Defaults to http.SameSiteDefaultMode + SameSite http.SameSite +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 2e7e35e..ed56d4b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -4,8 +4,8 @@ github.com/google/uuid # github.com/gorilla/securecookie v1.1.2 ## explicit; go 1.20 github.com/gorilla/securecookie -# github.com/gorilla/sessions v1.4.0 -## explicit; go 1.23 +# github.com/gorilla/sessions v1.3.0 +## explicit; go 1.20 github.com/gorilla/sessions # golang.org/x/time v0.7.0 ## explicit; go 1.18