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

Make AuthContext constructor public #18500

Merged

Conversation

jtattermusch
Copy link
Contributor

to enable creating instances of AuthContext in grpc-dotnet.

Fixes grpc/grpc-dotnet#76.

@jtattermusch jtattermusch added lang/C# release notes: yes Indicates if PR needs to be in release notes labels Mar 25, 2019
@jtattermusch
Copy link
Contributor Author

CC @JamesNK @JunTaoLuo

@jtattermusch
Copy link
Contributor Author

jtattermusch commented Mar 25, 2019

AuthProperty still has a private constructor - we'll need to look into that.

@JamesNK
Copy link
Member

JamesNK commented Mar 26, 2019

re: private constructor

The constructor is private but there is a static Create method:

public static AuthProperty Create(string name, byte[] valueBytes)
{
GrpcPreconditions.CheckNotNull(valueBytes);
var valueCopy = new byte[valueBytes.Length];
Buffer.BlockCopy(valueBytes, 0, valueCopy, 0, valueBytes.Length);
return new AuthProperty(name, valueCopy);
}

@jtattermusch
Copy link
Contributor Author

re: private constructor

The constructor is private but there is a static Create method:

grpc/src/csharp/Grpc.Core.Api/AuthProperty.cs

Lines 85 to 91 in 5268858

public static AuthProperty Create(string name, byte[] valueBytes)
{
GrpcPreconditions.CheckNotNull(valueBytes);
var valueCopy = new byte[valueBytes.Length];
Buffer.BlockCopy(valueBytes, 0, valueCopy, 0, valueBytes.Length);
return new AuthProperty(name, valueCopy);
}

Ah, somehow I completely missed that. Thanks for pointing that out.

@jtattermusch
Copy link
Contributor Author

Known failures: #18477

@jtattermusch jtattermusch merged commit a1fac43 into grpc:master Mar 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang/C# release notes: yes Indicates if PR needs to be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Grpc.Core.Api with way to create AuthContext
4 participants