Skip to content

Commit 11d2eeb

Browse files
authored
Merge pull request #4604 from deckhouse/2.45.1-prepare-release
v2.45.1 prepare release
2 parents bcc2283 + eaa45e2 commit 11d2eeb

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

connector/authproxy/authproxy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,20 @@ type callback struct {
8383
}
8484

8585
// LoginURL returns the URL to redirect the user to login with.
86-
func (m *callback) LoginURL(s connector.Scopes, callbackURL, state string) (string, error) {
86+
func (m *callback) LoginURL(s connector.Scopes, callbackURL, state string) (string, []byte, error) {
8787
u, err := url.Parse(callbackURL)
8888
if err != nil {
89-
return "", fmt.Errorf("failed to parse callbackURL %q: %v", callbackURL, err)
89+
return "", nil, fmt.Errorf("failed to parse callbackURL %q: %v", callbackURL, err)
9090
}
9191
u.Path += m.pathSuffix
9292
v := u.Query()
9393
v.Set("state", state)
9494
u.RawQuery = v.Encode()
95-
return u.String(), nil
95+
return u.String(), nil, nil
9696
}
9797

9898
// HandleCallback parses the request and returns the user's identity
99-
func (m *callback) HandleCallback(s connector.Scopes, r *http.Request) (connector.Identity, error) {
99+
func (m *callback) HandleCallback(s connector.Scopes, _ []byte, r *http.Request) (connector.Identity, error) {
100100
remoteUser := r.Header.Get(m.userHeader)
101101
if remoteUser == "" {
102102
return connector.Identity{}, fmt.Errorf("required HTTP header %s is not set", m.userHeader)

connector/authproxy/authproxy_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestUser(t *testing.T) {
3636
"X-Remote-User": {testUsername},
3737
}
3838

39-
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, req)
39+
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, nil, req)
4040
expectNil(t, err)
4141

4242
// If not specified, the userID and email should fall back to the remote user
@@ -62,7 +62,7 @@ func TestExtraHeaders(t *testing.T) {
6262
"X-Remote-User-Email": {testEmail},
6363
}
6464

65-
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, req)
65+
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, nil, req)
6666
expectNil(t, err)
6767

6868
expectEquals(t, ident.UserID, testUserID)
@@ -85,7 +85,7 @@ func TestSingleGroup(t *testing.T) {
8585
"X-Remote-Group": {testGroup1},
8686
}
8787

88-
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, req)
88+
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, nil, req)
8989
expectNil(t, err)
9090

9191
expectEquals(t, ident.UserID, testEmail)
@@ -106,7 +106,7 @@ func TestMultipleGroup(t *testing.T) {
106106
"X-Remote-Group": {testGroup1 + ", " + testGroup2 + ", " + testGroup3 + ", " + testGroup4},
107107
}
108108

109-
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, req)
109+
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, nil, req)
110110
expectNil(t, err)
111111

112112
expectEquals(t, ident.UserID, testEmail)
@@ -132,7 +132,7 @@ func TestMultipleGroupWithCustomSeparator(t *testing.T) {
132132
"X-Remote-Group": {testGroup1 + ";" + testGroup2 + ";" + testGroup3 + ";" + testGroup4},
133133
}
134134

135-
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, req)
135+
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, nil, req)
136136
expectNil(t, err)
137137

138138
expectEquals(t, ident.UserID, testEmail)
@@ -158,7 +158,7 @@ func TestStaticGroup(t *testing.T) {
158158
"X-Remote-Group": {testGroup1 + ", " + testGroup2 + ", " + testGroup3 + ", " + testGroup4},
159159
}
160160

161-
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, req)
161+
ident, err := callback.HandleCallback(connector.Scopes{OfflineAccess: true, Groups: true}, nil, req)
162162
expectNil(t, err)
163163

164164
expectEquals(t, ident.UserID, testEmail)

connector/oauth/oauth.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ func (c *Config) Open(id string, logger *slog.Logger) (connector.Connector, erro
116116
return oauthConn, err
117117
}
118118

