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

Clean up access list protos, add in conversion functions tests. #28787

Merged
merged 7 commits into from
Jul 13, 2023

Conversation

mdwn
Copy link
Contributor

@mdwn mdwn commented Jul 6, 2023

The access list protos have been cleaned up to fit into the existing generated protos a little more cleanly, and conversion functions have been migrated to their own packages and tests for them have been added.

Mike Wilson added 3 commits July 7, 2023 13:01
The access list protos have been cleaned up to fit into the existing generated
protos a little more cleanly, and conversion functions have been migrated to
their own packages and tests for them have been added.
@mdwn mdwn force-pushed the mike.wilson/access-list-proto-cleanup branch from 76c0996 to 90064d2 Compare July 7, 2023 17:03
@smallinsky smallinsky self-requested a review July 11, 2023 13:23
"github.com/gravitational/teleport/lib/utils"
)

// AccessListsGetter defines an interface for reading access lists.
type AccessListsGetter interface {
// GetAccessLists returns a list of all access lists.
GetAccessLists(context.Context) ([]*types.AccessList, error)
GetAccessLists(context.Context) ([]*accesslist.AccessList, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a huge fan of the name stuttering on the calling side here - but unfortunately I don't have a good suggestion for the AccessList type itself.

lib/services/access_list_test.go Outdated Show resolved Hide resolved
}

// AccessListSpec is the specification for an access list.
type AccessListSpec struct {
// Spec is the specification for an access list.
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the advantage of having almost duplicate structs here and generated structs from protobuf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a fairly substantial debate about it in #28386, but overall there's value in decoupling our internal storage representation from our API where applicable. In this case, I think it's applicable, so I've made this separate resource.

Copy link
Contributor

@jakule jakule left a comment

Choose a reason for hiding this comment

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

LGTM

@mdwn mdwn added this pull request to the merge queue Jul 13, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 13, 2023
@mdwn mdwn added this pull request to the merge queue Jul 13, 2023
Merged via the queue into master with commit 61163ce Jul 13, 2023
@mdwn mdwn deleted the mike.wilson/access-list-proto-cleanup branch July 13, 2023 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants