diff --git a/app/controllers/api/rest/admin/accounting_profiles_controller.rb b/app/controllers/api/rest/admin/accounting_profiles_controller.rb deleted file mode 100644 index 90b8be0e1..000000000 --- a/app/controllers/api/rest/admin/accounting_profiles_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -class Api::Rest::Admin::AccountingProfilesController < Api::Rest::Admin::BaseController -end diff --git a/app/controllers/api/rest/admin/auth_profiles_controller.rb b/app/controllers/api/rest/admin/auth_profiles_controller.rb deleted file mode 100644 index b9f73e9e9..000000000 --- a/app/controllers/api/rest/admin/auth_profiles_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -class Api::Rest::Admin::AuthProfilesController < Api::Rest::Admin::BaseController -end diff --git a/app/controllers/api/rest/admin/radius_accounting_profiles_controller.rb b/app/controllers/api/rest/admin/radius_accounting_profiles_controller.rb new file mode 100644 index 000000000..7bbf70a60 --- /dev/null +++ b/app/controllers/api/rest/admin/radius_accounting_profiles_controller.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +class Api::Rest::Admin::RadiusAccountingProfilesController < Api::Rest::Admin::BaseController +end diff --git a/app/controllers/api/rest/admin/radius_auth_profiles_controller.rb b/app/controllers/api/rest/admin/radius_auth_profiles_controller.rb new file mode 100644 index 000000000..bf0030eae --- /dev/null +++ b/app/controllers/api/rest/admin/radius_auth_profiles_controller.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +class Api::Rest::Admin::RadiusAuthProfilesController < Api::Rest::Admin::BaseController +end diff --git a/app/resources/api/rest/admin/customers_auth_resource.rb b/app/resources/api/rest/admin/customers_auth_resource.rb index 2ce793e0f..b1547da17 100644 --- a/app/resources/api/rest/admin/customers_auth_resource.rb +++ b/app/resources/api/rest/admin/customers_auth_resource.rb @@ -23,8 +23,8 @@ class Api::Rest::Admin::CustomersAuthResource < BaseResource has_one :dst_numberlist, class_name: 'Numberlist', always_include_linkage_data: true has_one :src_numberlist, class_name: 'Numberlist', always_include_linkage_data: true has_one :tag_action, class_name: 'TagAction', always_include_linkage_data: true - has_one :radius_auth_profile, class_name: 'AuthProfile', always_include_linkage_data: true - has_one :radius_accounting_profile, class_name: 'AccountingProfile', always_include_linkage_data: true + has_one :radius_auth_profile, class_name: 'RadiusAuthProfile', always_include_linkage_data: true + has_one :radius_accounting_profile, class_name: 'RadiusAccountingProfile', always_include_linkage_data: true has_one :transport_protocol, class_name: 'TransportProtocol', always_include_linkage_data: true filter :name diff --git a/app/resources/api/rest/admin/accounting_profile_resource.rb b/app/resources/api/rest/admin/radius_accounting_profile_resource.rb similarity index 80% rename from app/resources/api/rest/admin/accounting_profile_resource.rb rename to app/resources/api/rest/admin/radius_accounting_profile_resource.rb index 21208b35f..f6569d67d 100644 --- a/app/resources/api/rest/admin/accounting_profile_resource.rb +++ b/app/resources/api/rest/admin/radius_accounting_profile_resource.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Api::Rest::Admin::AccountingProfileResource < ::BaseResource +class Api::Rest::Admin::RadiusAccountingProfileResource < ::BaseResource model_name 'Equipment::Radius::AccountingProfile' attributes :name, :server, :port, :secret, :timeout, :attempts, :enable_start_accounting, diff --git a/app/resources/api/rest/admin/auth_profile_resource.rb b/app/resources/api/rest/admin/radius_auth_profile_resource.rb similarity index 75% rename from app/resources/api/rest/admin/auth_profile_resource.rb rename to app/resources/api/rest/admin/radius_auth_profile_resource.rb index f684b0957..a420a899f 100644 --- a/app/resources/api/rest/admin/auth_profile_resource.rb +++ b/app/resources/api/rest/admin/radius_auth_profile_resource.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Api::Rest::Admin::AuthProfileResource < ::BaseResource +class Api::Rest::Admin::RadiusAuthProfileResource < ::BaseResource model_name 'Equipment::Radius::AuthProfile' attributes :name, :server, :port, :secret, :reject_on_error, :timeout, :attempts diff --git a/config/routes.rb b/config/routes.rb index ee43167cd..877bf64b0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -141,8 +141,8 @@ def dasherized_resources(name, options = {}, &block) jsonapi_resources :registrations jsonapi_resources :sip_options_probers - jsonapi_resources :accounting_profiles - jsonapi_resources :auth_profiles + jsonapi_resources :radius_accounting_profiles + jsonapi_resources :radius_auth_profiles jsonapi_resources :areas jsonapi_resources :area_prefixes diff --git a/spec/acceptance/rest/admin/api/accounting_profiles_spec.rb b/spec/acceptance/rest/admin/api/accounting_profiles_spec.rb index b03b06ce8..aafe22518 100644 --- a/spec/acceptance/rest/admin/api/accounting_profiles_spec.rb +++ b/spec/acceptance/rest/admin/api/accounting_profiles_spec.rb @@ -2,15 +2,15 @@ require 'rspec_api_documentation/dsl' -RSpec.resource 'Accounting profiles' do +RSpec.resource 'Radius Accounting profiles' do include_context :acceptance_admin_user - let(:type) { 'accounting-profiles' } + let(:type) { 'radius-accounting-profiles' } required_params = %i[name server port secret timeout attempts] optional_params = %i[enable-start-accounting enable-interim-accounting interim-accounting-interval enable-stop-accounting] - get '/api/rest/admin/accounting-profiles' do - jsonapi_filters Api::Rest::Admin::AccountingProfileResource._allowed_filters + get '/api/rest/admin/radius-accounting-profiles' do + jsonapi_filters Api::Rest::Admin::RadiusAccountingProfileResource._allowed_filters before { create_list(:accounting_profile, 2) } @@ -19,7 +19,7 @@ end end - get '/api/rest/admin/accounting-profiles/:id' do + get '/api/rest/admin/radius-accounting-profiles/:id' do let(:id) { create(:accounting_profile).id } example_request 'get specific entry' do @@ -27,8 +27,8 @@ end end - post '/api/rest/admin/accounting-profiles' do - parameter :type, 'Resource type (accounting_profiles)', scope: :data, required: true + post '/api/rest/admin/radius-accounting-profiles' do + parameter :type, 'Resource type (radius-accounting-profiles)', scope: :data, required: true jsonapi_attributes(required_params, optional_params) @@ -44,8 +44,8 @@ end end - put '/api/rest/admin/accounting-profiles/:id' do - parameter :type, 'Resource type (accounting_profiles)', scope: :data, required: true + put '/api/rest/admin/radius-accounting-profiles/:id' do + parameter :type, 'Resource type (radius-accounting-profiles)', scope: :data, required: true parameter :id, 'Accounting profile ID', scope: :data, required: true jsonapi_attributes(required_params, optional_params) @@ -58,7 +58,7 @@ end end - delete '/api/rest/admin/accounting-profiles/:id' do + delete '/api/rest/admin/radius-accounting-profiles/:id' do let(:id) { create(:accounting_profile).id } example_request 'delete entry' do diff --git a/spec/acceptance/rest/admin/api/auth_profiles_spec.rb b/spec/acceptance/rest/admin/api/auth_profiles_spec.rb index 8a2729311..f516b3b5e 100644 --- a/spec/acceptance/rest/admin/api/auth_profiles_spec.rb +++ b/spec/acceptance/rest/admin/api/auth_profiles_spec.rb @@ -2,15 +2,15 @@ require 'rspec_api_documentation/dsl' -RSpec.resource 'Auth profiles' do +RSpec.resource 'Radius Auth profiles' do include_context :acceptance_admin_user - let(:type) { 'auth-profiles' } + let(:type) { 'radius-auth-profiles' } required_params = %i[name server port secret timeout attempts] optional_params = %i[enable-start-accounting enable-interim-accounting interim-accounting-interval enable-stop-accounting] - get '/api/rest/admin/auth-profiles' do - jsonapi_filters Api::Rest::Admin::AuthProfileResource._allowed_filters + get '/api/rest/admin/radius-auth-profiles' do + jsonapi_filters Api::Rest::Admin::RadiusAuthProfileResource._allowed_filters before { create_list(:auth_profile, 2) } @@ -19,7 +19,7 @@ end end - get '/api/rest/admin/auth-profiles/:id' do + get '/api/rest/admin/radius-auth-profiles/:id' do let(:id) { create(:auth_profile).id } example_request 'get specific entry' do @@ -27,8 +27,8 @@ end end - post '/api/rest/admin/auth-profiles' do - parameter :type, 'Resource type (auth-profiles)', scope: :data, required: true + post '/api/rest/admin/radius-auth-profiles' do + parameter :type, 'Resource type (radius-auth-profiles)', scope: :data, required: true jsonapi_attributes(required_params, optional_params) @@ -44,8 +44,8 @@ end end - put '/api/rest/admin/auth-profiles/:id' do - parameter :type, 'Resource type (auth-profiles)', scope: :data, required: true + put '/api/rest/admin/radius-auth-profiles/:id' do + parameter :type, 'Resource type (radius-auth-profiles)', scope: :data, required: true parameter :id, 'Auth profile ID', scope: :data, required: true jsonapi_attributes(required_params, optional_params) @@ -58,7 +58,7 @@ end end - delete '/api/rest/admin/auth-profiles/:id' do + delete '/api/rest/admin/radius-auth-profiles/:id' do let(:id) { create(:auth_profile).id } example_request 'delete entry' do diff --git a/spec/requests/api/rest/admin/accounting_profiles_spec.rb b/spec/requests/api/rest/admin/radius_accounting_profiles_spec.rb similarity index 69% rename from spec/requests/api/rest/admin/accounting_profiles_spec.rb rename to spec/requests/api/rest/admin/radius_accounting_profiles_spec.rb index fe8c6cc4d..51c22e8a0 100644 --- a/spec/requests/api/rest/admin/accounting_profiles_spec.rb +++ b/spec/requests/api/rest/admin/radius_accounting_profiles_spec.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -RSpec.describe Api::Rest::Admin::AccountingProfilesController, type: :request do - include_context :json_api_admin_helpers, type: :'accounting-profiles' +RSpec.describe Api::Rest::Admin::RadiusAccountingProfilesController, type: :request do + include_context :json_api_admin_helpers, type: :'radius-accounting-profiles' - describe 'GET /api/rest/admin/accounting-profiles' do + describe 'GET /api/rest/admin/radius-accounting-profiles' do subject do get json_api_request_path, params: nil, headers: json_api_request_headers end diff --git a/spec/requests/api/rest/admin/auth_profile_spec.rb b/spec/requests/api/rest/admin/radius_auth_profile_spec.rb similarity index 70% rename from spec/requests/api/rest/admin/auth_profile_spec.rb rename to spec/requests/api/rest/admin/radius_auth_profile_spec.rb index 5ed2b6852..1eb3719e3 100644 --- a/spec/requests/api/rest/admin/auth_profile_spec.rb +++ b/spec/requests/api/rest/admin/radius_auth_profile_spec.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -RSpec.describe Api::Rest::Admin::AuthProfilesController, type: :request do - include_context :json_api_admin_helpers, type: :'auth-profiles' +RSpec.describe Api::Rest::Admin::RadiusAuthProfilesController, type: :request do + include_context :json_api_admin_helpers, type: :'radius-auth-profiles' - describe 'GET /api/rest/admin/auth-profiles' do + describe 'GET /api/rest/admin/radius-auth-profiles' do subject do get json_api_request_path, params: nil, headers: json_api_request_headers end