119-
func (c *oauthConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) {
119+
func (c *oauthConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, []byte, error) {
120120
if c.redirectURI != callbackURL {
121-
return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
121+
return "", nil, fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
122122
}
123123

124124
oauth2Config := &oauth2.Config{
@@ -129,10 +129,10 @@ func (c *oauthConnector) LoginURL(scopes connector.Scopes, callbackURL, state st
129129
Scopes: c.scopes,
130130
}
131131

132-
return oauth2Config.AuthCodeURL(state), nil
132+
return oauth2Config.AuthCodeURL(state), nil, nil
133133
}
134134

135-
func (c *oauthConnector) HandleCallback(s connector.Scopes, r *http.Request) (identity connector.Identity, err error) {
135+
func (c *oauthConnector) HandleCallback(s connector.Scopes, _ []byte, r *http.Request) (identity connector.Identity, err error) {
136136
q := r.URL.Query()
137137
if errType := q.Get("error"); errType != "" {
138138
return identity, errors.New(q.Get("error_description"))

connector/oauth/oauth_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestLoginURL(t *testing.T) {
5050

5151
conn := newConnector(t, testServer.URL)
5252

53-
loginURL, err := conn.LoginURL(connector.Scopes{}, conn.redirectURI, "some-state")
53+
loginURL, _, err := conn.LoginURL(connector.Scopes{}, conn.redirectURI, "some-state")
5454
assert.Equal(t, err, nil)
5555

5656
expectedURL, err := url.Parse(testServer.URL + "/authorize")
@@ -86,7 +86,7 @@ func TestHandleCallBackForGroupsInUserInfo(t *testing.T) {
8686
conn := newConnector(t, testServer.URL)
8787
req := newRequestWithAuthCode(t, testServer.URL, "TestHandleCallBackForGroupsInUserInfo")
8888

89-
identity, err := conn.HandleCallback(connector.Scopes{Groups: true}, req)
89+
identity, err := conn.HandleCallback(connector.Scopes{Groups: true}, nil, req)
9090
assert.Equal(t, err, nil)
9191

9292
sort.Strings(identity.Groups)
@@ -122,7 +122,7 @@ func TestHandleCallBackForGroupMapsInUserInfo(t *testing.T) {
122122
conn := newConnector(t, testServer.URL)
123123
req := newRequestWithAuthCode(t, testServer.URL, "TestHandleCallBackForGroupMapsInUserInfo")
124124

125-
identity, err := conn.HandleCallback(connector.Scopes{Groups: true}, req)
125+
identity, err := conn.HandleCallback(connector.Scopes{Groups: true}, nil, req)
126126
assert.Equal(t, err, nil)
127127

128128
sort.Strings(identity.Groups)
@@ -156,7 +156,7 @@ func TestHandleCallBackForGroupsInToken(t *testing.T) {
156156
conn := newConnector(t, testServer.URL)
157157
req := newRequestWithAuthCode(t, testServer.URL, "TestHandleCallBackForGroupsInToken")
158158

159-
identity, err := conn.HandleCallback(connector.Scopes{Groups: true}, req)
159+
identity, err := conn.HandleCallback(connector.Scopes{Groups: true}, nil, req)
160160
assert.Equal(t, err, nil)
161161

162162
assert.Equal(t, len(identity.Groups), 1)
@@ -186,7 +186,7 @@ func TestHandleCallbackForNumericUserID(t *testing.T) {
186186
conn := newConnector(t, testServer.URL)
187187
req := newRequestWithAuthCode(t, testServer.URL, "TestHandleCallbackForNumericUserID")
188188

189-
identity, err := conn.HandleCallback(connector.Scopes{Groups: true}, req)
189+
identity, err := conn.HandleCallback(connector.Scopes{Groups: true}, nil, req)
190190
assert.Equal(t, err, nil)
191191

192192
assert.Equal(t, identity.UserID, "1000")

storage/sql/sql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var (
9595
// For compound indexes (with two keys) even less.
9696
{matchLiteral("text"), "varchar(384)"},
9797
// Quote keywords and reserved words used as identifiers.
98-
{regexp.MustCompile(`\b(keys)\b`), "`$1`"},
98+
{regexp.MustCompile(`\b(keys|groups)\b`), "`$1`"},
9999
// Change default timestamp to fit datetime.
100100
{regexp.MustCompile(`0001-01-01 00:00:00 UTC`), "1000-01-01 00:00:00"},
101101
},

0 commit comments

Comments
 (0)