Skip to content
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
nxtcoder17 merged 4 commits into
mainfrom
fix/byok-helmcharts
May 24, 2024
Merged

Feat ExternalApp, fix message office GRPC Authentication#325
nxtcoder17 merged 4 commits into
mainfrom
fix/byok-helmcharts

Conversation

@nxtcoder17
Copy link
Copy Markdown
Member

No description provided.

- 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
@nxtcoder17 nxtcoder17 self-assigned this May 24, 2024
@nxtcoder17 nxtcoder17 requested a review from karthik1729 as a code owner May 24, 2024 12:03
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

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

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment thread apps/tenant-agent/main.go
Comment on lines +66 to +68
func NewAuthorizedGrpcContext(ctx context.Context, accessToken string) context.Context {
return metadata.NewOutgoingContext(ctx, metadata.Pairs("authorization", accessToken))
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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"))
}

@nxtcoder17 nxtcoder17 force-pushed the fix/byok-helmcharts branch from 1bdbdb7 to 88cefba Compare May 24, 2024 13:14
@nxtcoder17 nxtcoder17 force-pushed the fix/byok-helmcharts branch from 88cefba to 27f8e1b Compare May 24, 2024 13:22
@nxtcoder17 nxtcoder17 merged commit 11466a6 into main May 24, 2024
@nxtcoder17 nxtcoder17 deleted the fix/byok-helmcharts branch May 24, 2024 13:26
abdheshnayak pushed a commit that referenced this pull request Nov 5, 2024
Feat ExternalApp, fix message office GRPC Authentication, and types updates
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant