Remove api_v1 feature toggle, making API v1 generally available#14408
Open
emilythericky wants to merge 1 commit into
Open
Remove api_v1 feature toggle, making API v1 generally available#14408emilythericky wants to merge 1 commit into
emilythericky wants to merge 1 commit into
Conversation
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? Why?
API v1 has been gated behind the
api_v1feature toggle: unless the flag was enabled for a user, every/api/v1endpoint returned 404, so the API was invisible except to selected pilot users. The funded credit-payments work (UK digital inclusion milestone) and the wider operational API roadmap both need v1 generally available, so this removes the toggle.Authentication and authorization are unaffected. The toggle was only a visibility gate (and a usage-monitoring measure that API-key requests already cover). authenticate_user still identifies callers via session or X-Api-Token/token API key, and CanCan still scopes all data to enterprises the caller manages — verified live: an invalid API key still gets 401, and anonymous requests get empty result sets, not data.
Changes (5 files, +7/−15, no migration):
base_controller.rb: remove therestrict_feature before-actionand method — the single gate inherited by all v1 controllersfeature_toggle.rb: removeapi_v1fromCURRENT_FEATURES;FeatureToggle.setup!already removes stored Flipper records not in this list on boot, so the flag cleans itself up without a migration - the two v1 request specs: drop thefeature: :api_v1metadata (spec_helperraises on tags not inCURRENT_FEATURES)swagger/v1.yaml: regenerated viarswag; whitespace-only churn, no endpoint changesWhile live-testing the customer transaction endpoint I found a pre-existing bug, unrelated to this change — filed separately as #14407.
What should we test?
api_v1is no longer listed; other toggles are unaffected./api-docsand select "API V1 Docs": all v1 endpoints are documented and "Try it out" works./api/v1/customersas an enterprise owner (session or API key): 200 with that enterprise's customers, without enabling any feature./api/v1/customersanonymously: 200 with empty data (previously 404). - GET/api/v1/customerswith an invalid X-Api-Token: still 401 — auth is unchanged./api/v1/customer_account_transactionas an enterprise owner: 201 — the credit endpoint works without the flag.Release notes
Changelog Category (reviewers may add a label for the release notes):
Documentation updates
api_v1— entry should be removed.api_v1flag — should now say v1 is generally available.Screenshots
Toggle Removed






API-Docs page
API-Docs page works
Key still has to be turned on for user
API token works (not logged in)
Wrong token returns error