You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor authentication to more easily support oauth (stadust#171)
* refactor: split `password_hash` field from `AuthenticatedUser`
Replace it with a `AuthenticationMethod` field. For now, this enum only
contains the `Legacy` variant, indicating that the given user is using
the current (but soon to be legacy) account system. Later, other
authentication methods such as OAuth will add their own variants here.
When matching in on `auth_method`, introduce unreachable `_ => ...` arms
that will return sensible default-errors for functions that that only
operate on legacy accounts (e.g. when doing oauth, you won't be able to
change your password).
Signed-off-by: stadust <[email protected]>
* refactor: hide `register` endpoint behind `legacy_accounts` feature
Once we support oauth accounts, we want to disable legacy accounts.
However, for testing purposes, as well as for people wanting to run
pointercrate clones, it is still desirable to use the legacy account
system. Thus, hide it behind a cargo feature.
Note that this cargo flag only disables the creation of new legacy
accounts. Pre-existing legacy accounts will continue to be able to log
in.
Signed-off-by: stadust <[email protected]>
* test: run with all features
Feature flags are meant to be additive, so running tests only with all
features enabled should not loose any coverage.
Signed-off-by: stadust <[email protected]>
* test: Add action for building all feature permutations
While runnings tests with only with `--all-features` is fine, we need to
make sure that all combinations of features actually build. Use
`cargo-all-features` for that. I don't expect us to ever have
sufficiently many feature for the combinatorial explosion of testing all
permutations to get bad.
Signed-off-by: stadust <[email protected]>
---------
Signed-off-by: stadust <[email protected]>
0 commit comments