LonelyVikingMichael / litestar-users

Authentication and user management for the Litestar framework
https://lonelyvikingmichael.github.io/litestar-users/
MIT License
42 stars 12 forks source link

feat: allow identifier URI customization #56

Open cofin opened 9 months ago

cofin commented 9 months ago

This PR enables the customization of the name and type of the identifier URI for the user_management_handler_config and role_management_handler_config route generators.

LonelyVikingMichael commented 9 months ago

Thanks for this, I'm currently on leave and will give it proper eyes once I'm back

I'm curious to see the behaviour when the path param name doesn't match the variable name. This setting effectively allows this:

@post("/some/path/{foo:uuid}")
def add_user(id_: UUID, ...) -> User:
    ...

In which case id_ will just be registered as a query param?

cofin commented 9 months ago

Thanks for this, I'm currently on leave and will give it proper eyes once I'm back

I'm curious to see the behaviour when the path param name doesn't match the variable name. This setting effectively allows this:

@post("/some/path/{foo:uuid}")
def add_user(id_: UUID, ...) -> User:
    ...

In which case id_ will just be registered as a query param?

Good question. I intended to add a few tests to this before the break, but I ran out of time.

There's one additional feature that I would like to see implemented, but I'll ping you in discord re: the best approach for this.