Closed sprudel closed 3 months ago
Very nice, however: since this will result in a breaking change, I need some kind of description, how users of #550 can work around the removed role feature.
@buehler where would you prefer to have such documentation?
it is basically a standard extension trait
enum Role {
Admin,
Client
}
trait MyExtIntrospectedUser {
fn role(&self, role: Role) -> Option<..>;
}
impl MyExtIntrospectedUser for IntrospectedUser {
fn role(&self, role: Role) -> Option<..> {
// convenience impl here
}
}
It would be nice to have this in the docs of ZitadelExtraTokenFields struct. There were you removed the role generic. As such, I can also include them as the migration path for the breaking change.
@buehler I added the example both for the IntrospectedUser
and ZitadelExtraTokenFields
struct
Main goals of this PR:
To achieve this I had to remove the Role generic type parameter introduced in #550 , as this was incompatible with the type erasure for the IntrospectionCache trait types. But there are simple ways to achieve the same convenience on library user side.