From 986c024dd7d3f749b772437e5c3dbe4902c69460 Mon Sep 17 00:00:00 2001 From: Misi Date: Mon, 4 Nov 2024 09:55:29 +0100 Subject: [PATCH] Auth: Update SAML lib (#94745) * Update lib * Add missing TestIntegration prefix * Update go.sum, go.work.sum --- go.mod | 2 +- go.sum | 4 ++-- go.work | 2 ++ go.work.sum | 2 ++ .../auth/authimpl/external_session_store_test.go | 14 ++++++-------- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index c2bd1d16128..ccf7fff20e1 100644 --- a/go.mod +++ b/go.mod @@ -487,7 +487,7 @@ require ( ) // Use fork of crewjam/saml with fixes for some issues until changes get merged into upstream -replace github.com/crewjam/saml => github.com/grafana/saml v0.4.15-0.20240523142256-cc370b98af7c +replace github.com/crewjam/saml => github.com/grafana/saml v0.4.15-0.20240917091248-ae3bbdad8a56 // Use our fork of the upstream alertmanagers. // This is required in order to get notification delivery errors from the receivers API. diff --git a/go.sum b/go.sum index 9b11dd5bc84..110a42296f6 100644 --- a/go.sum +++ b/go.sum @@ -2311,8 +2311,8 @@ github.com/grafana/pyroscope/api v0.3.0/go.mod h1:JggA80ToAAUACYGfwL49XoFk5aN5ec github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc h1:GN2Lv3MGO7AS6PrRoT6yV5+wkrOpcszoIsO4+4ds248= github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc/go.mod h1:+JKpmjMGhpgPL+rXZ5nsZieVzvarn86asRlBg4uNGnk= -github.com/grafana/saml v0.4.15-0.20240523142256-cc370b98af7c h1:SWmG1QLZ36Ay0htq4Wt3dzlNIhWvQ3GUf7mk19dR8nI= -github.com/grafana/saml v0.4.15-0.20240523142256-cc370b98af7c/go.mod h1:S4+611dxnKt8z/ulbvaJzcgSHsuhjVc1QHNTcr1R7Fw= +github.com/grafana/saml v0.4.15-0.20240917091248-ae3bbdad8a56 h1:SDGrP81Vcd102L3UJEryRd1eestRw73wt+b8vnVEFe0= +github.com/grafana/saml v0.4.15-0.20240917091248-ae3bbdad8a56/go.mod h1:S4+611dxnKt8z/ulbvaJzcgSHsuhjVc1QHNTcr1R7Fw= github.com/grafana/sqlds/v4 v4.1.0 h1:dPvqaxmLJYqj5/EgP08Xcyy6RVaDdO8hWHpP4c1FQX4= github.com/grafana/sqlds/v4 v4.1.0/go.mod h1:3Z3r99mgA7+3mzQhABsNZnNtjLx7a0bGOgLVdAsFt2M= github.com/grafana/tempo v1.5.1-0.20241001135150-ed943d7a56b2 h1:XMreZ1SPjLpd9zhql5FXKFYwAcgBzS2E2MOPx4n+FyY= diff --git a/go.work b/go.work index e75f9e25b4e..6f3930e77a3 100644 --- a/go.work +++ b/go.work @@ -25,3 +25,5 @@ replace xorm.io/xorm => ./pkg/util/xorm replace github.com/getkin/kin-openapi => github.com/getkin/kin-openapi v0.125.0 replace github.com/prometheus/alertmanager => github.com/grafana/prometheus-alertmanager v0.25.1-0.20240930132144-b5e64e81e8d3 + +replace github.com/crewjam/saml => github.com/grafana/saml v0.4.15-0.20240917091248-ae3bbdad8a56 diff --git a/go.work.sum b/go.work.sum index 41d2d29a57b..6a0d08d87f8 100644 --- a/go.work.sum +++ b/go.work.sum @@ -681,6 +681,8 @@ github.com/grafana/alerting v0.0.0-20240917171353-6c25eb6eff10/go.mod h1:GMLi6d0 github.com/grafana/cuetsy v0.1.10/go.mod h1:Ix97+CPD8ws9oSSxR3/Lf4ahU1I4Np83kjJmDVnLZvc= github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU= github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= +github.com/grafana/saml v0.4.15-0.20240917091248-ae3bbdad8a56 h1:SDGrP81Vcd102L3UJEryRd1eestRw73wt+b8vnVEFe0= +github.com/grafana/saml v0.4.15-0.20240917091248-ae3bbdad8a56/go.mod h1:S4+611dxnKt8z/ulbvaJzcgSHsuhjVc1QHNTcr1R7Fw= github.com/grafana/thema v0.0.0-20230511182720-3146087fcc26 h1:HX927q4X1n451pnGb8U0wq74i8PCzuxVjzv7TyD10kc= github.com/grafana/thema v0.0.0-20230511182720-3146087fcc26/go.mod h1:Pn9nfzCk7nV0mvNgwusgCjCROZP6nm4GpwTnmEhLT24= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= diff --git a/pkg/services/auth/authimpl/external_session_store_test.go b/pkg/services/auth/authimpl/external_session_store_test.go index 499bf7e59e4..439f6c1f1a2 100644 --- a/pkg/services/auth/authimpl/external_session_store_test.go +++ b/pkg/services/auth/authimpl/external_session_store_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestGetExternalSession(t *testing.T) { +func TestIntegrationGetExternalSession(t *testing.T) { if testing.Short() { t.Skip("skipping integration test") } @@ -39,7 +39,7 @@ func TestGetExternalSession(t *testing.T) { }) } -func TestFindExternalSessions(t *testing.T) { +func TestIntegrationListExternalSessions(t *testing.T) { if testing.Short() { t.Skip("skipping integration test") } @@ -47,9 +47,7 @@ func TestFindExternalSessions(t *testing.T) { t.Run("returns external sessions by ID", func(t *testing.T) { store := setupTest(t) - extSession := &auth.ExternalSession{ - AccessToken: "access-token", - } + extSession := &auth.ExternalSession{} err := store.Create(context.Background(), extSession) require.NoError(t, err) @@ -107,7 +105,7 @@ func TestFindExternalSessions(t *testing.T) { }) } -func TestDeleteExternalSessionsByUserID(t *testing.T) { +func TestIntegrationDeleteExternalSessionsByUserID(t *testing.T) { if testing.Short() { t.Skip("skipping integration test") } @@ -148,7 +146,7 @@ func TestDeleteExternalSessionsByUserID(t *testing.T) { }) } -func TestDeleteExternalSession(t *testing.T) { +func TestIntegrationDeleteExternalSession(t *testing.T) { if testing.Short() { t.Skip("skipping integration test") } @@ -178,7 +176,7 @@ func TestDeleteExternalSession(t *testing.T) { }) } -func TestBatchDeleteExternalSessionsByUserIDs(t *testing.T) { +func TestIntegrationBatchDeleteExternalSessionsByUserIDs(t *testing.T) { if testing.Short() { t.Skip("skipping integration test") }