Skip to content
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

Merged
merged 4 commits into from May 11, 2017

Conversation

MakMukhi
Copy link
Contributor

@MakMukhi MakMukhi commented May 9, 2017

No description provided.

@MakMukhi MakMukhi requested review from menghanl and dfawley May 9, 2017 00:32
@menghanl menghanl self-assigned this May 9, 2017
@@ -181,6 +183,7 @@ func newHTTP2Client(ctx context.Context, addr TargetInfo, opts ConnectOptions) (
conn.Close()
}
}(conn)
var isSecure bool
Copy link
Contributor

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(
  ...
)

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")
Copy link
Contributor

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...

if !t.isSecure && callCreds.RequireTransportSecurity() {
return nil, streamErrorf(codes.Unauthenticated, "transport: cannot send secure credentials on an insecure channel")
}
data, err := callCreds.GetRequestMetadata(ctx)
Copy link
Contributor

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.

// 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)
Copy link
Contributor

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?

@MakMukhi MakMukhi merged commit 88a73d3 into grpc:master May 11, 2017
@menghanl menghanl added 1.4 Type: Feature New features or improvements in behavior labels Jun 7, 2017
@MakMukhi MakMukhi changed the title Adding dial options for PerRPCCredentials Adding call options for PerRPCCredentials Jun 24, 2017
@MakMukhi MakMukhi deleted the rpc_creds_dial_option branch May 4, 2018 02:09
@lock lock bot locked as resolved and limited conversation to collaborators Oct 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants