MCPcopy
hub / github.com/istio/istio / authenticate

Method authenticate

pkg/security/security.go:402–413  ·  view source on GitHub ↗

Authenticate loops through all the configured Authenticators and returns if one of the authenticator succeeds.

(ctx context.Context)

Source from the content-addressed store, hash-verified

400
401// Authenticate loops through all the configured Authenticators and returns if one of the authenticator succeeds.
402func (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
415func GetConnectionAddress(ctx context.Context) string {
416 peerInfo, ok := peer.FromContext(ctx)

Callers 1

AuthenticateFunction · 0.95

Calls 3

DebugfMethod · 0.80
AuthenticateMethod · 0.65
AuthenticatorTypeMethod · 0.65

Tested by

no test coverage detected