MCPcopy Create free account
hub / github.com/apecloud/myduckserver / base64HeaderBytes

Method base64HeaderBytes

pgserver/authentication_scram.go:346–359  ·  view source on GitHub ↗

base64HeaderBytes returns the GS2 header encoded as bytes.

()

Source from the content-addressed store, hash-verified

344}
345
346// base64HeaderBytes returns the GS2 header encoded as bytes.
347func (si SASLInitial) base64HeaderBytes() []byte {
348 bb := bytes.Buffer{}
349 switch si.Flag {
350 case SASLBindingFlag_NoClientSupport:
351 bb.WriteString("n,")
352 case SASLBindingFlag_AssumedNoServerSupport:
353 bb.WriteString("y,")
354 case SASLBindingFlag_Used:
355 bb.WriteString(fmt.Sprintf("p=%s,", si.BindName))
356 }
357 bb.WriteString(si.Authzid)
358 bb.WriteRune(',')
359 return bb.Bytes()
360}
361
362// Encode returns the struct as an AuthenticationSASLContinue message.

Callers 2

Base64HeaderMethod · 0.95
MessageBareMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected