Repository navigation
daytrader-go: auth - #2
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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.
Summary
Ports the auth area of DayTrader 3 to the Go target: login, invalid login, logout, the welcome page and the HTTP 500 page. Only
daytrader-go/internal/features/auth/anddaytrader-go/templates/auth_*.htmlare touched.TradeServletAction.doLogin+TradeSLSBBean.login+AccountDataBean.loginlogin(web.RegisterPublicAction("login")) +loginAccountTradeServletAction.doLogout+TradeSLSBBean.logoutlogout(web.RegisterAction("logout")) +logoutAccountdoWelcome+welcome.jspwelcome(web.RegisterWelcome, alsoGET /welcome.jsp) +auth_welcomeerror.jsp(web.xml<error-page>)errorPage(web.RegisterErrorPage) +auth_errorloginreadsweb.Param(r, "uid")/web.Param(r, "passwd"), soregistercan forward to it. In oneapp.Store.InTxit checks the password (exact match, likeString.equals), setslastloginand adds one tologincount. Then it setssession.UserIDandsession.CreationDateand callsapp.Forward(w, r, session, "home", {"results": "Ready to Trade"}).parity/transcripts/09-invalid-login.json(legacy:EJBException->ServletException->error.jsp). The session is not signed in.logoutadds one tologoutcountin a transaction, invalidates the session and shows the welcome page with no status line.Parity
make parityprinted PASS for these scenario ids:09-invalid-logindevin/1794800000-go-account(7ffbcd0) +devin/1794800000-go-market(6e78edb)01-login,02-home,08-account-update,09-invalid-login,10-logoutThe other scenarios in that combination were DIFF or ERROR; they need the trading and rest branches, which were not on origin when I ran it. The legacy Liberty baseline was 13/13 on the same machine.
I also compared the raw HTML with curl against Liberty on :9083 for
/welcome.jsp,/app,app?action=logoutandapp?action=homeafter logout: identical except for the licence comment and one blank line (see below).Gates, run in
daytrader-go/:gofmt -l .empty,go vet ./...clean,go test ./...ok. The tests that need PostgreSQL (TestLoginAccount,TestLoginLogoutOverHTTP) ran against themake go-dbdatabase; they skip when it is not reachable, so in CI without a database only the page tests run.Different from legacy on purpose
error.jspprints the full Java stack trace, and the login failure message contains both the password that was typed and the stored one. The Go page keeps the same layout and the linesProcessing request/StatusCode/Message/Exception, with the error message only. The phrases the parity scenario checks are unchanged.actionparameter).Content-Typeof the error page istext/html(legacy:text/html;charset=ISO-8859-1). Parity normalises this.Scaffold requests
web.SessionStorehas no way to issue a new session id at login. Legacy keeps the id too (req.getSession(true)), so this is parity-neutral, but aSessions.Renew(w, session)would close session fixation.web.WelcomeFuncgets no session, which is fine today; nothing else was missing.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/884bc4e2246c4272898d7f616e4bac0c
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/884bc4e2246c4272898d7f616e4bac0c?variant=devin
Requested by: @sumitshatwara