tidb sensitive 源码

2022-09-19 浏览 (637)

tidb sensitive 代码

文件路径:/br/pkg/utils/sensitive.go

/ Copyright 2022 PingCAP, Inc. Licensed under Apache-2.0.

package utils

import (
	"regexp"
)

var (
	passwordPatterns = `(password[\s]*=[\s]*(\\")?)(.*?)((\\")?\\n)`

	passwordRegexp *regexp.Regexp
)

func init() {
	passwordRegexp = regexp.MustCompile(passwordPatterns)
}

/ HideSensitive replace password with ******.
func HideSensitive(input string) string {
	output := passwordRegexp.ReplaceAllString(input, "$1******$4")
	return output
}

相关信息

tidb 源码目录

相关文章

tidb backoff 源码

tidb db 源码

tidb dyn_pprof_other 源码

tidb dyn_pprof_unix 源码

tidb env 源码

tidb json 源码

tidb key 源码

tidb math 源码

tidb misc 源码

tidb permission 源码

  • 所属分类: 大数据
  • 本文标签: golang 大数据
  • 版权声明: 本文链接 https://seaxiang.com/blog/1145807f242c467fa5e7d5cfbfc9ac1a