-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding call options for PerRPCCredentials #1225
Conversation
transport/http2_client.go
Outdated
@@ -181,6 +183,7 @@ func newHTTP2Client(ctx context.Context, addr TargetInfo, opts ConnectOptions) ( | |||
conn.Close() | |||
} | |||
}(conn) | |||
var isSecure bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group these two with
var(
...
)
transport/http2_client.go
Outdated
callAuthData := make(map[string]string) | ||
if callCreds := callHdr.Creds; callCreds != nil { | ||
if !t.isSecure && callCreds.RequireTransportSecurity() { | ||
return nil, streamErrorf(codes.Unauthenticated, "transport: cannot send secure credentials on an insecure channel") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/channel/connection
The word channel is misleading in golang...
transport/http2_client.go
Outdated
if !t.isSecure && callCreds.RequireTransportSecurity() { | ||
return nil, streamErrorf(codes.Unauthenticated, "transport: cannot send secure credentials on an insecure channel") | ||
} | ||
data, err := callCreds.GetRequestMetadata(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetRequestMetadata
also takes parameter uri.
transport/http2_client.go
Outdated
// Check if credentials.PerRPCCredentials were provided via call options. | ||
// Note: if these credentials are provided both via dial options and call | ||
// options, then both sets of credentials will be applied. | ||
callAuthData := make(map[string]string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make authData
a map[string][]string
and reuse authData
?
No description provided.