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

Optimize cleanupTokenByTokenValue logic #2508

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mpmadhavig
Copy link
Contributor

@mpmadhavig mpmadhavig commented Jun 27, 2024

Proposed changes in this pull request

In this PR the cleanupTokenByTokenValue method will be optimized so that the select query related to prepare the oldAccessTokenObject will be executed only when the retain_access_tokens_for_auditing config is enabled.

A new token deletion logic has been introduced to use the token hash, instead of the ID.

Related issues: wso2/product-is#20601

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/9695418391
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/9695418391

@@ -64,48 +64,57 @@ public void cleanupTokenByTokenId(String tokenId, Connection connection) throws
}
}

public void cleanupTokenByTokenValue(String token, Connection connection) throws SQLException {
Copy link
Contributor

Choose a reason for hiding this comment

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

is it ok to remove public method here?

* @param connection Database connection.
* @throws SQLException If an error occurs while cleaning up the token.
*/
public void cleanupTokenByTokenValue(String tokenHash, Connection connection) throws SQLException {
Copy link
Contributor

Choose a reason for hiding this comment

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

name should be cleanupTokenByTokenHash ?

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