feat: add auth endpoint for playwright tests against dev server deployment#315
Conversation
… before attempting to upload to pypi
…now linked file name
|
I made the requested changes to remove the extra |
neomorphic
left a comment
There was a problem hiding this comment.
As it stands, this looks fine to me. We could simplify the requests by removing the username header, but that is not essential. See my additional comment.
fileglancer/server.py
Outdated
| raise HTTPException(status_code=400, detail="X-API-Username header is required") | ||
|
|
||
| if username != "jacs": | ||
| raise HTTPException(status_code=403, detail="Username not permitted for test login") |
There was a problem hiding this comment.
Since we are limiting this login to a single user account, Is there any point in checking the username and forcing the tests to provide it. We could just hard code it in the db.create_session() call. We could also set this as a configurable username that can be changed in the settings.py
There was a problem hiding this comment.
That makes sense - it's probably also better not to have the username hard-coded and exposed in frontend code. I made this suggested change in commit 446145d in this repo and in commit JaneliaSciComp/fileglancer-janelia@68334c6 in fileglancer-janelia. I made a new Fileglancer alpha release, 2.7.0a2, that is currently running on fileglancer-dev with these changes. I confirmed the new fileglancer-janelia setup code without the username works to run the tests against fileglancer-dev.
Clickup id: 86ae17ge1
This PR adds an endpoint specifically for use on the fileglancer-dev server deployment to enable Playwright integration test to bypass the Okta multi-factor authentication. This endpoint is disabled by default, and requires a flag to enable it as well as a key that matches the key provided by the Playwright tests.
To test:
playwright-tests-against-fileglancer-devrepo..envfile with the value ofFGC_TEST_API_KEYfound in the.envfile on fileglancer-dev.pixi run test-uiMerging this PR will mean JaneliaSciComp/fileglancer-janelia#2 and JaneliaSciComp/fileglancer-hub#12 are also ready to merge.
@krokicki