-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add user interface #56
Merged
Merged
Conversation
This file contains 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
Add routes to serve each page from the UI build.
Latest Litestar includes `SecretString` type.
Pages are protected by custom auth middleware and endpoints are protected by an auth "guard". At start up, we generate a random authorization token and print it to the console. To log in, users must provide the token to the `login` endpoint. In the UI, this can be accomplished with a post `fetch` request setting `redirect` to "follow" and manually handling the redirect: ```javascript if (resp.redirected) { window.location.href = resp.url; } ``` We use built-in cookie-based session middleware to keep track of whether users are logged in or not. A user is authenticated if their request contains a session with `token=AUTH_TOKEN`. In `DEV_MODE`, use secret token "test" to authorize.
This commit relocates `app` from `__init__.py` to `asgi.py`. For a minimal application, `__init__.py` is a reasonable location (and one of the locations where Litestar automatically checks for an `app`), but for a more complex application where we are importing objects from `src/app`, this location becomes problematic.
Fixes volume mount and image path.
Forwards port and uses service `name` instead of `job_id`.
…ackfish into user-interface
Closes #47.
This was
linked to
issues
Oct 16, 2024
Closed
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.
The application now serves pre-built HTML webpages in addition to the application endpoints. All resources required to serve the UI are stored in
src/build
. The build directory should be a copy of the optimized build generated by runningrpm run build
on the UI repository.This PR also introduces token-based authentication via custom middleware. Authentication can be enabled or disabled at start-up using the
BLACKFISH_DEV_MODE
environment variable (set to0
to require authentication). With authentication enabled, protected pages and endpoints require the user to enter a randomly generated token one time.Closes #54, #53, #47, and #50.