Skip to content

Add Access Graph protobuf file#34373

Merged
jakule merged 7 commits intomasterfrom
jakule/tag-proto
Nov 10, 2023
Merged

Add Access Graph protobuf file#34373
jakule merged 7 commits intomasterfrom
jakule/tag-proto

Conversation

@jakule
Copy link
Copy Markdown
Contributor

@jakule jakule commented Nov 9, 2023

Added Access Graph proto file definitions. This GRPC service defines the schema Teleport will use to talk to Access Graph service.

Added Access Graph proto file definitions. This GRPC service defines the schema Teleport will use to talk to Access Graph service.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 9, 2023

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@github-actions github-actions Bot requested review from AntonAM and avatus November 9, 2023 02:48
@jakule jakule requested a review from codingllama November 9, 2023 02:48
@jakule jakule added the no-changelog Indicates that a PR does not require a changelog entry label Nov 9, 2023
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment on lines +41 to +44
// ID is the unique ID of the node.
string id = 1;
// Kind is the kind of the node, ex: "user", "user_group", "resource", etc.
string kind = 2;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we generally make these comments match the casing of the field? like id instead of ID?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I follow the official Proto3 guideline https://protobuf.dev/programming-guides/proto3/
For the new code (that is outside the api/proto/legacy buf linter forces us to follow this style.

Copy link
Copy Markdown
Contributor

@codingllama codingllama Nov 9, 2023

Choose a reason for hiding this comment

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

FYI, we do require some comments, but technically you don't need to use Go-style in here (unless I'm missing something). Meaning you don't need to start with the field name first.

Edit: correct link.

@codingllama
Copy link
Copy Markdown
Contributor

Isn't this that one proto service I reviewed mistakenly a while back? Are you looking for a proto review now?

Comment thread proto/accessgraph/v1alpha/query.proto Outdated
}

// GetFileRequest is a request to get a file.
message GetFileRequest {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What file requests are used for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question. TAG (the new service that will be using this proto) comes with its UI. This endpoint will be used to serve JS/CSS files from TAG through Teleport Proxy to the user.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This could use a lot more documentation, its purpose and what gets returned isn't clear at all.

I'd be also concerned that this RPC could become a dumping group for a large number of features.

Why not static serving, or representing routes in an HTTP server, or an enumeration of the possible files to fetch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that ideally we would remove this endpoint. Currently the flow is client -> Teleport Proxy -> TAG. The files that are returned here live in TAG in a similar way that webassets live in proxy. I only created is as we already have GRPC connection and proxying HTTP request would require opening additional port or multiplexing the connection.

@jakule
Copy link
Copy Markdown
Contributor Author

jakule commented Nov 9, 2023

Isn't this that one proto service I reviewed mistakenly a while back? Are you looking for a proto review now?

@codingllama That's the same proto (plus some minor modifications). This time, we're merging stuff into master from our dev branch. I think I addressed all the comments that you had, but I would appreciate another look to make sure that this version is ok.

Copy link
Copy Markdown
Contributor

@codingllama codingllama left a comment

Choose a reason for hiding this comment

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

Reviewed! Apologies for the delay.

Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
// AccessGraphService is a service for interacting the access graph service.
service AccessGraphService {
// Query queries the access graph.
// Currently only used by WebUI.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure this kind of comment belongs here, as ideally the RPCs are meant to be widely useful and fulfill a complete set of system operations.

Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/buf.lock Outdated
Comment thread proto/buf.yaml
Rename the service proto file to better describe its content.
Copy link
Copy Markdown
Contributor

@codingllama codingllama left a comment

Choose a reason for hiding this comment

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

2nd pass done. There are a number of open comments that I think could be addressed, plus a few new ones. It looks to me that the design could use more polish, there's enough that still feels vague or ad-hoc.

Let me know if you think this is useful or if you'd rather go ahead - in case it's latter, feel free to merge. We can get to the comments at some other point.

Comment thread proto/accessgraph/v1alpha/query.proto
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/buf.yaml Outdated
Comment thread proto/accessgraph/v1alpha/access_graph_service.proto Outdated
Comment thread proto/buf.lock Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
string from = 1;
// to is the ID of the node the edge is to.
string to = 2;
// type is the type of the edge, e.g. "member_of", "belongs_to", etc.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still think an enum would serve better here, but your call.

Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Comment thread proto/accessgraph/v1alpha/query.proto Outdated
Copy link
Copy Markdown
Contributor

@codingllama codingllama left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments.

@jakule jakule enabled auto-merge November 10, 2023 22:34
@jakule jakule added this pull request to the merge queue Nov 10, 2023
Merged via the queue into master with commit 3e77e34 Nov 10, 2023
@jakule jakule deleted the jakule/tag-proto branch November 10, 2023 23:07
@public-teleport-github-review-bot
Copy link
Copy Markdown

@jakule See the table below for backport results.

Branch Result
branch/v14 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants