knox icon indicating copy to clipboard operation
knox copied to clipboard

KNOX-3025 - Optimize knoxauth.js

Open redyetidev opened this issue 11 months ago • 2 comments

(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 e41788498df9c884f0920baa8dbcc4a4c233ff91)

Please review Knox Contributing Process before opening a pull request.

redyetidev avatar Mar 24 '24 23:03 redyetidev

@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!

smolnar82 avatar Mar 26 '24 10:03 smolnar82

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

redyetidev avatar Mar 26 '24 13:03 redyetidev

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

redyetidev avatar Apr 05 '24 10:04 redyetidev