Skip to content

Commit 54f2aeb

Browse files
authored
[Deprecation] Deprecate the Blacklist / Whitelist nomenclature (#1808)
This PR does deprecate the terminology blacklist / whitelist with denylist / allowlist Signed-off-by: kaddy645 <xdeskart@amazon.com>
1 parent 5fb4143 commit 54f2aeb

File tree

35 files changed

+240
-96
lines changed

35 files changed

+240
-96
lines changed

config/opensearch_dashboards.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@
131131
# Set the allowlist to check input graphite Url. Allowlist is the default check list.
132132
#vis_type_timeline.graphiteAllowedUrls: ['https://www.hostedgraphite.com/UID/ACCESS_KEY/graphite']
133133

134-
# Set the blocklist to check input graphite Url. Blocklist is an IP list.
134+
# Set the denylist to check input graphite Url. Denylist is an IP list.
135135
# Below is an example for reference
136+
136137
# vis_type_timeline.graphiteBlockedIPs: [
137138
# //Loopback
138139
# '127.0.0.0/8',
@@ -161,7 +162,37 @@
161162
# '2001:db8::/32',
162163
# 'ff00::/8',
163164
# ]
164-
#vis_type_timeline.graphiteBlockedIPs: []
165+
166+
# vis_type_timeline.graphiteDeniedIPs: []
167+
168+
# vis_type_timeline.graphiteDeniedIPs: [
169+
# //Loopback
170+
# '127.0.0.0/8',
171+
# '::1/128',
172+
# //Link-local Address for IPv6
173+
# 'fe80::/10',
174+
# //Private IP address for IPv4
175+
# '10.0.0.0/8',
176+
# '172.16.0.0/12',
177+
# '192.168.0.0/16',
178+
# //Unique local address (ULA)
179+
# 'fc00::/7',
180+
# //Reserved IP address
181+
# '0.0.0.0/8',
182+
# '100.64.0.0/10',
183+
# '192.0.0.0/24',
184+
# '192.0.2.0/24',
185+
# '198.18.0.0/15',
186+
# '192.88.99.0/24',
187+
# '198.51.100.0/24',
188+
# '203.0.113.0/24',
189+
# '224.0.0.0/4',
190+
# '240.0.0.0/4',
191+
# '255.255.255.255/32',
192+
# '::/128',
193+
# '2001:db8::/32',
194+
# 'ff00::/8',
195+
# ]
165196

166197
# opensearchDashboards.branding:
167198
# logo:
@@ -177,9 +208,10 @@
177208
# applicationTitle: ""
178209
# useExpandedHeader: false
179210

180-
# Set the value of this setting to true to capture region blocked warnings and errors
211+
# Set the value of this setting to true to capture region denied warnings and errors
181212
# for your map rendering services.
182-
# map.showRegionBlockedWarning: false
213+
214+
# map.showRegionDeniedWarning: false
183215

184216
# Set the value of this setting to false to suppress search usage telemetry
185217
# for reducing the load of OpenSearch cluster.

packages/opensearch-safer-lodash-set/scripts/update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ all_files=$(cd lodash && ls)
2222
modified_lodash_files=(_baseSet.js)
2323

2424
# Get fresh copies of all the files that was originally copied from lodash,
25-
# expect the ones in the whitelist
25+
# expect the ones in the allowlist
2626
for file in $all_files
2727
do
2828
if [[ ! "${modified_lodash_files[@]}" =~ "${file}" ]]

packages/osd-pm/dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86225,7 +86225,7 @@ module.exports = ProgressEmitter;
8622586225
"use strict";
8622686226

8622786227

86228-
const blacklist = [
86228+
const denylist = [
8622986229
// # All
8623086230
'^npm-debug\\.log$', // Error log for npm
8623186231
'^\\..*\\.swp$', // Swap file for vim state
@@ -86254,7 +86254,7 @@ exports.re = () => {
8625486254
throw new Error('`junk.re` was renamed to `junk.regex`');
8625586255
};
8625686256

86257-
exports.regex = new RegExp(blacklist.join('|'));
86257+
exports.regex = new RegExp(denylist.join('|'));
8625886258

8625986259
exports.is = filename => exports.regex.test(filename);
8626086260

src/core/server/http/http_server.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ describe('conditional compression', () => {
869869
expect(response.header).toHaveProperty('content-encoding', 'gzip');
870870
});
871871

872-
test('enables compression for whitelisted referer', async () => {
872+
test('enables compression for whitelisted (deprecated) or allowlisted referer', async () => {
873873
const response = await supertest(listener)
874874
.get('/')
875875
.set('accept-encoding', 'gzip')
@@ -878,7 +878,7 @@ describe('conditional compression', () => {
878878
expect(response.header).toHaveProperty('content-encoding', 'gzip');
879879
});
880880

881-
test('disables compression for non-whitelisted referer', async () => {
881+
test('disables compression for non-whitelisted (deprecated) or non-allowlisted referer', async () => {
882882
const response = await supertest(listener)
883883
.get('/')
884884
.set('accept-encoding', 'gzip')

src/core/server/opensearch/opensearch_config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ const deprecations: ConfigDeprecationProvider = ({ renameFromRoot, renameFromRoo
149149
'opensearch.requestHeadersWhitelist',
150150
'opensearch.requestHeadersAllowlist'
151151
),
152+
renameFromRootWithoutMap(
153+
'opensearch.requestHeadersWhitelistConfigured',
154+
'opensearch.requestHeadersAllowlistConfigured'
155+
),
152156
renameFromRoot('elasticsearch.customHeaders', 'opensearch.customHeaders'),
153157
renameFromRoot('elasticsearch.shardTimeout', 'opensearch.shardTimeout'),
154158
renameFromRoot('elasticsearch.requestTimeout', 'opensearch.requestTimeout'),

src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ test(`includes one object with type === 'object' and excludes one object without
179179
});
180180
});
181181

182-
test('excludes references and migrationVersion which are part of the blacklist', () => {
182+
test('excludes references and migrationVersion which are part of the denylist', () => {
183183
const mappings = {
184184
properties: {
185185
references: {

src/dev/license_checker/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
// The following list applies to packages both
3232
// used as dependencies or dev dependencies
33-
export const LICENSE_WHITELIST = [
33+
export const LICENSE_ALLOWLIST = [
3434
'Elastic-License',
3535
'0BSD',
3636
'(BSD-2-Clause OR MIT OR Apache-2.0)',
@@ -86,7 +86,7 @@ export const LICENSE_WHITELIST = [
8686

8787
// The following list only applies to licenses that
8888
// we wanna allow in packages only used as dev dependencies
89-
export const DEV_ONLY_LICENSE_WHITELIST = ['MPL-2.0'];
89+
export const DEV_ONLY_LICENSE_ALLOWLIST = ['MPL-2.0'];
9090

9191
// Globally overrides a license for a given package@version
9292
export const LICENSE_OVERRIDES = {

src/dev/license_checker/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
* under the License.
2929
*/
3030

31-
export { LICENSE_WHITELIST, DEV_ONLY_LICENSE_WHITELIST, LICENSE_OVERRIDES } from './config';
31+
export { LICENSE_ALLOWLIST, DEV_ONLY_LICENSE_ALLOWLIST, LICENSE_OVERRIDES } from './config';
3232
export { assertLicensesValid } from './valid';

src/dev/license_checker/run_check_licenses_cli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { REPO_ROOT } from '@osd/utils';
3232
import { run } from '@osd/dev-utils';
3333
import { getInstalledPackages } from '../npm';
3434

35-
import { LICENSE_WHITELIST, DEV_ONLY_LICENSE_WHITELIST, LICENSE_OVERRIDES } from './config';
35+
import { LICENSE_ALLOWLIST, DEV_ONLY_LICENSE_ALLOWLIST, LICENSE_OVERRIDES } from './config';
3636
import { assertLicensesValid } from './valid';
3737

3838
run(
@@ -47,7 +47,7 @@ run(
4747
// packages are valid
4848
assertLicensesValid({
4949
packages: packages.filter((pkg) => !pkg.isDevOnly),
50-
validLicenses: LICENSE_WHITELIST,
50+
validLicenses: LICENSE_ALLOWLIST,
5151
});
5252
log.success('All production dependency licenses are allowed');
5353

@@ -56,7 +56,7 @@ run(
5656
if (flags.dev) {
5757
assertLicensesValid({
5858
packages: packages.filter((pkg) => pkg.isDevOnly),
59-
validLicenses: LICENSE_WHITELIST.concat(DEV_ONLY_LICENSE_WHITELIST),
59+
validLicenses: LICENSE_ALLOWLIST.concat(DEV_ONLY_LICENSE_ALLOWLIST),
6060
});
6161
log.success('All development dependency licenses are allowed');
6262
}

src/legacy/server/config/schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export default () =>
154154
map: Joi.object({
155155
includeOpenSearchMapsService: Joi.boolean().default(true),
156156
proxyOpenSearchMapsServiceInMaps: Joi.boolean().default(false),
157-
showRegionBlockedWarning: Joi.boolean().default(false),
157+
showRegionDeniedWarning: Joi.boolean().default(false),
158158
tilemap: Joi.object({
159159
url: Joi.string(),
160160
options: Joi.object({

0 commit comments

Comments
 (0)