MCPcopy Create free account
hub / github.com/bytebase/bytebase / redactLoginRequest

Function redactLoginRequest

backend/api/v1/audit.go:556–584  ·  view source on GitHub ↗
(r *v1pb.LoginRequest)

Source from the content-addressed store, hash-verified

554}
555
556func redactLoginRequest(r *v1pb.LoginRequest) *v1pb.LoginRequest {
557 if r == nil {
558 return nil
559 }
560
561 // Clone to avoid mutating original
562 r = proto.CloneOf(r)
563
564 // Mask sensitive fields.
565 if r.Password != "" {
566 r.Password = maskedString
567 }
568 if r.OtpCode != nil {
569 r.OtpCode = &maskedString
570 }
571 if r.RecoveryCode != nil {
572 r.RecoveryCode = &maskedString
573 }
574 if r.MfaTempToken != nil {
575 r.MfaTempToken = &maskedString
576 }
577 if r.EmailCode != nil {
578 r.EmailCode = &maskedString
579 }
580 if r.IdpContext != nil {
581 r.IdpContext = nil
582 }
583 return r
584}
585
586func redactSignupRequest(r *v1pb.SignupRequest) *v1pb.SignupRequest {
587 if r == nil {

Callers 1

getRequestStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected