Skip to content

Commit 8401a41

Browse files
author
modoulo boly sow
committed
style: add newlines to improve code readability per linter suggestions
Signed-off-by: modoulo boly sow <[email protected]>
1 parent 8e0feef commit 8401a41

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/auth/oidc_connect.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,12 @@ func (o *OIDCConnect) callbackHandler(ctx context.Context, u *url.URL) (Response
224224
fmt.Sprintf("%s://%s?%s=%s", state.Scheme, state.RequestPath, stateQueryParamName, state.OAuthState))
225225

226226
stateJSON, _ := json.Marshal(state)
227-
resp.Response.Header.Add("Set-Cookie", fmt.Sprintf("%s=%s; Path=/; Secure; SameSite=Lax", oauthTokenName, string(stateJSON)))
227+
resp.Response.Header.Add("Set-Cookie",
228+
fmt.Sprintf("%s=%s; Path=/; Secure; SameSite=Lax", oauthTokenName, string(stateJSON)))
229+
230+
// TODO(robinfoe) #18 : OIDC support should propagate any claims back to the request
231+
resp.Response.Header.Add("Set-Cookie",
232+
fmt.Sprintf("%s=%s; Path=/; Secure; SameSite=Lax", oauthTokenName, string(stateJSON)))
228233

229234
return resp, nil
230235
}
@@ -342,6 +347,7 @@ func matchDomain(domain string, allowedPatterns []string) bool {
342347
return true
343348
}
344349
}
350+
345351
return false
346352
}
347353

@@ -378,14 +384,18 @@ func matchPart(domainPart, patternPart string) bool {
378384

379385
// Check if the domain part matches the pattern parts in sequence.
380386
pos := 0
387+
381388
for _, part := range parts {
382389
if part == "" {
383390
continue
384391
}
392+
385393
index := strings.Index(domainPart[pos:], part)
394+
386395
if index == -1 {
387396
return false
388397
}
398+
389399
pos += index + len(part)
390400
}
391401

0 commit comments

Comments
 (0)