Skip to content

Refactor Auth#11

Merged
Morganamilo merged 8 commits intomainfrom
idiomaticify2
Jun 29, 2022
Merged

Refactor Auth#11
Morganamilo merged 8 commits intomainfrom
idiomaticify2

Conversation

@Morganamilo
Copy link
Copy Markdown
Contributor

This is rather huge and I wish it was split more commits but most of the
code didnt compile through this process.

This makes AuthParms and AuthOptions direct arguments to the auth
functions, doing away with the builder functions. Having a separate
builder type for both functions, and each having functions to set all
the auth options/parms options seemed quite a bit overkill. Especially
as the user may wish to save these structs for reuse. I also found it
a bit confusing personally.

I've also tweaked what is and isn't an option. This is surely not 100%
correct and the spec is not the best at laying this out so I'm sure more
work will be needed.

This also combines things that can't be set at the same time into enums.
For auth at anyway, this still needs to be done for client options.

Morgan Adamiec added 6 commits June 28, 2022 10:36
This is rather huge and I wish it was split more commits but most of the
code didnt compile through this process.

This makes AuthParms and AuthOptions direct arguments to the auth
functions, doing away with the builder functions. Having a separate
builder type for both functions, and each having functions to set all
the auth options/parms options seemed quite a bit overkill. Especially
as the user may wish to save these structs for reuse. I also found it
a bit confusing personally.

I've also tweaked what is and isn't an option. This is surely not 100%
correct and the spec is not the best at laying this out so I'm sure more
work will be needed.

This also combines things that can't be set at the same time into enums.
For auth at anyway, this still needs to be done for client options.
This makes it impossible to not supply one at compile time and
removes an error condition.

This also removes some (try)into impls and adds some helper functions.
Saves always duplicating the whole client options.
Makes it clear they are not chain functions.
Copy link
Copy Markdown
Member

@lmars lmars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Morganamilo Morganamilo merged commit 1d9aa3d into main Jun 29, 2022
@Morganamilo Morganamilo deleted the idiomaticify2 branch June 29, 2022 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants