Repository navigation
authz types could be more type-safe - #895
Conversation
This reverts commit 6e39d0c7ffe8431814a67f284b16407748176f53.
jmpesp
left a comment
There was a problem hiding this comment.
This looks very cool, and I approve, FWIW :) One thought below:
| authz_resource! { | ||
| name = "Role", | ||
| parent = "Fleet", | ||
| primary_key = (String, String), |
There was a problem hiding this comment.
It's too bad this couldn't be tied closer to what's in schema.rs, if something like
primary_key = db::schema::role_builtin::dsl::primary_key_type()
was possible, though even that statement is problematic because it'd probably return sql_types::Text instead of String.
There was a problem hiding this comment.
Agreed, that'd be a nice avenue for follow-up cleanup, if we can figure out how to do it.
plotnick
left a comment
There was a problem hiding this comment.
I think this is an unambiguous improvement over the previous API. As discussed in a call, it would be nice if we could use subtyping to eliminate the need for the individually generated Polar snippets, but we'd have to hack Polar a bit for that to work, so can be taken as a follow-up.
This draft addresses #848. It still needs more cleanup but I think it's close to ready for review.