MCPcopy Create free account
hub / github.com/dolthub/doltgresql / base64HeaderBytes

Method base64HeaderBytes

server/authentication_scram.go:327–340  ·  view source on GitHub ↗

base64HeaderBytes returns the GS2 header encoded as bytes.

()

Source from the content-addressed store, hash-verified

325
326// base64HeaderBytes returns the GS2 header encoded as bytes.
327func (si SASLInitial) base64HeaderBytes() []byte {
328 bb := bytes.Buffer{}
329 switch si.Flag {
330 case SASLBindingFlag_NoClientSupport:
331 bb.WriteString("n,")
332 case SASLBindingFlag_AssumedNoServerSupport:
333 bb.WriteString("y,")
334 case SASLBindingFlag_Used:
335 bb.WriteString(fmt.Sprintf("p=%s,", si.BindName))
336 }
337 bb.WriteString(si.Authzid)
338 bb.WriteRune(',')
339 return bb.Bytes()
340}
341
342// Encode returns the struct as an AuthenticationSASLContinue message.
343func (sc SASLContinue) Encode() *pgproto3.AuthenticationSASLContinue {

Callers 2

Base64HeaderMethod · 0.95
MessageBareMethod · 0.95

Calls 2

WriteStringMethod · 0.80
BytesMethod · 0.80

Tested by

no test coverage detected