This repository was archived by the owner on Jun 11, 2025. It is now read-only.
Feat ExternalApp, fix message office GRPC Authentication#325
Merged
Conversation
- cluster token is now sufficient to identify the cluster, and for token exchange - all of GRPC authentication is now controlled using grpc metadata headers, instead of passing AccessToken in protobuf messages
- all GRPC authentication is now done via GRPC metadata header `authorization` - less verbose logging for vector proxy messages - clusterName, and accountName to downstream message queue, will be provided by message office only, instead of trusting the incoming message
There was a problem hiding this comment.
Hey @nxtcoder17 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
Comment on lines
+66
to
+68
| func NewAuthorizedGrpcContext(ctx context.Context, accessToken string) context.Context { | ||
| return metadata.NewOutgoingContext(ctx, metadata.Pairs("authorization", accessToken)) | ||
| } |
There was a problem hiding this comment.
suggestion: Consider adding a comment for the new function.
Adding a comment for the new NewAuthorizedGrpcContext function would improve code readability and maintainability.
Suggested change
| func NewAuthorizedGrpcContext(ctx context.Context, accessToken string) context.Context { | |
| return metadata.NewOutgoingContext(ctx, metadata.Pairs("authorization", accessToken)) | |
| } | |
| func NewAuthorizedGrpcContext(ctx context.Context, accessToken string) context.Context { | |
| // NewAuthorizedGrpcContext creates a new context with the provided access token | |
| // added to the outgoing metadata. This is useful for making authorized gRPC calls. | |
| return metadata.NewOutgoingContext(ctx, metadata.Pairs("authorization", accessToken)) | |
| } |
|
|
||
| // MatchType is the resolver for the matchType field. | ||
| func (r *matchFilterResolver) MatchType(ctx context.Context, obj *repos.MatchFilter) (string, error) { | ||
| func (r *matchFilterResolver) MatchType(ctx context.Context, obj *repos.MatchFilter) (model.GithubComKloudliteAPIPkgReposMatchType, error) { |
There was a problem hiding this comment.
suggestion: Consider renaming the return type for readability.
The return type model.GithubComKloudliteAPIPkgReposMatchType is quite verbose. Consider using a type alias or a more concise name if possible to improve readability.
Suggested change
| func (r *matchFilterResolver) MatchType(ctx context.Context, obj *repos.MatchFilter) (model.GithubComKloudliteAPIPkgReposMatchType, error) { | |
| type MatchTypeAlias model.GithubComKloudliteAPIPkgReposMatchType | |
| func (r *matchFilterResolver) MatchType(ctx context.Context, obj *repos.MatchFilter) (MatchTypeAlias, error) { | |
| panic(fmt.Errorf("not implemented: MatchType - matchType")) | |
| } |
1bdbdb7 to
88cefba
Compare
88cefba to
27f8e1b
Compare
abdheshnayak
pushed a commit
that referenced
this pull request
Nov 5, 2024
Feat ExternalApp, fix message office GRPC Authentication, and types updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.