Commit 098a5166 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Rename Api to API

This is needed when we switch to Zeitwerk since our inflections must be
consistent. This makes it consistent with all other places where we use
API.
parent b01c63af
...@@ -20,7 +20,7 @@ the feature categories in the [Secure](https://about.gitlab.com/stages-devops-li ...@@ -20,7 +20,7 @@ the feature categories in the [Secure](https://about.gitlab.com/stages-devops-li
- `AppSec::ContainerScanning`: Container Scanning code. - `AppSec::ContainerScanning`: Container Scanning code.
- `AppSec::Dast`: DAST code. - `AppSec::Dast`: DAST code.
- `AppSec::DependencyScanning`: Dependency Scanning code. - `AppSec::DependencyScanning`: Dependency Scanning code.
- `AppSec::Fuzzing::Api`: API Fuzzing code. - `AppSec::Fuzzing::API`: API Fuzzing code.
- `AppSec::Fuzzing::Coverage`: Coverage Fuzzing code. - `AppSec::Fuzzing::Coverage`: Coverage Fuzzing code.
- `AppSec::Fuzzing`: Shared fuzzing code. - `AppSec::Fuzzing`: Shared fuzzing code.
- `AppSec::LicenseCompliance`: License Compliance code. - `AppSec::LicenseCompliance`: License Compliance code.
......
...@@ -78,7 +78,7 @@ module EE ...@@ -78,7 +78,7 @@ module EE
mount_mutation ::Mutations::IncidentManagement::OncallRotation::Destroy mount_mutation ::Mutations::IncidentManagement::OncallRotation::Destroy
mount_mutation ::Mutations::IncidentManagement::EscalationPolicy::Create mount_mutation ::Mutations::IncidentManagement::EscalationPolicy::Create
mount_mutation ::Mutations::IncidentManagement::EscalationPolicy::Destroy mount_mutation ::Mutations::IncidentManagement::EscalationPolicy::Destroy
mount_mutation ::Mutations::AppSec::Fuzzing::Api::CiConfiguration::Create mount_mutation ::Mutations::AppSec::Fuzzing::API::CiConfiguration::Create
prepend(Types::DeprecatedMutations) prepend(Types::DeprecatedMutations)
end end
......
...@@ -146,7 +146,7 @@ module EE ...@@ -146,7 +146,7 @@ module EE
resolver: ::Resolvers::IncidentManagement::EscalationPoliciesResolver.single resolver: ::Resolvers::IncidentManagement::EscalationPoliciesResolver.single
field :api_fuzzing_ci_configuration, field :api_fuzzing_ci_configuration,
::Types::AppSec::Fuzzing::Api::CiConfigurationType, ::Types::AppSec::Fuzzing::API::CiConfigurationType,
null: true, null: true,
description: 'API fuzzing configuration for the project. ' description: 'API fuzzing configuration for the project. '
...@@ -174,10 +174,10 @@ module EE ...@@ -174,10 +174,10 @@ module EE
def api_fuzzing_ci_configuration def api_fuzzing_ci_configuration
return unless Ability.allowed?(current_user, :read_security_resource, object) return unless Ability.allowed?(current_user, :read_security_resource, object)
configuration = ::AppSec::Fuzzing::Api::CiConfiguration.new(project: object) configuration = ::AppSec::Fuzzing::API::CiConfiguration.new(project: object)
{ {
scan_modes: ::AppSec::Fuzzing::Api::CiConfiguration::SCAN_MODES, scan_modes: ::AppSec::Fuzzing::API::CiConfiguration::SCAN_MODES,
scan_profiles: configuration.scan_profiles scan_profiles: configuration.scan_profiles
} }
end end
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Mutations module Mutations
module AppSec module AppSec
module Fuzzing module Fuzzing
module Api module API
module CiConfiguration module CiConfiguration
class Create < BaseMutation class Create < BaseMutation
include FindsProject include FindsProject
...@@ -27,7 +27,7 @@ module Mutations ...@@ -27,7 +27,7 @@ module Mutations
required: false, required: false,
description: 'CI variable containing the username for authenticating with the target API.' description: 'CI variable containing the username for authenticating with the target API.'
argument :scan_mode, ::Types::AppSec::Fuzzing::Api::ScanModeEnum, argument :scan_mode, ::Types::AppSec::Fuzzing::API::ScanModeEnum,
required: true, required: true,
description: 'The mode for API fuzzing scans.' description: 'The mode for API fuzzing scans.'
...@@ -53,7 +53,7 @@ module Mutations ...@@ -53,7 +53,7 @@ module Mutations
def resolve(args) def resolve(args)
project = authorized_find!(args[:project_path]) project = authorized_find!(args[:project_path])
create_service = ::AppSec::Fuzzing::Api::CiConfigurationCreateService.new( create_service = ::AppSec::Fuzzing::API::CiConfigurationCreateService.new(
container: project, current_user: current_user, params: args container: project, current_user: current_user, params: args
) )
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Types module Types
module AppSec module AppSec
module Fuzzing module Fuzzing
module Api module API
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class CiConfigurationType < BaseObject class CiConfigurationType < BaseObject
graphql_name 'ApiFuzzingCiConfiguration' graphql_name 'ApiFuzzingCiConfiguration'
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
module Types module Types
module AppSec module AppSec
module Fuzzing module Fuzzing
module Api module API
class ScanModeEnum < BaseEnum class ScanModeEnum < BaseEnum
graphql_name 'ApiFuzzingScanMode' graphql_name 'ApiFuzzingScanMode'
description 'All possible ways to specify the API surface for an API fuzzing scan.' description 'All possible ways to specify the API surface for an API fuzzing scan.'
::AppSec::Fuzzing::Api::CiConfiguration::SCAN_MODES.each do |mode| ::AppSec::Fuzzing::API::CiConfiguration::SCAN_MODES.each do |mode|
value mode.upcase, value: mode, description: "The API surface is specified by a #{mode.upcase} file." value mode.upcase, value: mode, description: "The API surface is specified by a #{mode.upcase} file."
end end
end end
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Types module Types
module AppSec module AppSec
module Fuzzing module Fuzzing
module Api module API
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class ScanProfileType < BaseObject class ScanProfileType < BaseObject
graphql_name 'ApiFuzzingScanProfile' graphql_name 'ApiFuzzingScanProfile'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module AppSec module AppSec
module Fuzzing module Fuzzing
module Api module API
class CiConfiguration class CiConfiguration
PROFILES_DEFINITION_FILE = 'https://gitlab.com/gitlab-org/security-products/analyzers' \ PROFILES_DEFINITION_FILE = 'https://gitlab.com/gitlab-org/security-products/analyzers' \
'/api-fuzzing/-/raw/master/gitlab-api-fuzzing-config.yml' '/api-fuzzing/-/raw/master/gitlab-api-fuzzing-config.yml'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module AppSec module AppSec
module Fuzzing module Fuzzing
module Api module API
class ScanProfile class ScanProfile
NAMES = %w(Quick-10 Medium-20 Medium-50 Long-100).freeze NAMES = %w(Quick-10 Medium-20 Medium-50 Long-100).freeze
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module AppSec module AppSec
module Fuzzing module Fuzzing
module Api module API
class CiConfigurationCreateService < ::BaseContainerService class CiConfigurationCreateService < ::BaseContainerService
API_SPECIFICATION_CI_VARIABLES = { API_SPECIFICATION_CI_VARIABLES = {
har: 'FUZZAPI_HAR', har: 'FUZZAPI_HAR',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Mutations::AppSec::Fuzzing::Api::CiConfiguration::Create do RSpec.describe Mutations::AppSec::Fuzzing::API::CiConfiguration::Create do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe AppSec::Fuzzing::Api::CiConfiguration do RSpec.describe AppSec::Fuzzing::API::CiConfiguration do
include StubRequests include StubRequests
describe '#scan_profiles' do describe '#scan_profiles' do
......
...@@ -38,7 +38,7 @@ RSpec.describe 'Query.project(fullPath).apiFuzzingCiConfiguration' do ...@@ -38,7 +38,7 @@ RSpec.describe 'Query.project(fullPath).apiFuzzingCiConfiguration' do
project.add_developer(user) project.add_developer(user)
stub_full_request( stub_full_request(
::AppSec::Fuzzing::Api::CiConfiguration::PROFILES_DEFINITION_FILE ::AppSec::Fuzzing::API::CiConfiguration::PROFILES_DEFINITION_FILE
).to_return(body: profiles_yaml) ).to_return(body: profiles_yaml)
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe ::AppSec::Fuzzing::Api::CiConfigurationCreateService do RSpec.describe ::AppSec::Fuzzing::API::CiConfigurationCreateService do
let(:service) { described_class.new(container: double(Project), current_user: double(User), params: params) } let(:service) { described_class.new(container: double(Project), current_user: double(User), params: params) }
describe '#create' do describe '#create' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment