Path: blob/main/components/gitpod-protocol/src/util/scrubbing-config.ts
2500 views
/**1* Copyright (c) 2023 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56// redactedFields are the names of fields we'll redact when matched7export const redactedFields = ["auth_", "password", "token", "key", "jwt", "secret", "email"];8// hashedFields are the names of fields we'll hash if matched9export const hashedFields = ["contextURL", "workspaceID", "username"];1011// hashedValues are regular expressions which when matched cause the entire value to be hashed12export const hashedValues = new Map<string, RegExp>([["url", /https?:\/\/[^\s]+\.git\b/g]]);13// redactedValues are regular expressions which when matched cause the entire value to be redacted14export const redactedValues = new Map<string, RegExp>([15// https://html.spec.whatwg.org/multipage/input.html#email-state-(type=email)16[17"email",18new RegExp(19/[a-zA-Z0-9.!#$%&'*+/=?^_\`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/,20"g",21),22],23]);242526