Remove context related functions in credentials

This commit is contained in:
iamqizhao
2016-01-06 18:26:33 -08:00
parent b36c5c6fd9
commit 76515fa9fd
3 changed files with 0 additions and 16 deletions

View File

@ -87,20 +87,6 @@ type AuthInfo interface {
AuthType() string AuthType() string
} }
/*
type authInfoKey struct{}
// NewContext creates a new context with authInfo attached.
func NewContext(ctx context.Context, authInfo AuthInfo) context.Context {
return context.WithValue(ctx, authInfoKey{}, authInfo)
}
// FromContext returns the authInfo in ctx if it exists.
func FromContext(ctx context.Context) (authInfo AuthInfo, ok bool) {
authInfo, ok = ctx.Value(authInfoKey{}).(AuthInfo)
return
}
*/
// TransportAuthenticator defines the common interface for all the live gRPC wire // TransportAuthenticator defines the common interface for all the live gRPC wire
// protocols and supported transport security protocols (e.g., TLS, SSL). // protocols and supported transport security protocols (e.g., TLS, SSL).
type TransportAuthenticator interface { type TransportAuthenticator interface {

View File

@ -245,7 +245,6 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea
// Attach Auth info if there is any. // Attach Auth info if there is any.
if t.authInfo != nil { if t.authInfo != nil {
pr.AuthInfo = t.authInfo pr.AuthInfo = t.authInfo
//ctx = credentials.NewContext(ctx, t.authInfo)
} }
ctx = peer.NewContext(ctx, pr) ctx = peer.NewContext(ctx, pr)
authData := make(map[string]string) authData := make(map[string]string)

View File

@ -175,7 +175,6 @@ func (t *http2Server) operateHeaders(hDec *hpackDecoder, s *Stream, frame header
// Attach Auth info if there is any. // Attach Auth info if there is any.
if t.authInfo != nil { if t.authInfo != nil {
pr.AuthInfo = t.authInfo pr.AuthInfo = t.authInfo
//s.ctx = credentials.NewContext(s.ctx, t.authInfo)
} }
s.ctx = peer.NewContext(s.ctx, pr) s.ctx = peer.NewContext(s.ctx, pr)
// Cache the current stream to the context so that the server application // Cache the current stream to the context so that the server application