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 2 commits 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 27.27273% with 8 lines in your changes missing coverage. Please review.

Project coverage is 54.99%. Comparing base (bc0033a) to head (a647341).
Report is 25 commits behind head on master.

Files with missing lines Patch % Lines
...carbon/identity/oauth2/dao/AccessTokenDAOImpl.java 0.00% 5 Missing ⚠️
.../handlers/grant/AuthorizationCodeGrantHandler.java 0.00% 2 Missing ⚠️
...java/org/wso2/carbon/identity/oauth/OAuthUtil.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2623      +/-   ##
============================================
- Coverage     55.96%   54.99%   -0.97%     
- Complexity     8173     8245      +72     
============================================
  Files           632      632              
  Lines         46949    48215    +1266     
  Branches       7816     8191     +375     
============================================
+ Hits          26275    26517     +242     
- Misses        16893    17878     +985     
- Partials       3781     3820      +39     
Flag Coverage Δ
unit 38.65% <27.27%> (-0.03%) ⬇️

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

@Thumimku
Copy link
Contributor

Hi @sadilchamishka,

⚠️ Notice: This PR has been open for a while. To keep the repository clean and up-to-date, this PR will be closed within the next two weeks if there is no further activity.

Please take one of the following actions:

  • Merge the PR if it is ready.
  • Close the PR if it is no longer relevant.
  • Leave a comment explaining why it should remain open and provide an update on its progress.

Your prompt attention to this matter is greatly appreciated. Thank you for your understanding and collaboration! 🙏

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