Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix + docs: fix $sceDelegateProvider.resourceUrlWhitelist() and fix docs on recently deprecated properties/methods #17090

Closed

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Oct 13, 2020

This PR includes the following fixes (see the individual commits for more details):

  • fix($sceDelegate): make `resourceUrlWhitelist()` is identical `trustedResourceUrlList()`
  • docs(*): fix docs on recently deprecated properties/methods

In commits 9679e58..3dd42ce, some properties
and methods names including the terms whitelist/blacklist were
deprecated in favor of new ones not including the terms.

This commit fixes some typos in docs related to these changes and adds
links to the new properties/methods in the changelog for easier access.

Fixes angular#17088
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes in the first commit.
I don't quite understand the 2nd commit. These are methods not properties, so why would they be overwritten? I am pretty sure that would not be a supported scenario even before...

* This method is deprecated. Use {@link $sceDelegateProvider#trustedResourceUrlList
* trustedResourceUrlList} instead.
*/
Object.defineProperty(this, 'resourceUrlWhitelist', {
Copy link
Member

Choose a reason for hiding this comment

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

OK, so we need a 1.8.2...

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm afraid we do 😁

@mgol
Copy link
Member

mgol commented Oct 13, 2020

I don't quite understand the 2nd commit. These are methods not properties, so why would they be overwritten? I am pretty sure that would not be a supported scenario even before...

@petebacondarwin I can imagine monkey-patching by third-party libraries. Also, we're now inconsistent as some APIs deprecated in 1.8.1 already have this treatment and resourceUrlWhitelist does not.

…dResourceUrlList()`

In commit a206e26, `$sceDelegateProvider`'s
`resourceUrlWhitelist()` was deprecated in favor of the new
`trustedResourceUrlList()`. However, although both properties were
assigned the same value, it was possible for an app to break if one of
the properties was overwritten in one part of the app (or a 3rd-party
library) while another part of the app interacts with the other,
non-overwritten property.

This commit fixes it by making `resourceUrlWhitelist()` a getter/setter
that delegates to `trustedResourceUrlList()`, ensuring that the two
properties will remain in sync. This, also, makes it consistent with
other similar deprecated properties, such as `$sceDelegateProvider`'s
`resourceUrlBlacklist()`.
@gkalpak gkalpak force-pushed the docs-deprecated-sanitization-lists branch from 3fdeff7 to 527a2ae Compare October 13, 2020 21:00
@gkalpak gkalpak closed this in e41f018 Oct 14, 2020
gkalpak added a commit that referenced this pull request Oct 14, 2020
…dResourceUrlList()`

In commit a206e26, `$sceDelegateProvider`'s
`resourceUrlWhitelist()` was deprecated in favor of the new
`trustedResourceUrlList()`. However, although both properties were
assigned the same value, it was possible for an app to break if one of
the properties was overwritten in one part of the app (or a 3rd-party
library) while another part of the app interacts with the other,
non-overwritten property.

This commit fixes it by making `resourceUrlWhitelist()` a getter/setter
that delegates to `trustedResourceUrlList()`, ensuring that the two
properties will remain in sync. This, also, makes it consistent with
other similar deprecated properties, such as `$sceDelegateProvider`'s
`resourceUrlBlacklist()`.

Closes #17090
@gkalpak gkalpak deleted the docs-deprecated-sanitization-lists branch October 14, 2020 12:46
AnkushLambdatest pushed a commit to AnkushLambdatest/angular.js that referenced this pull request Jun 29, 2022
…dResourceUrlList()`

In commit a206e26, `$sceDelegateProvider`'s
`resourceUrlWhitelist()` was deprecated in favor of the new
`trustedResourceUrlList()`. However, although both properties were
assigned the same value, it was possible for an app to break if one of
the properties was overwritten in one part of the app (or a 3rd-party
library) while another part of the app interacts with the other,
non-overwritten property.

This commit fixes it by making `resourceUrlWhitelist()` a getter/setter
that delegates to `trustedResourceUrlList()`, ensuring that the two
properties will remain in sync. This, also, makes it consistent with
other similar deprecated properties, such as `$sceDelegateProvider`'s
`resourceUrlBlacklist()`.

Closes angular#17090
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants