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: wrap the final response from /oauth2/authorize in a transaction #3595

Closed
wants to merge 4 commits into from

Conversation

alnr
Copy link
Contributor

@alnr alnr commented Aug 4, 2023

Primarily, this is a performance enhancement when using CockroachDB global tables.

@alnr alnr self-assigned this Aug 4, 2023
@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Merging #3595 (5b1505f) into master (eb89af7) will decrease coverage by 0.08%.
Report is 1 commits behind head on master.
The diff coverage is 70.21%.

❗ Current head 5b1505f differs from pull request most recent head fa79917. Consider uploading reports for the commit fa79917 to get more accurate results

@@            Coverage Diff             @@
##           master    #3595      +/-   ##
==========================================
- Coverage   76.39%   76.31%   -0.08%     
==========================================
  Files         130      130              
  Lines        9746     9766      +20     
==========================================
+ Hits         7445     7453       +8     
- Misses       1799     1807       +8     
- Partials      502      506       +4     
Files Changed Coverage Δ
cmd/server/handler.go 1.33% <0.00%> (-0.04%) ⬇️
consent/handler.go 65.07% <ø> (+0.90%) ⬆️
x/clean_sql.go 90.90% <0.00%> (-0.21%) ⬇️
oauth2/handler.go 65.66% <36.36%> (-1.48%) ⬇️
consent/strategy_default.go 68.97% <100.00%> (+0.47%) ⬆️
persistence/sql/persister_oauth2.go 84.88% <100.00%> (-0.65%) ⬇️

@aeneasr
Copy link
Member

aeneasr commented May 7, 2024

All important changes from this PR are on master already, with the exception of the transaction which is done in https://github.com/ory/hydra/pull/3763/files

@aeneasr aeneasr closed this May 7, 2024
@@ -1060,6 +1061,12 @@ func (h *Handler) oAuth2Authorize(w http.ResponseWriter, r *http.Request, _ http
claims.Add("sid", session.ConsentRequest.LoginSessionID)

// done
ctx, err = storage.MaybeBeginTx(ctx, h.r.OAuth2Storage())
Copy link
Member

Choose a reason for hiding this comment

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

You can just use Transaction for this as it's using the same underlying context key: https://github.com/ory/hydra/pull/3763/files

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.

3 participants