Authenticate loops through all the configured Authenticators and returns if one of the authenticator succeeds.
(ctx context.Context)
| 400 | |
| 401 | // Authenticate loops through all the configured Authenticators and returns if one of the authenticator succeeds. |
| 402 | func (am *authenticationManager) authenticate(ctx context.Context) *Caller { |
| 403 | req := AuthContext{GrpcContext: ctx} |
| 404 | for _, authn := range am.Authenticators { |
| 405 | u, err := authn.Authenticate(req) |
| 406 | if u != nil && len(u.Identities) > 0 && err == nil { |
| 407 | securityLog.Debugf("Authentication successful through auth source %v", u.AuthSource) |
| 408 | return u |
| 409 | } |
| 410 | am.authFailMsgs = append(am.authFailMsgs, fmt.Sprintf("Authenticator %s: %v", authn.AuthenticatorType(), err)) |
| 411 | } |
| 412 | return nil |
| 413 | } |
| 414 | |
| 415 | func GetConnectionAddress(ctx context.Context) string { |
| 416 | peerInfo, ok := peer.FromContext(ctx) |
no test coverage detected