Remove unused API, apipie, rack-cors, and jwt#1352
Open
Conversation
The API (app/controllers/api/v1/) was built for a WordPress integration that never materialized or was abandoned. No frontend code calls these endpoints, no external clients consume them, and there are no tests. Removes: - 5 API v1 controllers (auth, quotes, resources, workshops) - AuthenticationToken JWT service and AuthenticationFailed error - apipie-rails gem and its Rails 8 compatibility patch - API routes and apipie documentation mount
rack-cors: This app is a traditional server-rendered Rails app using Turbo/Stimulus — all requests originate from the same domain. CORS headers are only needed when a browser makes cross-origin requests (e.g. a separate SPA or external site calling your API). With the API removed and no cross-origin consumers, rack-cors adds middleware to every request for no benefit. Rails does not include built-in CORS support, so if cross-origin needs arise later, rack-cors can be re-added with a proper initializer (one never existed here). jwt: Only used by the now-removed AuthenticationToken service for API auth. No other code references the JWT gem.
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.
What is the goal of this PR and why is this important?
app/controllers/api/v1/) and its supporting gemsHow did you approach the change?
Anything else to add?
rack-corshad no CORS initializer — it was adding middleware with no configurationjwtwas only used byAuthenticationToken, which was only used by the APIrack-corscan be re-added with a proper initializer