Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Okstad <pokstad@gitlab.com>2020-01-23 00:52:41 +0300
committerPaul Okstad <pokstad@gitlab.com>2020-01-23 00:52:41 +0300
commit18006a8976bc642f1d057be8526e05a3a2ed3a5c (patch)
treee505f14bd29c73eedf8404d43dad8be58d6657f3
parent0621157aa3b6a5ab7c4fa05dd228733fcbdff46d (diff)
parent06f8cb585669a2e9178903777fedac473d878ec6 (diff)
Merge branch 'jc-do-not-leak-tokens-in-replicator' into 'master'
Do not log entire node struct because it includes tokens Closes #2374 See merge request gitlab-org/gitaly!1766
-rw-r--r--changelogs/unreleased/jc-do-not-leak-tokens-in-replicator.yml5
-rw-r--r--internal/praefect/models/node.go9
2 files changed, 14 insertions, 0 deletions
diff --git a/changelogs/unreleased/jc-do-not-leak-tokens-in-replicator.yml b/changelogs/unreleased/jc-do-not-leak-tokens-in-replicator.yml
new file mode 100644
index 000000000..cc3c3c587
--- /dev/null
+++ b/changelogs/unreleased/jc-do-not-leak-tokens-in-replicator.yml
@@ -0,0 +1,5 @@
+---
+title: Do not log entire node struct because it includes tokens
+merge_request: 1766
+author:
+type: security
diff --git a/internal/praefect/models/node.go b/internal/praefect/models/node.go
index 13c738d99..7c7144165 100644
--- a/internal/praefect/models/node.go
+++ b/internal/praefect/models/node.go
@@ -1,5 +1,9 @@
package models
+import (
+ "fmt"
+)
+
// Node describes an address that serves a storage
type Node struct {
Storage string `toml:"storage"`
@@ -8,6 +12,11 @@ type Node struct {
DefaultPrimary bool `toml:"primary"`
}
+// String prints out the node attributes but hiding the token
+func (n Node) String() string {
+ return fmt.Sprintf("storage_name: %s, address: %s, primary: %v", n.Storage, n.Address, n.DefaultPrimary)
+}
+
// Repository describes a repository's relative path and its primary and list of secondaries
type Repository struct {
RelativePath string