base64HeaderBytes returns the GS2 header encoded as bytes.
()
| 344 | } |
| 345 | |
| 346 | // base64HeaderBytes returns the GS2 header encoded as bytes. |
| 347 | func (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. |
no outgoing calls
no test coverage detected