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

Missing autofix for methods related to jQuery.sap.*UrlWhitelist #525

Open
5 tasks
flovogt opened this issue Feb 10, 2025 · 1 comment
Open
5 tasks

Missing autofix for methods related to jQuery.sap.*UrlWhitelist #525

flovogt opened this issue Feb 10, 2025 · 1 comment
Labels
autofix An issue related to the autofix capabilities enhancement New feature or request

Comments

@flovogt
Copy link
Member

flovogt commented Feb 10, 2025

Missing autofix for methods related to jQuery.sap.*UrlWhitelist

Methods related to jQuery.sap.*UrlWhitelist are deprecated. Therefore an autofix should be offered by UI5 linter.

Deprecated APIs:

  • jQuery.sap.addUrlWhitelist
  • jQuery.sap.clearUrlWhitelist
  • jQuery.sap.getUrlWhitelist
  • jQuery.sap.validateUrl
  • jQuery.sap.removeUrlWhitelist

Deprecated Usage

jQuery.sap.addUrlWhitelist("https", "example.com", 1337, "path");
jQuery.sap.clearUrlWhitelist();
var aEntries = jQuery.sap.getUrlWhitelist();
jQuery.sap.validateUrl("https://example.com");
jQuery.sap.removeUrlWhitelist(0);

Recommended Usage

sap.ui.define([
  "sap/base/security/URLListValidator"
], (URLListValidator) => {
  URLListValidator.add("https", "example.com", 1337, "path");
   URLListValidator.clear();
   var aEntries = URLListValidator.entries();
   URLListValidator.validate("https://example.com");
    
   var aCurrentEntries = URLListValidator.entries();
   aCurrentEntries.splice(0, 1);
   URLListValidator.clear();
   aCurrentEntries.forEach(({protocol, host, port, path}) => URLListValidator.add(protocol, host, port, path));
});

Note: jQuery.sap.removeUrlWhitelist is replaced by the usage of sap/base/security/URLListValidator.entries and sap/base/security/URLListValidator.clear

@flovogt flovogt added autofix An issue related to the autofix capabilities enhancement New feature or request labels Feb 10, 2025
@flovogt
Copy link
Member Author

flovogt commented Feb 10, 2025

Will be implemented in CPOUI5FOUNDATION-990.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autofix An issue related to the autofix capabilities enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant