-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
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.
76c0996
to
90064d2
Compare
"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) |
There was a problem hiding this comment.
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.
} | ||
|
||
// AccessListSpec is the specification for an access list. | ||
type AccessListSpec struct { | ||
// Spec is the specification for an access list. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.