Skip to content

feat(client)!: use unique endpoint typestates#335

Open
dustypomerleau wants to merge 1 commit intoramosbugs:mainfrom
dustypomerleau:zsts
Open

feat(client)!: use unique endpoint typestates#335
dustypomerleau wants to merge 1 commit intoramosbugs:mainfrom
dustypomerleau:zsts

Conversation

@dustypomerleau
Copy link
Copy Markdown

Thanks for all the time you've put into oauth2-rs!

I have been interacting with this crate via axum-login, and one challenge is the need to always remember the order of the typestate generics on Client. Updating the generics to use specific typestates for each endpoint type would be a breaking change, but it would make it possible to tell at a glance which endpoints are set without memorizing the order.

In short, it would change:

let client: BasicClient<
    EndpointSet,
    EndpointNotSet,
    EndpointNotSet,
    EndpointNotSet,
    EndpointSet,
> = todo!();

to:

let client: BasicClient<
    AuthEndpointSet,
    DeviceAuthEndpointNotSet,
    IntrospectionEndpointNotSet,
    RevocationEndpointNotSet,
    TokenEndpointSet,
> = todo!();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant