diff --git a/app/controllers/api_keys/non_commercials_controller.rb b/app/controllers/api_keys/non_commercials_controller.rb index d4c24da61..551b4dc20 100644 --- a/app/controllers/api_keys/non_commercials_controller.rb +++ b/app/controllers/api_keys/non_commercials_controller.rb @@ -6,6 +6,10 @@ class NonCommercialsController < ApplicationController extend T::Sig sig { void } - def new; end + def new + unless Flipper.enabled?(:request_api_keys, current_user) + raise ActiveRecord::RecordNotFound + end + end end end diff --git a/app/controllers/api_keys/paid_controller.rb b/app/controllers/api_keys/paid_controller.rb index fd0c2bbe5..6a5ca379f 100644 --- a/app/controllers/api_keys/paid_controller.rb +++ b/app/controllers/api_keys/paid_controller.rb @@ -6,6 +6,10 @@ class PaidController < ApplicationController extend T::Sig sig { void } - def new; end + def new + unless Flipper.enabled?(:request_api_keys, current_user) + raise ActiveRecord::RecordNotFound + end + end end end diff --git a/app/controllers/api_keys/requests_controller.rb b/app/controllers/api_keys/requests_controller.rb index da4cb6fab..c3a218009 100644 --- a/app/controllers/api_keys/requests_controller.rb +++ b/app/controllers/api_keys/requests_controller.rb @@ -5,7 +5,13 @@ module ApiKeys class RequestsController < ApplicationController extend T::Sig + # TODO: Need to be logged in to use this page + sig { void } - def new; end + def new + unless Flipper.enabled?(:request_api_keys, current_user) + raise ActiveRecord::RecordNotFound + end + end end end diff --git a/config/initializers/flipper.rb b/config/initializers/flipper.rb index 704e02d33..b4999c27a 100644 --- a/config/initializers/flipper.rb +++ b/config/initializers/flipper.rb @@ -17,7 +17,8 @@ # You must also disable writes to the database by creating a database user with read-only privileges and using that "maintenance_mode" => "Put a banner across the site and give helpful message to the user if trying to write to the database", "full_text_search" => "Allow searching for all applications containing the word 'tree', for example", - "view_application_versions" => "Can view the update history of an application" + "view_application_versions" => "Can view the update history of an application", + "request_api_keys" => "Allow a new experimental flow for requesting API keys. Only works with tailwind theme." } end