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

Improve request object clean up logic to avoid unnecessary delete requests #2623

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

Conversation

sadilchamishka
Copy link
Contributor

@sadilchamishka sadilchamishka commented Nov 11, 2024

Proposed changes in this pull request

The request object tables get entries added for the authorization request object flow only. For the normal authorization flows, try to delete from request object tables is a cost.

  • Improved authorization code revocation logics to pass the authz code and authz code-id which help to detect the flow is request object flow which help to avoid unnecessary operations.

When internal token clean up is disabled, tryin to delete the request objects from the relevant tables are unnecessary. Internal token clean ups are disabled to improve the performance at the runtime, but clean the tables as back office task.

  • Call the request object handling for token-ids when internal token clean up is enabled.

The request object table has foreign key constraints with authz-code and access-token tables with on delete cascade approach except for the mssql database. Hence there is no need to delete the records via an event listener. Only for the MSSQL server databases, we can consider of invoking the listener. But ideally we could have improved it to delete via a trigger.

  • Call the request object handling for token-ids only for mssql database type.

Related Issues

@sadilchamishka sadilchamishka force-pushed the remove-unnecessary-request-object-cleanup branch from edbf94e to f4b2b22 Compare November 11, 2024 02:28
@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/11771052364

Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 55.95%. Comparing base (bc0033a) to head (f4b2b22).

Files with missing lines Patch % Lines
...carbon/identity/oauth2/dao/AccessTokenDAOImpl.java 0.00% 2 Missing ⚠️
.../handlers/grant/AuthorizationCodeGrantHandler.java 0.00% 2 Missing ⚠️
...java/org/wso2/carbon/identity/oauth/OAuthUtil.java 0.00% 1 Missing ⚠️
.../identity/oauth2/dao/AuthorizationCodeDAOImpl.java 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2623      +/-   ##
============================================
- Coverage     55.96%   55.95%   -0.01%     
+ Complexity     8173     8169       -4     
============================================
  Files           632      632              
  Lines         46949    46949              
  Branches       7816     7816              
============================================
- Hits          26275    26272       -3     
- Misses        16893    16897       +4     
+ Partials       3781     3780       -1     
Flag Coverage Δ
unit 38.62% <25.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/11771052364
Status: cancelled

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/11772816968

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/11772816968
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

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

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/11772816968

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