Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17248 Enable creation of ST accounts for webdriver simulated users #3424

Merged
merged 1 commit into from
Dec 25, 2023

Conversation

btangmu
Copy link
Member

@btangmu btangmu commented Dec 23, 2023

-Simulated users have pseudo email addresses like [email protected]

-New class AuthSurveyDriver

-In Auth, if login fails, call AuthSurveyDriver to enable creation of account if appropriate

-Only create simulated users if SurveyMain.isUnofficial, never on production server

-Only create simulated users if CLDR_WEBDRIVER_PASSWORD is defined in cldr.properties

CLDR-17248

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

-Simulated users have pseudo email addresses like [email protected]

-New class AuthSurveyDriver

-In Auth, if login fails, call AuthSurveyDriver to enable creation of account if appropriate

-Only create simulated users if SurveyMain.isUnofficial, never on production server

-Only create simulated users if CLDR_WEBDRIVER_PASSWORD is defined in cldr.properties
}
if (user == null) {
user = AuthSurveyDriver.createTestUser(request.password, request.email);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

this is a little awkward since UserRegistry.get sometimes throws LogoutException and sometimes just returns null without throwing an exception -- currently it throws LogoutException for a new webdriver user, but I didn't want to rely on that here, so this also handles the null return possibility

if (user == null) {
return Response.status(403, "Login failed").build();
throw new LogoutException();
Copy link
Member Author

Choose a reason for hiding this comment

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

there's already a catch(LogoutException) below which returns Response.status(403, "Login failed").build()

if we returned that response directly here, the catch below would trigger an "unused" warning, and removing it would result in a many lines of code changing their indentation, and this change would look much larger than it really is

@btangmu btangmu self-assigned this Dec 23, 2023
@btangmu btangmu requested a review from srl295 December 23, 2023 02:23
@btangmu
Copy link
Member Author

btangmu commented Dec 23, 2023

This goes together with unicode-org/cldr-apps-webdriver#31

@btangmu btangmu merged commit fcb968b into unicode-org:main Dec 25, 2023
10 checks passed
@btangmu btangmu deleted the t17248_g branch December 25, 2023 19:51
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.

2 participants