Commit 25bfcd9b authored by James Fargher's avatar James Fargher

Merge branch 'mc_rocha-annotate-dast-service-strings-for-localization-301225' into 'master'

Annotate DAST Service object strings for localization

See merge request gitlab-org/gitlab!72720
parents 7e18a64d 23b28e68
...@@ -5,7 +5,7 @@ module AppSec ...@@ -5,7 +5,7 @@ module AppSec
module Profiles module Profiles
class BuildConfigService < BaseProjectService class BuildConfigService < BaseProjectService
def execute def execute
return ServiceResponse.error(message: 'Insufficient permissions for dast_configuration keyword') unless allowed? return ServiceResponse.error(message: _('Insufficient permissions for dast_configuration keyword')) unless allowed?
build_config = { dast_site_profile: site_profile, dast_scanner_profile: scanner_profile } build_config = { dast_site_profile: site_profile, dast_scanner_profile: scanner_profile }
...@@ -42,7 +42,7 @@ module AppSec ...@@ -42,7 +42,7 @@ module AppSec
profile = yield(name).execute.first profile = yield(name).execute.first
unless can?(current_user, :read_on_demand_dast_scan, profile) unless can?(current_user, :read_on_demand_dast_scan, profile)
errors.push("DAST profile not found: #{name}") errors.push(_('DAST profile not found: %{name}') % { name: name })
return return
end end
......
...@@ -5,7 +5,7 @@ module AppSec ...@@ -5,7 +5,7 @@ module AppSec
module Profiles module Profiles
class CreateService < BaseContainerService class CreateService < BaseContainerService
def execute def execute
return ServiceResponse.error(message: 'Insufficient permissions') unless allowed? return ServiceResponse.error(message: _('Insufficient permissions')) unless allowed?
ApplicationRecord.transaction do ApplicationRecord.transaction do
@dast_profile = create_profile @dast_profile = create_profile
...@@ -89,7 +89,7 @@ module AppSec ...@@ -89,7 +89,7 @@ module AppSec
author: current_user, author: current_user,
scope: container, scope: container,
target: dast_profile, target: dast_profile,
message: "Added DAST profile" message: 'Added DAST profile'
) )
if schedule if schedule
......
...@@ -6,8 +6,8 @@ module AppSec ...@@ -6,8 +6,8 @@ module AppSec
class DestroyService < BaseContainerService class DestroyService < BaseContainerService
def execute def execute
return unauthorized unless allowed? return unauthorized unless allowed?
return ServiceResponse.error(message: 'Profile parameter missing') unless dast_profile return ServiceResponse.error(message: _('Profile parameter missing')) unless dast_profile
return ServiceResponse.error(message: 'Profile failed to delete') unless dast_profile.destroy return ServiceResponse.error(message: _('Profile failed to delete')) unless dast_profile.destroy
create_audit_event create_audit_event
...@@ -22,7 +22,7 @@ module AppSec ...@@ -22,7 +22,7 @@ module AppSec
def unauthorized def unauthorized
ServiceResponse.error( ServiceResponse.error(
message: 'You are not authorized to update this profile', message: _('You are not authorized to update this profile'),
http_status: 403 http_status: 403
) )
end end
...@@ -37,7 +37,7 @@ module AppSec ...@@ -37,7 +37,7 @@ module AppSec
author: current_user, author: current_user,
scope: container, scope: container,
target: dast_profile, target: dast_profile,
message: "Removed DAST profile" message: 'Removed DAST profile'
) )
end end
end end
......
...@@ -8,7 +8,7 @@ module AppSec ...@@ -8,7 +8,7 @@ module AppSec
def execute def execute
return unauthorized unless allowed? return unauthorized unless allowed?
return error('Profile parameter missing') unless dast_profile return error(_('Profile parameter missing')) unless dast_profile
build_auditors! build_auditors!
...@@ -79,7 +79,7 @@ module AppSec ...@@ -79,7 +79,7 @@ module AppSec
end end
def unauthorized def unauthorized
error('You are not authorized to update this profile', http_status: 403) error(_('You are not authorized to update this profile'), http_status: 403)
end end
def dast_profile def dast_profile
......
...@@ -10301,6 +10301,9 @@ msgstr "" ...@@ -10301,6 +10301,9 @@ msgstr ""
msgid "DAST Scans" msgid "DAST Scans"
msgstr "" msgstr ""
msgid "DAST profile not found: %{name}"
msgstr ""
msgid "DNS" msgid "DNS"
msgstr "" msgstr ""
...@@ -18305,6 +18308,9 @@ msgstr "" ...@@ -18305,6 +18308,9 @@ msgstr ""
msgid "Insufficient permissions" msgid "Insufficient permissions"
msgstr "" msgstr ""
msgid "Insufficient permissions for dast_configuration keyword"
msgstr ""
msgid "Integration" msgid "Integration"
msgstr "" msgstr ""
...@@ -26065,12 +26071,18 @@ msgstr "" ...@@ -26065,12 +26071,18 @@ msgstr ""
msgid "Profile Settings" msgid "Profile Settings"
msgstr "" msgstr ""
msgid "Profile failed to delete"
msgstr ""
msgid "Profile image guideline" msgid "Profile image guideline"
msgstr "" msgstr ""
msgid "Profile page:" msgid "Profile page:"
msgstr "" msgstr ""
msgid "Profile parameter missing"
msgstr ""
msgid "ProfileSession|on" msgid "ProfileSession|on"
msgstr "" msgstr ""
...@@ -38916,6 +38928,9 @@ msgstr "" ...@@ -38916,6 +38928,9 @@ msgstr ""
msgid "You are not authorized to perform this action" msgid "You are not authorized to perform this action"
msgstr "" msgstr ""
msgid "You are not authorized to update this profile"
msgstr ""
msgid "You are not authorized to update this scanner profile" msgid "You are not authorized to update this scanner profile"
msgstr "" msgstr ""
......
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