Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: faster OIDC front/back-channel logout #3937

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alnr
Copy link
Contributor

@alnr alnr commented Feb 5, 2025

@alnr alnr self-assigned this Feb 5, 2025
@alnr alnr requested review from aeneasr and a team as code owners February 5, 2025 22:50
@alnr alnr force-pushed the alnr/faster-oidc-logout branch 2 times, most recently from 3a5ad64 to c0b6da1 Compare February 5, 2025 23:02
@alnr alnr force-pushed the alnr/faster-oidc-logout branch from c0b6da1 to aa1ee32 Compare February 6, 2025 00:37
Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good already!

(c.frontchannel_logout_uri IS NOT NULL AND c.frontchannel_logout_uri != '')
OR c.backchannel_logout_uri != ''
)`,
cols.QuotedString(p.Connection(ctx).Dialect),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, getting rid of select *


q = fmt.Sprintf(`
SELECT %s FROM %s c
WHERE id IN (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think WHERE EXISTS would be more performant here as the DB doesn't need to materialize the full sub query result.

p.NetworkID(ctx),
).All(&cs); err != nil {
return nil, sqlcon.HandleError(err)
for _, c := range cs {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid repeated allocations here.

Suggested change
for _, c := range cs {
withFrontChannelURL, withBackChannelURL = make([]client.Client, 0, len(cs)), make([]client.Client, 0, len(cs))
for _, c := range cs {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants