We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6833a4 commit 0e6edfbCopy full SHA for 0e6edfb
src/main/java/org/gitlab4j/api/utils/HttpRequestUtils.java
@@ -144,4 +144,19 @@ public static String getReaderContentAsString(Reader reader) throws IOException
144
145
return (out.toString());
146
}
147
+
148
+ /**
149
+ * Masks the PRIVATE-TOKEN header value with "********".
150
+ *
151
+ * @param s a String containing HTTP request info, usually logging info
152
+ * @return a String with the PRIVATE-TOKEN header value masked with asterisks
153
+ */
154
+ public static String maskPrivateToken(String s) {
155
156
+ if (s == null || s.isEmpty()) {
157
+ return (s);
158
+ }
159
160
+ return (s.replaceAll("PRIVATE\\-TOKEN\\: [\\S]*", "PRIVATE-TOKEN: ********"));
161
162
0 commit comments