Repository navigation
Delete panel users with Paymenter users, skip OAuth consent for Calagopus, warn on unmatched egg variables - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paymenter deletes a user's services through a DB cascade, without calling terminateServer, so the panel user and all their servers were left behind. That's a problem for hosts handling data-deletion (GDPR) requests.
New checkbox: "Delete Panel Users With Paymenter Users" (off by default). When enabled, a User::deleting listener:
Finds the panel user by external ID, falling back to the OAuth link.
Force-deletes every server they own (Calagopus refuses to delete a user who still owns servers).
Deletes the panel user.
If the panel API fails, the exception aborts the Paymenter deletion so both sides stay consistent. boot() only runs once per extension name, so the listener walks every configured Calagopus server itself.
Login with Paymenter on the panel showed Passport's "authorize application" screen to every new user. Now, when a Paymenter OAuth client redirects to the host of a configured Calagopus panel, the screen is skipped and the user goes straight back to the panel. Other OAuth clients still ask for consent. No configuration needed.
This works through a client model subclass overriding skipsAuthorization(). It's registered in app()->booted() because Paymenter calls Passport::useClientModel() after extensions boot.
Unmatched config options are silently ignored and the egg falls back to its defaults, which is hard to debug after renaming an egg variable. The module now logs the unmatched names together with the egg's variable names.