GitLabgitlab-org

cli

main
ply9 git calls330 ms103 KiB7 cachedprotocol v2
469 lines15 KiBRaw
1// Package redact replaces the secrets in text and JSON that glab sends to GitLab.
2package redact
4import (
5 "bytes"
6 "encoding/json"
7 "regexp"
8 "strconv"
9 "strings"
10 "unicode"
12 "gitlab.com/gitlab-org/cli/internal/dbg"
15// secretPattern finds one kind of secret. When re has a capturing group, only
16// that group is replaced, so the label around it, such as a header name, stays
17// readable.
18type secretPattern struct {
19 kind string
20 // hints are lowercase strings that every match contains. A text holding
21 // none of them is skipped without running re, which is much slower.
22 hints []string
23 re *regexp.Regexp
24 // tokenLike, when set, keeps a match that reads like code or prose rather
25 // than a credential.
26 tokenLike bool
27 // mixedCase, with tokenLike, also keeps a match without both upper and
28 // lower case letters, such as a kebab-case name.
29 mixedCase bool
30 // digit, when set, leaves a value without a digit as it is, so a type name
31 // such as ApiKeyType isn't redacted.
32 digit bool
33 // named means re matches a name and the separator after it, and the value
34 // that follows is read by assignedValue. The value is only replaced when
35 // the name is a credentialKey.
36 named bool
37 // extend, when set, returns where a match ending at end really ends.
38 extend func(s string, end int) int
41const (
42 keyLineBreak = `[ \t]*(?:\r?\n|\\r\\n|\\n|\\\\r\\\\n|\\\\n)`
43 keyHeaderLine = `(?:Proc-Type|DEK-Info|Version|Comment|Hash|Charset):(?:[^\r\n\\]|\\[^rn\\])*`
44 keyBase64 = `(?:[A-Za-z0-9+/=]|\\/)`
47// keyLine matches the next line of a private key at the start of a text.
48var keyLine = regexp.MustCompile(`\A(?:` + keyLineBreak + `)+[ \t]*(?:` + keyHeaderLine + `|(` + keyBase64 + `+))`)
50// extendKey returns where the private key that a match ending at end starts
51// ends. It takes whole lines that look like a key, so prose after the key ends
52// it. A base64 line of 16 or more characters can also end where the text was
53// cut off, such as at "…" or " [truncated]". The key then ends there, because
54// keyLine only matches after a line break. A shorter one must have at least
55// 4 characters and end at a line break, a quote or the end of the text, so a
56// word such as EOF on the next line is kept.
57func extendKey(s string, end int) int {
58 for {
59 m := keyLine.FindStringSubmatchIndex(s[end:])
60 if m == nil {
61 return end
62 }
63 if n := m[3] - m[2]; m[2] >= 0 && n < 16 && (n < 4 || !endsKeyLine(s[end+m[1]:])) {
64 return end
65 }
66 end += m[1]
67 }
70func endsKeyLine(rest string) bool {
71 rest = strings.TrimLeft(rest, " \t")
72 return rest == "" || strings.ContainsRune("\r\n\\\"'`", rune(rest[0]))
75// secretPatterns are formats that are secrets wherever they appear. They are
76// best effort: a secret in a format not listed here is sent as it is.
77// Values that start with $ are left alone, because they name a variable rather
78// than hold its value, and so are placeholders and ones an earlier pattern
79// already replaced.
80var secretPatterns = []secretPattern{
81 {
82 kind: "private_key",
83 hints: []string{"private key"},
84 re: regexp.MustCompile(`(?s)-----BEGIN[A-Z0-9 ]*PRIVATE KEY(?: BLOCK)?-----.*?-----END[A-Z0-9 ]*PRIVATE KEY(?: BLOCK)?-----`),
85 },
86 // A key cut off before its END line. It starts only when the line after
87 // the BEGIN line looks like a key, a PEM or PGP header or base64, so a
88 // BEGIN line quoted in code or prose is left alone.
89 {
90 kind: "private_key",
91 hints: []string{"private key"},
92 re: regexp.MustCompile(`-----BEGIN[A-Z0-9 ]*PRIVATE KEY(?: BLOCK)?-----` +
93 `(?:` + keyLineBreak + `)+[ \t]*(?:` + keyHeaderLine + `|` + keyBase64 + `{16,})`),
94 extend: extendKey,
95 },
96 {
97 kind: "gitlab_token",
98 hints: []string{"glpat-", "gloas-", "gldt-", "glrt-", "glrtr-", "glcbt-", "glptt-", "glft-", "glimt-", "glagent-", "glsoat-", "glffct-", "glwt-"},
99 re: regexp.MustCompile(`gl(?:pat|oas|dt|rt|rtr|cbt|ptt|ft|imt|agent|soat|ffct|wt)-[0-9A-Za-z_\-.]{20,}`),
100 },
101 {
102 kind: "github_token",
103 hints: []string{"ghp_", "gho_", "ghu_", "ghs_", "ghr_", "github_pat_"},
104 re: regexp.MustCompile(`\b(?:gh[pousr]_[0-9A-Za-z]{36,}|github_pat_[0-9A-Za-z_]{40,})`),
105 },
106 {
107 kind: "aws_access_key",
108 hints: []string{"akia", "asia"},
109 re: regexp.MustCompile(`\b(?:AKIA|ASIA)[0-9A-Z]{16}\b`),
110 },
111 {
112 kind: "aws_secret_key",
113 hints: []string{"aws_secret_access_key"},
114 re: regexp.MustCompile(`(?i)aws_secret_access_key["']?\s*[:=]\s*["']?([0-9A-Za-z/+=]{40})`),
115 },
116 {
117 kind: "google_api_key",
118 hints: []string{"aiza"},
119 re: regexp.MustCompile(`\bAIza[0-9A-Za-z_\-]{35}`),
120 },
121 {
122 kind: "slack_token",
123 hints: []string{"xox", "xapp-", "hooks.slack.com"},
124 re: regexp.MustCompile(`\b(?:xox[abposre]-[0-9A-Za-z\-]{10,}|xapp-[0-9A-Za-z\-]{10,}|https://hooks\.slack\.com/services/[0-9A-Za-z/]+)`),
125 },
126 {
127 kind: "stripe_key",
128 hints: []string{"_live_", "_test_"},
129 re: regexp.MustCompile(`\b[rs]k_(?:live|test)_[0-9A-Za-z]{16,}`),
130 },
131 {
132 kind: "ai_api_key",
133 hints: []string{"sk-"},
134 re: regexp.MustCompile(`\bsk-[0-9A-Za-z_\-]{20,}`),
135 tokenLike: true,
136 mixedCase: true,
137 },
138 {
139 kind: "npm_token",
140 hints: []string{"npm_"},
141 re: regexp.MustCompile(`\bnpm_[0-9A-Za-z]{36}\b`),
142 },
143 {
144 kind: "pypi_token",
145 hints: []string{"pypi-"},
146 re: regexp.MustCompile(`\bpypi-[0-9A-Za-z_\-]{50,}`),
147 },
148 {
149 kind: "jwt",
150 hints: []string{"eyj"},
151 re: regexp.MustCompile(`\beyJ[0-9A-Za-z_\-]{10,}\.eyJ[0-9A-Za-z_\-]{10,}\.[0-9A-Za-z_\-]{10,}`),
152 },
153 {
154 kind: "http_credential",
155 hints: []string{"authorization"},
156 re: regexp.MustCompile(`(?i)\b(?:proxy-)?authorization["']?\s*:\s*["']?(?:bearer|basic|token)\s+([^\s"'$<{\[][^\s"']{7,})`),
157 tokenLike: true,
158 },
159 {
160 kind: "http_credential",
161 hints: []string{"private-token", "private_token", "job-token", "job_token", "deploy-token", "deploy_token", "x-api-key", "x-gitlab-token", "access_token"},
162 re: regexp.MustCompile(`(?i)\b(?:private[-_]token|job[-_]token|deploy[-_]token|x-api-key|x-gitlab-token|access_token)["']?\s*[:=]\s*["']?([^\s"'$<{\[&][^\s"'&]{7,})`),
163 tokenLike: true,
164 },
165 {
166 kind: "url_password",
167 hints: []string{"://"},
168 re: regexp.MustCompile(`(?i)\b[a-z][a-z0-9+.\-]*://[^\s/:@"']*:([^\s/@"'$<{\[][^\s/"']*)@`),
169 },
170 // A value assigned to a credential-like name in text, such as
171 // MY_API_TOKEN=... in a command or password: ... in a YAML file. The value
172 // must have a digit, so Optional[str] or getToken(ctx) aren't taken for
173 // one, though a call whose name has a digit, such as sha256(x), is.
174 {
175 kind: "credential",
176 hints: []string{"token", "secret", "passw", "passphrase", "pwd", "key", "authorization"},
177 re: regexp.MustCompile(`\b([A-Za-z_][A-Za-z0-9_\-]*)(?:\\?["'])?[ \t]*(?::=|[:=])[ \t]*`),
178 digit: true,
179 named: true,
180 },
183// sensitiveKey matches names whose value is a credential, such as headers or
184// environment variables in tool arguments, or variables assigned in text,
185// including prefixed ones such as OPENAI_API_KEY, STRIPE_SECRET_KEY,
186// PGPASSWORD and MYSQL_PWD. Pagination tokens are cursors, not credentials,
187// so they are kept.
188var (
189 sensitiveKey = regexp.MustCompile(`(?i)^(?:(?:proxy[-_])?authorization|token|secret|passphrase|.*(?:password|passwd)|(?:.*[-_])?(?:api[-_]?key|secret[-_]key|private[-_]key|pwd)|.*[-_]secret|.*[-_]secret[-_]access[-_]key|.*[-_]token)$`)
190 paginationKey = regexp.MustCompile(`(?i)^(?:next[-_])?page[-_]token$`)
191 // camelCaseWord finds where a word starts inside a camelCase name.
192 camelCaseWord = regexp.MustCompile(`([a-z0-9])([A-Z])`)
193 // acronymWord finds where a word starts after a leading acronym, as in APIToken.
194 acronymWord = regexp.MustCompile(`([A-Z]+)([A-Z][a-z])`)
197// workingDirectory reports whether name is PWD holding a path, the shell's
198// working directory, rather than a password as in an ODBC connection string.
199func workingDirectory(name, value string) bool {
200 return strings.EqualFold(name, "pwd") && (strings.HasPrefix(value, "/") || strings.HasPrefix(value, "~"))
203// nameWords returns name with its camelCase words separated, so openaiApiKey is
204// matched as openai_Api_Key and OPENAIApiKey as OPENAI_Api_Key.
205func nameWords(name string) string {
206 return camelCaseWord.ReplaceAllString(acronymWord.ReplaceAllString(name, "${1}_${2}"), "${1}_${2}")
209// credentialKey matches the name as written too, because splitting can break a word
210// that it already matched, such as passPhrase.
211func credentialKey(name string) bool {
212 words := nameWords(name)
213 return (sensitiveKey.MatchString(name) || sensitiveKey.MatchString(words)) && !paginationKey.MatchString(words)
216// Marker returns the text that replaces a secret of the given kind.
217func Marker(kind string) string {
218 return "[REDACTED:" + kind + "]"
221// Secrets returns s with the secrets that secretPatterns find replaced
222// by a marker that names their kind.
223func Secrets(s string) string {
224 lower := strings.ToLower(s)
225 for _, p := range secretPatterns {
226 if !containsAny(lower, p.hints) {
227 continue
228 }
229 s = replaceSecret(s, p)
230 lower = strings.ToLower(s)
231 }
232 return s
235func containsAny(s string, subs []string) bool {
236 for _, sub := range subs {
237 if strings.Contains(s, sub) {
238 return true
239 }
240 }
241 return false
244// replaceSecret replaces each match of p in s, or only its first capturing
245// group when it has one, or its second when p is named.
246func replaceSecret(s string, p secretPattern) string {
247 matches := secretMatches(s, p)
248 if matches == nil {
249 return s
250 }
251 var b strings.Builder
252 last := 0
253 for _, m := range matches {
254 start, end := m[0], m[1]
255 switch {
256 case p.named:
257 start, end = m[4], m[5]
258 case p.re.NumSubexp() > 0:
259 start, end = m[2], m[3]
260 }
261 // A match inside a secret that was already replaced is part of it.
262 if start < last {
263 continue
264 }
265 if p.extend != nil {
266 end = p.extend(s, end)
267 }
268 if start < 0 || (p.tokenLike && !looksLikeToken(s[start:end], p.mixedCase)) {
269 continue
270 }
271 if p.digit && !strings.ContainsAny(s[start:end], "0123456789") {
272 continue
273 }
274 b.WriteString(s[last:start])
275 b.WriteString(Marker(p.kind))
276 last = end
277 }
278 b.WriteString(s[last:])
279 return b.String()
282// secretMatches returns the matches of p in s. A named pattern's matches are
283// a name, then the value, as a group each. re only matches names, so a name
284// inside another value, as in args: --token=..., is still found.
285func secretMatches(s string, p secretPattern) [][]int {
286 if !p.named {
287 return p.re.FindAllStringSubmatchIndex(s, -1)
288 }
289 var matches [][]int
290 for _, m := range p.re.FindAllStringSubmatchIndex(s, -1) {
291 name := m[2]
292 // In escaped text such as user=bob\npassword=..., the name starts
293 // after the letter of the escape.
294 if name > 0 && s[name-1] == '\\' && strings.IndexByte("nrt", s[name]) >= 0 &&
295 (!credentialKey(s[name:m[3]]) || paginationKey.MatchString(nameWords(s[name+1:m[3]]))) {
296 name++
297 }
298 if !credentialKey(s[name:m[3]]) {
299 continue
300 }
301 if start, end, ok := assignedValue(s, m[1]); ok && !workingDirectory(s[name:m[3]], s[start:end]) {
302 matches = append(matches, []int{name, end, name, m[3], start, end})
303 }
304 }
305 return matches
308// maxCredentialLength bounds the value read after a credential-like name, so
309// long text without spaces can't make redaction slow. Only the start of a
310// longer value is replaced.
311const maxCredentialLength = 256
313// assignedValue returns where the value at i in s starts and ends. A quoted
314// value, also one whose quotes are escaped as in \"...\", runs to its closing
315// quote, and any other value to a space, quote, backslash, bracket or
316// separator. It reports false when the value starts with $, <, {, [, &, ( or
317// =, or has fewer than 8 characters.
318func assignedValue(s string, i int) (int, int, bool) {
319 var quote byte
320 escaped := false
321 switch {
322 case i < len(s) && (s[i] == '"' || s[i] == '\''):
323 quote = s[i]
324 i++
325 case i+1 < len(s) && s[i] == '\\' && (s[i+1] == '"' || s[i+1] == '\''):
326 quote, escaped = s[i+1], true
327 i += 2
328 }
329 start := i
330 if i >= len(s) || strings.IndexByte(" \t\r\n\\\"'$<{[&(=", s[i]) >= 0 {
331 return 0, 0, false
332 }
333 if quote != 0 {
334 return quotedValue(s, start, quote, escaped)
335 }
336 for i < len(s) && strings.IndexByte(" \t\r\n\\\"'&,;|()[]{}<>", s[i]) < 0 {
337 if i-start == maxCredentialLength {
338 return start, i, true
339 }
340 i++
341 }
342 if i-start < 8 {
343 return 0, 0, false
344 }
345 return start, i, true
348// quotedValue returns where the value that starts at start in s ends, at its
349// closing quote, stepping over escaped characters. A value cut off by the end
350// of s or a line break ends there.
351func quotedValue(s string, start int, quote byte, escaped bool) (int, int, bool) {
352 i := start
353 for i < len(s) && s[i] != '\r' && s[i] != '\n' && i-start < maxCredentialLength {
354 if s[i] == quote && !escaped {
355 break
356 }
357 if s[i] == '\\' && i+1 < len(s) {
358 if s[i+1] == '\r' || s[i+1] == '\n' || (escaped && s[i+1] == quote) {
359 break
360 }
361 i += 2
362 continue
363 }
364 i++
365 }
366 if i-start < 8 {
367 return 0, 0, false
368 }
369 return start, min(i, len(s)), true
372// looksLikeToken reports whether s mixes cases or has a digit, as generated
373// credentials do, and isn't a call or member access, as code is. It tells
374// "Bearer authentication", "process.env.TOKEN" and "sk-learn-pipeline-v2"
375// apart from real values. With mixedCase, a digit alone is not enough.
376func looksLikeToken(s string, mixedCase bool) bool {
377 if strings.Contains(s, "(") || (strings.Contains(s, ".") && !strings.ContainsAny(s, "0123456789")) {
378 return false
379 }
380 var upper, lower, digit bool
381 for _, r := range s {
382 switch {
383 case unicode.IsUpper(r):
384 upper = true
385 case unicode.IsLower(r):
386 lower = true
387 case unicode.IsDigit(r):
388 digit = true
389 }
390 }
391 if mixedCase {
392 return upper && lower
393 }
394 return digit || (upper && lower)
397// JSON returns input with the secrets in its keys and string values
398// replaced, or input unchanged when it holds none, so key order and formatting
399// are kept.
400func JSON(input json.RawMessage) json.RawMessage {
401 if len(input) == 0 {
402 return input
403 }
404 dec := json.NewDecoder(bytes.NewReader(input))
405 dec.UseNumber()
406 var v any
407 if dec.Decode(&v) != nil {
408 // Not JSON, so it can't be walked. It is redacted as text instead,
409 // which may leave it invalid; it is omitted later then.
410 return json.RawMessage(Secrets(string(input)))
411 }
412 redacted, changed := redactValue(v, "")
413 // A secret the walk didn't see, such as one in a duplicate key that
414 // decoding dropped, still means input must not be sent as it is.
415 if !changed && Secrets(string(input)) == string(input) {
416 return input
417 }
418 encoded, err := json.Marshal(redacted) //nolint:forbidigo // encoding, not output
419 if err != nil {
420 dbg.Debugf("could not encode redacted tool arguments: %v", err)
421 return json.RawMessage(Secrets(string(input)))
422 }
423 return encoded
426func redactValue(v any, key string) (any, bool) {
427 switch v := v.(type) {
428 case string:
429 if v != "" && !strings.HasPrefix(v, "$") && credentialKey(key) && !workingDirectory(key, v) {
430 return Marker("credential"), true
431 }
432 r := Secrets(v)
433 return r, r != v
434 case []any:
435 changed := false
436 for i, e := range v {
437 var c bool
438 v[i], c = redactValue(e, key)
439 changed = changed || c
440 }
441 return v, changed
442 case map[string]any:
443 out := make(map[string]any, len(v))
444 changed := false
445 for k, e := range v {
446 rk := Secrets(k)
447 if rk != k {
448 rk = unusedKey(out, rk)
449 }
450 re, c := redactValue(e, k)
451 out[rk] = re
452 changed = changed || c || rk != k
453 }
454 return out, changed
455 }
456 return v, false
459// unusedKey returns key, numbered when out already has it, so that keys that
460// redact to the same marker don't overwrite each other.
461func unusedKey(out map[string]any, key string) string {
462 unused := key
463 for n := 2; ; n++ {
464 if _, ok := out[unused]; !ok {
465 return unused
466 }
467 unused = key + "#" + strconv.Itoa(n)
468 }
Diagnostics9 git calls · 330 ms
CallStatusSizeTime0330 ms
discover200185 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=1
git.response.bytes=185
git.server.agent=git/2.56.g1891de4-Linux
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch server-option object-format
git.server.fetch=shallow wait-for-done filter
git.protocol.version=2
git.pkt.frames=9
git.pkt.data=7
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=185
git.pkt.payload.max=35
ls-refs20058 KiB · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=59849
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=731
git.pkt.data=730
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=59849
git.pkt.payload.max=143
git.ls_refs.count=730
git.ls_refs.head=refs/heads/main
fetchtree:0 · deepen 1020032 KiB · hit1 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=32926
git.response.cache=HIT
git.response.duration_ms=1
git.fetch.filter=tree:0
git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=22
git.pkt.data=20
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=32926
git.pkt.payload.max=32046
git.sideband.band1.bytes=32046
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=80
git.pack.bytes=32046
git.pack.ofs_delta=36
git.pack.ref_delta=0
git.pack.chain.max=2
git.pack.trailer=cb0bad5d7ffc514895d8b21c4dd470327f90bc91
git.pack.full=44
Open pack map
fetchcombine:blob:none+tree:2 · deepen 12004.2 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=4273
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=combine:blob:none+tree:2
git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9
git.fetch.haves.count=0
git.fetch.deepen=1
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=4273
git.pkt.payload.max=4173
git.sideband.band1.bytes=4173
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=11
git.pack.bytes=4173
git.fetch.wide.objects=11
git.fetch.wide.extra_bytes=3930
git.fetch.wide.blobs=0
fetchtree:02001.8 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=1857
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=dce174ff8c632a19d17eea99c8a9b7c37fb2b592
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1857
git.pkt.payload.max=1830
git.sideband.band1.bytes=1830
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=1830
git.pack.trailer=fb03183b7909876778f740d196d7516811003517
Open pack map
fetchtree:0200261 B · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=261
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=3bb9946301aa8c0dc8d202b83bc9f84bf0400f6d
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=261
git.pkt.payload.max=234
git.sideband.band1.bytes=234
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=234
git.pack.trailer=e0a52f164f79506da6b0dcc275ed62911f5383bf
Open pack map
fetchtree:0200273 B · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=273
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=5fa160737ad30857ff606d64de1d596bb211ac3d
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=273
git.pkt.payload.max=246
git.sideband.band1.bytes=246
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=246
git.pack.trailer=06dd39b7545811625e04a7645a0a64c9a62c99c6
Open pack map
fetchtree:0200136 B · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=314
git.response.bytes=136
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=c373651eab5dc06c5c2898f79c90b0403869e983
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=136
git.pkt.payload.max=109
git.sideband.band1.bytes=109
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=109
git.pack.trailer=998c9f92a1a0beae5b1a66f5eb1c0f6feee4e4b4
Open pack map
fetch2005.8 KiB314 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=5899
git.response.cache=MISS
git.response.duration_ms=314
git.fetch.wants=0a974c744fa35a826d9fb2031776553233471e2a
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=5899
git.pkt.payload.max=5872
git.sideband.band1.bytes=5872
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://gitlab.com/gitlab-org/cli
Ref
refs/heads/main
Commit
0dd7574dce9e385c5c30540e6c15657adc6bdce9
cf-ray
a5e2ff34ad18f3c9
Request
ca556d67…
Protocol
v2 · sha1
Agent
git/2.56.g1891de4-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format