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

KNOX-3025 - Optimize knoxauth.js #892

Closed
wants to merge 2 commits into from
Closed

Conversation

RedYetiDev
Copy link

@RedYetiDev RedYetiDev commented Mar 24, 2024

(It is very important that you created an Apache Knox JIRA for this change and that the PR title/commit message includes the Apache Knox JIRA ID!)

I've requested an account, but do not currently have one. Sorry.

What changes were proposed in this pull request?

This PR reimplements the knoxauth.js file using modern browser features. Additionally, it changes the jQuery functions back to native JavaScript functions for speed and complexity reasons, and removes the userAgent declaration, as it is never used.

How was this patch tested?

This patch was tested manually via each function one at a time.
get("param") -> 'value' with ?param=value
testSameOrigin("https://some.other.site") -> false with https://some.safe.site
testSameOrigin("https://same.safe.site") -> true with https://some.safe.site
redirect("https://www.google.com") -> Redirection successful
unicodeBase64Encode("Hello World") -> 'SGVsbG8gV29ybGQ=' (Although unescape and escape are deprecated, I left unescape in the code)
keypressed({keyCode:13}) -> login() called
login() with admin/password and ?originalUrl=TEST_ORIG_URL -> Redirection to redirecting.html?originalUrl=TEST_ORIG_URL (Initially failure, see commit e417884)

Please review Knox Contributing Process before opening a pull request.

@smolnar82
Copy link
Contributor

@RedYetiDev - I've just approved your JIRA account request. Could you please login and create the relevant KNOX ticket (explaining the issues in the current implementation and your suggestions)? Then you can update this PR with the appropriate KNOX JIRA ID.
Thanks!

@RedYetiDev RedYetiDev changed the title Optimize knoxauth.js KNOX-3024 - Optimize knoxauth.js Mar 26, 2024
@RedYetiDev RedYetiDev changed the title KNOX-3024 - Optimize knoxauth.js KNOX-???? - Optimize knoxauth.js Mar 26, 2024
@RedYetiDev RedYetiDev changed the title KNOX-???? - Optimize knoxauth.js KNOX-3025 - Optimize knoxauth.js Mar 26, 2024
@RedYetiDev
Copy link
Author

Apologies for the mistake, Jira pulled up the wrong issue initially (weird!). Please see KNOX-3025

@RedYetiDev RedYetiDev closed this by deleting the head repository Apr 5, 2024
@RedYetiDev
Copy link
Author

Please ignore the close, I will re open this shortly, I accidentally deleted the repository

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