Skip to content

Commit feb792f

Browse files
♻️ Conformance check allowlist (ampproject#28778)
* Disallow older terms for allowlist
1 parent b7e2b2c commit feb792f

File tree

109 files changed

+441
-438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+441
-438
lines changed

ads/inabox/inabox-messaging-host.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class InaboxMessagingHost {
143143
? allowedTypes.split(/\s*,\s*/)
144144
: READ_ONLY_MESSAGES;
145145
if (allowedTypesList.indexOf(request['type']) === -1) {
146-
dev().info(TAG, 'Impermissible message type ignored:', message);
146+
dev().info(TAG, 'Message type ignored:', message);
147147
return false;
148148
}
149149

build-system/tasks/presubmit-checks.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ const realiasGetMode =
4848
// Terms that must not appear in our source files.
4949
const forbiddenTerms = {
5050
'DO NOT SUBMIT': '',
51+
'whitelist': {
52+
message: 'Please use the term allowlist',
53+
},
5154
'blacklist': {
5255
message: 'Please use the term denylist instead',
5356
},

contributing/TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ Additionally, you can create multiple projects and switch between them in the CL
413413

414414
#### Testing Ads
415415

416-
Testing ads in deployed demos requires whitelisting of 3p urls. You can do this by adding your intended deployment hostname as an environemnt variable `AMP_TESTING_HOST` and using the `fortesting` flag. For example:
416+
Testing ads in deployed demos requires allowlisting of 3p urls. You can do this by adding your intended deployment hostname as an environemnt variable `AMP_TESTING_HOST` and using the `fortesting` flag. For example:
417417

418418
```sh
419419
export AMP_TESTING_HOST="my-project.firebaseapp.com"

extensions/amp-ad-custom/amp-ad-custom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To make sure the template is valid AMPHTML, ad network must make an HTTP request
5151

5252
To update a template, an ad network just needs to update the page on their domain, then make another cache warm-up request.
5353

54-
Note: at this stage, domains need to be opted in manually in AMP Cache to experiment with the feature.
54+
Note: at this stage, domains need to be allowlisted manually in AMP Cache to experiment with the feature.
5555

5656
## Ad server
5757

extensions/amp-ad-network-doubleclick-impl/0.1/amp-ad-network-doubleclick-impl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ export class AmpAdNetworkDoubleclickImpl extends AmpA4A {
931931
/** @override */
932932
getCustomRealTimeConfigMacros_() {
933933
/**
934-
* This lists permissible attributes on the amp-ad element to be used as
934+
* This lists allowed attributes on the amp-ad element to be used as
935935
* macros for constructing the RTC URL. Add attributes here, in lowercase,
936936
* to make them available.
937937
*/

extensions/amp-analytics/0.1/analytics-group.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ export class AnalyticsGroup {
8080
addTrigger(config, handler) {
8181
const eventType = dev().assertString(config['on']);
8282
const trackerKey = getTrackerKeyName(eventType);
83-
const trackerAllowList = getTrackerTypesForParentType(this.root_.getType());
83+
const trackerAllowlist = getTrackerTypesForParentType(this.root_.getType());
8484

85-
const tracker = this.root_.getTrackerForAllowList(
85+
const tracker = this.root_.getTrackerForAllowlist(
8686
trackerKey,
87-
trackerAllowList
87+
trackerAllowlist
8888
);
8989
userAssert(
9090
!!tracker,

extensions/amp-analytics/0.1/analytics-root.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ export class AnalyticsRoot {
193193
* Returns the tracker for the specified name and list of allowed types.
194194
*
195195
* @param {string} name
196-
* @param {!Object<string, typeof ./events.EventTracker>} allowList
196+
* @param {!Object<string, typeof ./events.EventTracker>} allowlist
197197
* @return {?./events.EventTracker}
198198
*/
199-
getTrackerForAllowList(name, allowList) {
200-
const trackerProfile = allowList[name];
199+
getTrackerForAllowlist(name, allowlist) {
200+
const trackerProfile = allowlist[name];
201201
if (trackerProfile) {
202202
return this.getTracker(name, trackerProfile);
203203
}

extensions/amp-analytics/0.1/events.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ export class TimerEventTracker extends EventTracker {
11431143
const eventType = user().assertString(config['on']);
11441144
const trackerKey = getTrackerKeyName(eventType);
11451145

1146-
return this.root.getTrackerForAllowList(
1146+
return this.root.getTrackerForAllowlist(
11471147
trackerKey,
11481148
getTrackerTypesForParentType('timer')
11491149
);
@@ -1668,16 +1668,16 @@ export class VisibilityTracker extends EventTracker {
16681668
return null;
16691669
}
16701670

1671-
const trackerAllowList = getTrackerTypesForParentType('visible');
1671+
const trackerAllowlist = getTrackerTypesForParentType('visible');
16721672
userAssert(
1673-
waitForSpec == 'none' || trackerAllowList[waitForSpec] !== undefined,
1673+
waitForSpec == 'none' || trackerAllowlist[waitForSpec] !== undefined,
16741674
'waitFor value %s not supported',
16751675
waitForSpec
16761676
);
16771677

16781678
const waitForTracker =
16791679
this.waitForTrackers_[waitForSpec] ||
1680-
this.root.getTrackerForAllowList(waitForSpec, trackerAllowList);
1680+
this.root.getTrackerForAllowlist(waitForSpec, trackerAllowlist);
16811681
if (waitForTracker) {
16821682
this.waitForTrackers_[waitForSpec] = waitForTracker;
16831683
} else {

extensions/amp-analytics/0.1/requests.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class RequestHandler {
8787
this.transport_ = transport;
8888

8989
/** @const @private {!Object|undefined} */
90-
this.allowList_ = isSandbox ? SANDBOX_AVAILABLE_VARS : undefined;
90+
this.allowlist_ = isSandbox ? SANDBOX_AVAILABLE_VARS : undefined;
9191

9292
/** @private {?number} */
9393
this.batchIntervalTimeoutId_ = null;
@@ -142,14 +142,14 @@ export class RequestHandler {
142142
expansionOption,
143143
this.element_,
144144
bindings,
145-
this.allowList_
145+
this.allowlist_
146146
);
147147

148148
this.baseUrlPromise_ = this.baseUrlTemplatePromise_.then((baseUrl) => {
149149
return this.urlReplacementService_.expandUrlAsync(
150150
baseUrl,
151151
bindings,
152-
this.allowList_
152+
this.allowlist_
153153
);
154154
});
155155
}
@@ -170,14 +170,14 @@ export class RequestHandler {
170170
requestOriginExpansionOpt,
171171
this.element_,
172172
bindings,
173-
this.allowList_
173+
this.allowlist_
174174
)
175175
// substitute in URL values e.g. DOCUMENT_REFERRER -> https://example.com
176176
.then((expandedRequestOrigin) => {
177177
return this.urlReplacementService_.expandUrlAsync(
178178
expandedRequestOrigin,
179179
bindings,
180-
this.allowList_,
180+
this.allowlist_,
181181
true // opt_noEncode
182182
);
183183
});
@@ -192,7 +192,7 @@ export class RequestHandler {
192192
expansionOption,
193193
bindings,
194194
this.element_,
195-
this.allowList_
195+
this.allowlist_
196196
).then((params) => {
197197
return dict({
198198
'trigger': trigger['on'],
@@ -455,7 +455,7 @@ export function expandPostMessage(
455455
* @param {!./variables.ExpansionOptions} expansionOption
456456
* @param {!Object} bindings
457457
* @param {!Element} element
458-
* @param {!Object=} opt_allowList
458+
* @param {!Object=} opt_allowlist
459459
* @return {!Promise<!Object>}
460460
* @private
461461
*/
@@ -466,7 +466,7 @@ function expandExtraUrlParams(
466466
expansionOption,
467467
bindings,
468468
element,
469-
opt_allowList
469+
opt_allowlist
470470
) {
471471
const requestPromises = [];
472472
// Don't encode param values here,
@@ -484,7 +484,7 @@ function expandExtraUrlParams(
484484
const request = variableService
485485
.expandTemplate(value, option, element)
486486
.then((value) =>
487-
urlReplacements.expandStringAsync(value, bindings, opt_allowList)
487+
urlReplacements.expandStringAsync(value, bindings, opt_allowlist)
488488
)
489489
.then((value) => (params[key] = value));
490490
requestPromises.push(request);

extensions/amp-analytics/0.1/test/test-analytics-root.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,18 +637,18 @@ describes.realWin(
637637
const allowlist = {
638638
'custom': CustomEventTracker,
639639
};
640-
const customTracker = root.getTrackerForAllowList(
640+
const customTracker = root.getTrackerForAllowlist(
641641
AnalyticsEventType.CUSTOM,
642642
allowlist
643643
);
644644
expect(customTracker).to.be.instanceOf(CustomEventTracker);
645645
expect(customTracker.root).to.equal(root);
646646

647-
const noneTracker = root.getTrackerForAllowList('none', allowlist);
647+
const noneTracker = root.getTrackerForAllowlist('none', allowlist);
648648
expect(noneTracker).to.be.null;
649649

650650
expect(
651-
root.getTrackerForAllowList(AnalyticsEventType.CUSTOM, allowlist)
651+
root.getTrackerForAllowlist(AnalyticsEventType.CUSTOM, allowlist)
652652
).to.equal(customTracker);
653653
expect(
654654
root.getTracker(AnalyticsEventType.CUSTOM, CustomEventTracker)

0 commit comments

Comments
 (0)