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

gRPC client auth added #1084

Merged
merged 4 commits into from
Jun 13, 2023
Merged

gRPC client auth added #1084

merged 4 commits into from
Jun 13, 2023

Conversation

huseyinbabal
Copy link
Contributor

@huseyinbabal huseyinbabal commented Jun 8, 2023

Description

Changes proposed in this pull request:

  • Auth context is added to gRPC client connections

Testing

Better to test this together with https://github.com/kubeshop/botkube-cloud/pull/431

Related issue(s)

@huseyinbabal huseyinbabal marked this pull request as ready for review June 13, 2023 08:11
@huseyinbabal huseyinbabal requested review from a team and PrasadG193 as code owners June 13, 2023 08:11
@pkosiec pkosiec requested review from pkosiec and removed request for josefkarasek June 13, 2023 08:17
@pkosiec
Copy link
Member

pkosiec commented Jun 13, 2023

@josefkarasek I've unassigned you from the review as I'll test both server + client changes E2E 👍

Copy link
Member

@pkosiec pkosiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@@ -92,7 +98,7 @@ func NewCloudSlack(log logrus.FieldLogger,

func (b *CloudSlack) Start(ctx context.Context) error {
creds := grpc.WithTransportCredentials(insecure.NewCredentials())
opts := []grpc.DialOption{creds}
opts := []grpc.DialOption{creds, grpc.WithStreamInterceptor(b.addCredentials())}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As suggested in the other PR, can you also include credentials in unary operations? Thanks!

Suggested change
opts := []grpc.DialOption{creds, grpc.WithStreamInterceptor(b.addCredentials())}
opts := []grpc.DialOption{creds,
grpc.UnaryInterceptor(grpc_auth.UnaryServerInterceptor(b.addCredentials())),
grpc.WithStreamInterceptor(b.addCredentials()),
}

return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
remoteCfg, ok := remote.GetConfig()
if !ok {
return nil, errors.New("while getting remote configuration")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, errors.New("while getting remote configuration")
return nil, errors.New("empty remote configuration")

Copy link
Member

@pkosiec pkosiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@huseyinbabal
Copy link
Contributor Author

slack e2e failed due to rate limit error, just re-ran the failed test

@huseyinbabal huseyinbabal merged commit 1301556 into kubeshop:main Jun 13, 2023
@huseyinbabal huseyinbabal deleted the grpc-auth branch June 13, 2023 13:03
@josefkarasek josefkarasek added the enhancement New feature or request label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants