1
0
mirror of https://github.com/goharbor/harbor.git synced 2026-10-23 10:08:57 +03:00

fix: correct grammar and typos in user-facing error messages (#23818)

Fix misspellings, grammatical errors, and formatting defects in
user-facing strings across API error responses and the portal
English i18n.

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>
This commit is contained in:
Wang Yan
2026-09-02 10:22:18 +08:00
committed by GitHub
parent fb4e240674
commit ed449fbfc0
15 changed files with 85 additions and 81 deletions

View File

@@ -70,7 +70,7 @@ func TestUnmarshalJSONWithACCUnknownType(t *testing.T) {
var artifact []Artifact
err := json.Unmarshal(data, &artifact)
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "accessory type not support")
assert.Contains(t, err.Error(), `unsupported accessory type ""`)
}
func TestUnmarshalJSONWithoutACC(t *testing.T) {

View File

@@ -89,7 +89,7 @@ func (d *driver) Validate(hardLimits types.ResourceList) error {
for resource, value := range hardLimits {
if !resources[resource] {
return fmt.Errorf("resource %s not support", resource)
return fmt.Errorf("resource %s is not supported", resource)
}
if err := lib.ValidateQuotaLimit(value); err != nil {

View File

@@ -88,7 +88,7 @@ func filterAccess(ctx context.Context, access []*token.ResourceActions,
ctl project.Controller, filters map[string]accessFilter) error {
secCtx, ok := security.FromContext(ctx)
if !ok {
return fmt.Errorf("failed to get security context from request")
return fmt.Errorf("failed to get security context from request")
}
var err error
for _, a := range access {

View File

@@ -202,7 +202,7 @@ func (g generalCreator) Create(r *http.Request) (*models.Token, error) {
ctx, ok := security.FromContext(r.Context())
if !ok {
return nil, fmt.Errorf("failed to get security context from request")
return nil, fmt.Errorf("failed to get security context from request")
}
// for docker login

View File

@@ -330,11 +330,11 @@ func (c *Configuration) validate() error {
}
if c.PoolConfig == nil {
return errors.New("no worker worker is configured")
return errors.New("no worker is configured")
}
if c.PoolConfig.Backend != JobServicePoolBackendRedis {
return fmt.Errorf("worker worker backend %s does not support", c.PoolConfig.Backend)
return fmt.Errorf("worker backend %s is not supported", c.PoolConfig.Backend)
}
// When backend is redis

View File

@@ -96,7 +96,7 @@ func New(typ string, opt ...Option) (Cache, error) {
factory, ok := factories[typ]
if !ok {
return nil, fmt.Errorf("cache type %s not support", typ)
return nil, fmt.Errorf("cache type %s is not supported", typ)
}
return factory(opts)

View File

@@ -67,7 +67,7 @@ func (t *AuthModeType) validate(str string) error {
if str == common.LDAPAuth || str == common.DBAuth || str == common.UAAAuth || str == common.HTTPAuth || str == common.OIDCAuth {
return nil
}
return fmt.Errorf("invalid %s, shoud be one of %s, %s, %s, %s, %s",
return fmt.Errorf("invalid %s, should be one of %s, %s, %s, %s, %s",
common.AUTHMode, common.DBAuth, common.LDAPAuth, common.UAAAuth, common.HTTPAuth, common.OIDCAuth)
}

View File

@@ -135,7 +135,7 @@ func New(typ string, data AccessoryData) (Accessory, error) {
factory, ok := factories[typ]
if !ok {
return nil, fmt.Errorf("accessory type %s not support", typ)
return nil, fmt.Errorf("unsupported accessory type %q", typ)
}
data.Type = typ
@@ -150,7 +150,7 @@ func ToAccessory(acc []byte) (Accessory, error) {
}
factory, ok := factories[data.Type]
if !ok {
return nil, errors.Errorf("accessory type %s not support", data.Type)
return nil, errors.Errorf("unsupported accessory type %q", data.Type)
}
return factory(data), nil
}

View File

@@ -23,7 +23,7 @@ var (
errListNamespaceResp = errors.New("[VolcengineCR adapt] ListNamespaces resp nil")
errListRepositoriesResp = errors.New("[VolcengineCR adapt] ListRepositories resp nil")
errListTagsResp = errors.New("[VolcengineCR adapt] ListTags resp nil")
errPareseDigest = errors.New("[VolcengineCR adapt] fail to parse reference")
errPareseDigest = errors.New("[VolcengineCR adapt] failed to parse reference")
errNilVolcCrClient = errors.New("[volcengine-cr.createRepository] nil volcCr client")
)

View File

@@ -46,14 +46,14 @@
},
"BATCH": {
"DELETED_SUCCESS": "Deleted successfully",
"DELETED_FAILURE": "Deleted failed or partly failed",
"DELETED_FAILURE": "Delete failed or partially failed",
"REPLICATE_SUCCESS": "Started successfully",
"STOP_SUCCESS": "Stop successfully",
"STOP_SUCCESS": "Stopped successfully",
"TIME_OUT": "Gateway time-out"
},
"TOOLTIP": {
"NAME_FILTER": "Filter the name of the resource. Leave empty or use '**' to match all. 'library/**' only matches resources under 'library'. For more patterns, please refer to the user guide.",
"TAG_FILTER": "Filter the tag/version part of the resources. Leave empty or use '**' to match all. '1.0*' only matches the tags that starts with '1.0'. For more patterns, please refer to the user guide.",
"TAG_FILTER": "Filter the tag/version part of the resources. Leave empty or use '**' to match all. '1.0*' only matches the tags that start with '1.0'. For more patterns, please refer to the user guide.",
"LABEL_FILTER": "Filter the resources according to labels.",
"RESOURCE_FILTER": "Filter the type of resources.",
"PUSH_BASED": "Push the resources from the local Harbor to the remote registry.",
@@ -84,11 +84,11 @@
"OIDC_ENDPOINT_FORMAT": "Endpoint must start with HTTPS://.",
"OIDC_NAME": "The name of the OIDC provider.",
"OIDC_ENDPOINT": "The URL of an OIDC-compliant server.",
"OIDC_SCOPE": "The scope sent to OIDC server during authentication. It has to contain “openid”, and “offline_access”. If you are using google, please remove “offline_access” from this field.",
"OIDC_SCOPE": "The scope sent to OIDC server during authentication. It has to contain “openid”, and “offline_access”. If you are using google, please remove “offline_access” from this field.",
"OIDC_VERIFYCERT": "Uncheck this box if your OIDC server is hosted via self-signed certificate.",
"OIDC_AUTOONBOARD": "Skip the onboarding screen, so user cannot change its username. Username is provided from ID Token",
"OIDC_AUTOONBOARD": "Skip the onboarding screen after user is authenticated via OIDC endpoint, so the user cannot change their username. The username is provided from the ID Token.",
"OIDC_USER_CLAIM": "The name of the claim in the ID Token where the username is retrieved from. If not specified, it will default to 'name'",
"NEW_SECRET": "The secret must longer than 8 chars with at least 1 uppercase letter, 1 lowercase letter and 1 number",
"NEW_SECRET": "The secret must be longer than 8 characters with at least 1 uppercase letter, 1 lowercase letter and 1 number.",
"OIDC_LOGOUT": "Logs the user out of their current session with the Identity Provider."
},
"PLACEHOLDER": {
@@ -122,8 +122,8 @@
"NEW_SECRET": "Secret",
"CONFIRM_SECRET": "Re-enter Secret",
"GENERATE_SUCCESS": "Cli secret setting is successful",
"GENERATE_ERROR": "Cli secret setting is failed",
"CONFIRM_TITLE_CLI_GENERATE": "Are you sure you can regenerate secret?",
"GENERATE_ERROR": "Failed to set CLI secret",
"CONFIRM_TITLE_CLI_GENERATE": "Are you sure you want to regenerate the secret?",
"CONFIRM_BODY_CLI_GENERATE": "If you regenerate cli secret, the old cli secret will be discarded"
},
"CHANGE_PWD": {
@@ -196,7 +196,7 @@
"ITEMS": "items",
"OF": "of",
"RESET_OK": "Users password reset successfully",
"EXISTING_PASSWORD": "The new password can not be same with the old one",
"EXISTING_PASSWORD": "The new password cannot be the same as the old one",
"UNKNOWN": "Unknown",
"UNKNOWN_TIP": "Please verify whether the user has admin status through the Identity Provider System if the value is \"Unknown\""
},
@@ -216,7 +216,7 @@
"PUBLIC_PROJECTS": "Public Projects",
"PROJECT": "Project",
"NEW_PROJECT": "New Project",
"NAME_TOOLTIP": "Project name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"NAME_TOOLTIP": "Project name should be 1~255 characters long with lower case characters, numbers and ._- and must start with characters or numbers.",
"NAME_IS_REQUIRED": "Project name is required.",
"NAME_ALREADY_EXISTS": "Project name already exists.",
"UNKNOWN_ERROR": "An unknown error occurred while creating the project.",
@@ -327,7 +327,7 @@
"SET_ROLE": "Set Role",
"REMOVE": "Remove",
"GROUP_NAME_REQUIRED": "Group name is required",
"NON_EXISTENT_GROUP": "Group name does not exists",
"NON_EXISTENT_GROUP": "Group name does not exist",
"GROUP_ALREADY_ADDED": "Group name has been already added to this project"
},
"ROBOT_ACCOUNT": {
@@ -349,9 +349,9 @@
"PULL": "Pull",
"FILTER_PLACEHOLDER": "Filter Robot Accounts",
"ACCOUNT_EXISTING": "Robot Account already exists.",
"ALERT_TEXT": "This is the only time to copy this secret.You won't have another opportunity",
"ALERT_TEXT": "This is the only time to copy this secret. You won't have another opportunity.",
"CREATED_SUCCESS": "Created '{{param}}' successfully.",
"COPY_SUCCESS": "Copy secret successfully of '{{param}}'",
"COPY_SUCCESS": "Copied secret of '{{param}}' successfully",
"DELETION_TITLE": "Confirm removal of robot accounts",
"DELETION_SUMMARY": "Do you want to delete robot accounts {{param}}?",
"EXPORT_TO_FILE": "export to file",
@@ -420,12 +420,12 @@
"EDIT_WEBHOOK": "Edit Webhook",
"ADD_WEBHOOK": "Add Webhook",
"EDIT_WEBHOOK_DESC": "Specify the endpoint for receiving webhook notifications",
"VERIFY_REMOTE_CERT_TOOLTIP": "Determine whether the webhook should verify the certificate of a remote url Uncheck this box when the remote url uses a self-signed or untrusted certificate.",
"VERIFY_REMOTE_CERT_TOOLTIP": "Determine whether the webhook should verify the certificate of a remote URL. Uncheck this box when the remote URL uses a self-signed or untrusted certificate.",
"ENDPOINT_URL": "Endpoint URL",
"URL_IS_REQUIRED": "Endpoint URL is required.",
"AUTH_HEADER": "Auth Header",
"VERIFY_REMOTE_CERT": "Verify Remote Certificate",
"ENABLED_WEBHOOK_TITLE": "Enable Webhook",
"ENABLED_WEBHOOK_TITLE": "Enable Webhook",
"ENABLED_WEBHOOK_SUMMARY": "Do you want to enable webhook {{name}}?",
"DISABLED_WEBHOOK_TITLE": "Deactivate Webhook",
"DISABLED_WEBHOOK_SUMMARY": "Do you want to deactivate webhook {{name}}?",
@@ -519,7 +519,7 @@
"MONTH": "Month",
"DAY_MONTH": "Day of month",
"DAY_WEEK": "Day of week",
"CRON_TITLE": "Pattern description for cron '* * * * * *'.The cron string is based on UTC time",
"CRON_TITLE": "Pattern description for cron '* * * * * *'. The cron string is based on UTC time",
"FIELD_NAME": "Field name",
"MANDATORY": "Mandatory?",
"ALLOWED_VALUES": "Allowed values",
@@ -596,8 +596,8 @@
"ITEMS": "items",
"CREATED_SUCCESS": "Created replication rule successfully.",
"UPDATED_SUCCESS": "Updated replication rule successfully.",
"DELETED_SUCCESS": "Deleted replications rule successfully.",
"DELETED_FAILED": "Deleted replications rule failed.",
"DELETED_SUCCESS": "Deleted replication rules successfully.",
"DELETED_FAILED": "Deleting replication rules failed.",
"TOGGLED_SUCCESS": "Toggled replication rule status successfully.",
"CANNOT_EDIT": "Replication rule cannot be changed while it is enabled.",
"INVALID_DATE": "Invalid date.",
@@ -617,12 +617,12 @@
"REPLICATE": "Replicate",
"DELETE_REMOTE_IMAGES": "Delete remote resources when locally deleted",
"NEW": "New",
"NAME_TOOLTIP": "replication rule name should be at least 2 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"DESTINATION_NAME_TOOLTIP": "Destination name should be at least 2 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"NAME_TOOLTIP": "Replication rule name should be at least 2 characters long with lower case characters, numbers and ._- and must start with characters or numbers.",
"DESTINATION_NAME_TOOLTIP": "Destination name should be at least 2 characters long with lower case characters, numbers and ._- and must start with characters or numbers.",
"REPLI_MODE": "Replication mode",
"SOURCE_REGISTRY": "Source registry",
"DEST_REGISTRY": "Destination registry",
"NAMESPACE_TOOLTIP": "Namespace name should be at least 2 characters long with lower case characters, numbers and ._-/ and must be start with characters or numbers.",
"NAMESPACE_TOOLTIP": "Namespace name should be at least 2 characters long with lower case characters, numbers and ._-/ and must start with characters or numbers.",
"TAG": "Tag",
"LABEL": "Label",
"RESOURCE": "Resource",
@@ -637,14 +637,14 @@
"DES_REPO_FLATTENING": "Destination Repository Flattening",
"NAMESPACE": "Namespace",
"REPO_FLATTENING": "Flattening",
"NO_FLATTING": "No Flatting",
"NO_FLATTING": "No Flattening",
"FLATTEN_LEVEL_1": "Flatten 1 Level",
"FLATTEN_LEVEL_2": "Flatten 2 Levels",
"FLATTEN_LEVEL_3": "Flatten 3 Levels",
"FLATTEN_ALL": "Flatten All Levels",
"FLATTEN_LEVEL_TIP": "Reduce the nested repository structure when copying images. Assuming that the nested repository structure is 'a/b/c/d/img' and the destination namespace is 'ns', the corresponding results of each item are as below:",
"FLATTEN_LEVEL_TIP_ALL": "'Flatten All Levels'(Used prior v2.3): 'a/b/c/d/img' -> 'ns/img'",
"FLATTEN_LEVEL_TIP_NO": "'No Flatting': 'a/b/c/d/img' -> 'ns/a/b/c/d/img",
"FLATTEN_LEVEL_TIP_NO": "'No Flattening': 'a/b/c/d/img' -> 'ns/a/b/c/d/img'",
"FLATTEN_LEVEL_TIP_1": "'Flatten 1 Level'(Default): 'a/b/c/d/img' -> 'ns/b/c/d/img'",
"FLATTEN_LEVEL_TIP_2": "'Flatten 2 Levels': 'a/b/c/d/img' -> 'ns/c/d/img'",
"FLATTEN_LEVEL_TIP_3": "'Flatten 3 Levels': 'a/b/c/d/img' -> 'ns/d/img'",
@@ -653,7 +653,7 @@
"BANDWIDTH_TOOLTIP": "Set the maximum network bandwidth for each replication worker. Please pay attention to the number of concurrent executions (max. {{max_job_workers}}). For unlimited bandwidth, please enter -1.",
"UNLIMITED": "Unlimited",
"UNREACHABLE_SOURCE_REGISTRY": "Failed to connect to the source registry, please make sure the source registry is available before editing this rule: {{error}}",
"CRON_ERROR_TIP": "The 1st field of the cron string must be 0 and the 2nd filed can not be \"*\"",
"CRON_ERROR_TIP": "The 1st field of the cron string must be 0 and the 2nd field cannot be \"*\"",
"COPY_BY_CHUNK": "Copy by chunk",
"COPY_BY_CHUNK_TIP": "Specify whether to copy the blob by chunk. Transfer by chunk may increase the number of API requests.",
"TRIGGER_STOP_SUCCESS": "Triggered stopping execution successfully",
@@ -685,7 +685,7 @@
"CREATED_SUCCESS": "Created endpoint successfully.",
"UPDATED_SUCCESS": "Updated endpoint successfully.",
"DELETED_SUCCESS": "Deleted endpoints successfully.",
"DELETED_FAILED": "Deleted endpoints failed.",
"DELETED_FAILED": "Deleting endpoints failed.",
"CANNOT_EDIT": "Endpoint cannot be changed while the replication rule is enabled.",
"PLACEHOLDER": "We couldn't find any endpoints!",
"CA_CERTIFICATE": "CA Certificate",
@@ -737,7 +737,7 @@
"IMAGE": "Images",
"LABELS": "Labels",
"ADD_LABEL_TO_IMAGE": "Add labels to this image",
"FILTER_ARTIFACT_BY_LABEL": "Filter actifact by label",
"FILTER_ARTIFACT_BY_LABEL": "Filter artifacts by label",
"ADD_LABELS": "Add Labels",
"STOP": "Stop",
"RETAG": "Copy",
@@ -809,12 +809,12 @@
"ROOT_CERT": "Registry Root Certificate",
"ROOT_CERT_LINK": "Download",
"REGISTRY_CERTIFICATE": "Registry certificate",
"NO_CHANGE": "Save abort because nothing changed",
"NO_CHANGE": "Save aborted because nothing changed",
"SKIP_SCANNER_PULL_TIME": "Retain Image \"last pull time\" On Scanning",
"TOOLTIP": {
"SELF_REGISTRATION_ENABLE": "Enable sign up.",
"SELF_REGISTRATION_DISABLE": "Deactivate sign up.",
"VERIFY_REMOTE_CERT": "Determine whether the image replication should verify the certificate for a remote registry. Uncheck this box when skip verify remote registry endpoint cert.",
"VERIFY_REMOTE_CERT": "Determine whether the image replication should verify the certificate for a remote registry. Uncheck this box to skip verifying remote registry endpoint certificate.",
"AUTH_MODE": "By default the authentication mode is database, i.e. the credentials are stored in a local database. Set it to LDAP if you want to verify a user's credential against an LDAP server.",
"PRIMARY_AUTH_MODE": "This auth mode becomes the default way for users to login. The login screen where the user selects to login via the identity provider or via local DB will automatically redirect the user to this identity provider. Login via DB is possible when visiting the url '/account/sign-in' explicitly.",
"LDAP_SEARCH_DN": "A user's DN who has the permission to search the LDAP/AD server. If your LDAP/AD server does not support anonymous search, you should configure this DN and ldap_search_pwd.",
@@ -822,8 +822,8 @@
"LDAP_UID": "The attribute used in a search to match a user. It could be uid, cn, email, sAMAccountName or other attributes depending on your LDAP/AD.",
"LDAP_SCOPE": "The scope to search for users.",
"TOKEN_EXPIRATION": "The expiration time (in minutes) of a token created by the token service. Default is 30 minutes.",
"ROBOT_NAME_PREFIX": "Prefixed string for each robot name,and default value is 'robot$'",
"ROBOT_TOKEN_EXPIRATION": "The expiration time (in days) of the token of the robot account, Default is 30 days. Show the number of days converted from minutes and rounds down",
"ROBOT_NAME_PREFIX": "Prefixed string for each robot name, and the default value is 'robot$'",
"ROBOT_TOKEN_EXPIRATION": "The expiration time (in days) of the token of the robot account. Default is 30 days. Shows the number of days converted from minutes, rounded down",
"PRO_CREATION_RESTRICTION": "The flag to define what users have permission to create projects. By default, everyone can create a project. Set to 'Admin Only' so that only an administrator can create a project.",
"ROOT_CERT_DOWNLOAD": "Download the root certificate of registry.",
"SCANNING_POLICY": "Set image scanning policy based on different requirements. 'None': No active policy; 'Daily At': Triggering scanning at the specified time everyday.",
@@ -883,19 +883,19 @@
"OIDC_AUTOONBOARD": "Automatic onboarding",
"USER_CLAIM": "Username Claim",
"OIDC_SETNAME": "Set OIDC Username",
"OIDC_SETNAMECONTENT": "You must create a Harbor username the first time when authenticating via a third party(OIDC).This will be used within Harbor to be associated with projects, roles, etc.",
"OIDC_SETNAMECONTENT": "You must create a Harbor username the first time when authenticating via a third party (OIDC). This will be used within Harbor to be associated with projects, roles, etc.",
"OIDC_USERNAME": "Username",
"GROUP_CLAIM_NAME": "Group Claim Name",
"GROUP_CLAIM_NAME_INFO": "The name of a custom group claim that you have configured in your OIDC provider",
"OIDC_ADMIN_GROUP": "OIDC Admin Group",
"OIDC_ADMIN_GROUP_INFO": "Specify an OIDC admin group name. All OIDC users in this group will have harbor admin privilege. Keep it blank if you do not want to.",
"OIDC_GROUP_FILTER": "OIDC Group Filter",
"OIDC_GROUP_FILTER_INFO": "Filter OIDC groups who match the provided regular expression.Keep it blank to match all the groups.",
"OIDC_GROUP_FILTER_INFO": "Filter OIDC groups who match the provided regular expression. Keep it blank to match all the groups.",
"OIDC_LOGOUT": "OIDC Session Logout"
},
"SCANNING": {
"STOP_SCAN_ALL_SUCCESS": "Trigger stopping scan all successfully!",
"TRIGGER_SCAN_ALL_SUCCESS": "Trigger scan all successfully!",
"STOP_SCAN_ALL_SUCCESS": "Triggered stopping scan all successfully!",
"TRIGGER_SCAN_ALL_SUCCESS": "Triggered scan all successfully!",
"TRIGGER_SCAN_ALL_FAIL": "Failed to trigger scan all with error: {{error}}",
"TITLE": "Vulnerability Scanning",
"SCAN_ALL": "Scan All",
@@ -984,7 +984,7 @@
"DOWNLOAD": "Download SBOM",
"Details": "SBOM details",
"STOP": "Stop Generate SBOM",
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
"TRIGGER_STOP_SUCCESS": "Triggered stopping SBOM generation successfully"
},
"VULNERABILITY": {
"STATE": {
@@ -1035,7 +1035,7 @@
"SCAN_BY": "SCAN BY {{scanner}}",
"REPORTED_BY": "Reported by {{scanner}}",
"NO_SCANNER": "NO SCANNER",
"TRIGGER_STOP_SUCCESS": "Trigger stopping scan successfully",
"TRIGGER_STOP_SUCCESS": "Triggered stopping scan successfully",
"STOP_NOW": "Stop Scan Vulnerability"
},
"PUSH_IMAGE": {
@@ -1087,7 +1087,7 @@
"SHOW_YAML": "YAML File"
},
"TAG": {
"CREATION_TIME_PREFIX": "Create on",
"CREATION_TIME_PREFIX": "Created on",
"CREATOR_PREFIX": "by",
"ANONYMITY": "anonymity",
"IMAGE_DETAILS": "Image Details",
@@ -1105,7 +1105,7 @@
"FILTER_FOR_TAGS": "Filter Tags",
"AUTHOR": "Author",
"LABELS": "Labels",
"CREATION": "Create on",
"CREATION": "Created on",
"COMMAND": "Commands",
"UPLOADTIME": "Upload Time",
"NAME": "Name",
@@ -1197,7 +1197,7 @@
},
"UNKNOWN_ERROR": "Unknown errors have occurred. Please try again later.",
"UNAUTHORIZED_ERROR": "Your session is invalid or has expired. You need to sign in to continue your action.",
"REPO_READ_ONLY": "Harbor is set to read-only mode, Deleting repository, artifact, tag and pushing image will be deactivated under read-only mode.",
"REPO_READ_ONLY": "Harbor is set to read-only mode. Deleting repositories, artifacts, and tags, and pushing images are disabled in read-only mode.",
"FORBIDDEN_ERROR": "You do not have the proper privileges to perform the action.",
"GENERAL_ERROR": "Errors have occurred when performing service call: {{param}}.",
"BAD_REQUEST_ERROR": "We are unable to perform your action because of a bad request.",
@@ -1228,7 +1228,7 @@
"CRON": "cron",
"ON": "on",
"AT": "at",
"NOSCHEDULE": "An error occurred in Get schedule"
"NOSCHEDULE": "An error occurred while getting the schedule"
},
"GC": {
"CURRENT_SCHEDULE": "Schedule to GC",
@@ -1252,8 +1252,8 @@
},
"RETAG": {
"MSG_SUCCESS": "Copy artifact successfully",
"TIP_REPO": "A repository name is broken up into path components. A component of a repository name must be at least one lowercase, alpha-numeric characters, optionally separated by periods, dashes or underscores. More strictly, it must match the regular expression [a-z0-9]+(?:[._-][a-z0-9]+)*.If a repository name has two or more path components, they must be separated by a forward slash ('/').The total length of a repository name, including slashes, must be less the 256 characters.",
"TIP_TAG": "A tag is a label applied to a Docker image in a repository. Tags are how various images in a repository are distinguished from each other.It need to match Regex: (`[\\w][\\w.-]{0,127}`)"
"TIP_REPO": "A repository name is broken up into path components. A component of a repository name must be at least one lowercase, alpha-numeric characters, optionally separated by periods, dashes or underscores. More strictly, it must match the regular expression [a-z0-9]+(?:[._-][a-z0-9]+)*. If a repository name has two or more path components, they must be separated by a forward slash ('/'). The total length of a repository name, including slashes, must be less than 256 characters.",
"TIP_TAG": "A tag is a label applied to a Docker image in a repository. Tags are how various images in a repository are distinguished from each other. It needs to match regex: (`[\\w][\\w.-]{0,127}`)"
},
"CVE_ALLOWLIST": {
"DEPLOYMENT_SECURITY": "Deployment security",
@@ -1285,7 +1285,7 @@
"RULE_NAME_5": " always",
"ADD_RULE": "ADD RULE",
"ADD_RULE_HELP_1": "Click the ADD RULE button to add a rule.",
"ADD_RULE_HELP_2": "Tag retention polices run once a day.",
"ADD_RULE_HELP_2": "Tag retention policies run once a day.",
"RETENTION_RUNS": "Retention runs",
"RUN_NOW": "RUN NOW",
"WHAT_IF_RUN": "DRY RUN",
@@ -1398,7 +1398,7 @@
"NAME": "Name",
"NAME_EXISTS": "Name already exists",
"NAME_REQUIRED": "Name is required",
"NAME_REX": "Name should be at least 2 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"NAME_REX": "Name should be at least 2 characters long with lower case characters, numbers and ._- and must start with characters or numbers.",
"DESCRIPTION": "Description",
"SBOM": "SBOM",
"VULNERABILITY": "Vulnerability",
@@ -1511,7 +1511,7 @@
"DISABLE_FAILED": "Deactivating instance(s) failed",
"UPDATE_SUCCESS": "Instance updated successfully",
"UPDATE_FAILED": "Updating instance failed",
"REQUEST_PREHEAT_SUCCESS": "Preheat request successfully",
"REQUEST_PREHEAT_SUCCESS": "Preheat requested successfully",
"REQUEST_PREHEAT_FAILED": "Preheat request failed",
"DESCRIPTION": "Description",
"AUTH_MODE": "Auth Mode",
@@ -1588,7 +1588,7 @@
"TYPE": "Type",
"TASKS": "Tasks",
"TASKS_PLACEHOLDER": "We couldn't find any task",
"SEVERITY_WARNING": "Vulnerability settings here conflicts with the relevant project configuration that will override the settings here",
"SEVERITY_WARNING": "Vulnerability settings here conflict with the relevant project configuration that will override the settings here",
"REPOS": "Repositories",
"TAGS": "Tags",
"CRITERIA": "Criteria",
@@ -1602,7 +1602,7 @@
"MANUAL": "Manual",
"SCHEDULED": "Scheduled",
"EVENT_BASED": "Event based",
"EVENT_BASED_EXPLAIN_LINE1": "The policy will be evaluated whenever the following events are occurred:",
"EVENT_BASED_EXPLAIN_LINE1": "The policy will be evaluated whenever the following events occur:",
"EVENT_BASED_EXPLAIN_LINE2": "Artifact is pushed",
"EVENT_BASED_EXPLAIN_LINE3": "Artifact is labeled",
"EVENT_BASED_EXPLAIN_LINE4": "Artifact is scanned",
@@ -1612,7 +1612,7 @@
"UPDATED_SUCCESSFULLY": "Updated policy successfully",
"EXECUTIONS": "Executions",
"TAG_SEPARATOR": "Enter multiple comma separated tags,tag*,or **",
"CONTENT_WARNING": "Content trust settings here conflicts with the relevant project configuration that will override the settings here",
"CONTENT_WARNING": "Content trust settings here conflict with the relevant project configuration that will override the settings here",
"PREHEAT_EXPLAIN": "Preheat will migrate the image to the p2p network",
"CRITERIA_EXPLAIN": "As specified in 'Deployment security' section under Configuration tab",
"SKIP_CERT_VERIFY": "Check this box to skip certificate verification when the remote provider uses a self-signed or untrusted certificate.",
@@ -1650,7 +1650,7 @@
"NEW_TOKEN": "New Secret",
"REFRESH": "REFRESH",
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"PROJECTS_MODAL_SUMMARY": "These are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover permissions for the system as well as for specific projects",
"EDIT_ROBOT": "Edit System Robot Account",
@@ -1681,14 +1681,14 @@
"CONFIRM_SECRET": "Confirm Secret",
"SECRET_AGAIN": "Input secret again",
"INCONSISTENT": "Two secrets are inconsistent",
"NAME_TOOLTIP": "Robot name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"NAME_TOOLTIP": "Robot name should be 1~255 characters long with lower case characters, numbers and ._- and must start with characters or numbers.",
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
"DELETE": "Delete",
"ARTIFACT_LABEL": "Artifact label",
"SCAN": "Scan",
"SCANNER_PULL": "Scanner Pull",
"SEARCH_BY_NAME": "Search by name(without prefix)",
"FINAL_PROJECT_NAME_TIP": "The final project robot name consists of the prefix,the project name,a plus mark and the current input value",
"FINAL_PROJECT_NAME_TIP": "The final project robot name consists of the prefix, the project name, a plus mark, and the current input value",
"FINAL_SYSTEM_NAME_TIP": "The final system robot name consists of the prefix and the current input value",
"PUSH_AND_PULL": "Push",
"PUSH_PERMISSION_TOOLTIP": "Push permission can not work alone, it must work with pull permission",
@@ -1731,7 +1731,7 @@
"INCLUDED_OPERATION_TOOLTIP": "Remove audit logs for the selected operations",
"INCLUDED_OPERATION_ERROR": "Please select at least one operation",
"INCLUDED_EVENT_TYPES": "Event types to purge",
"INCLUDED_EVENT_TYPE_TOOLTIP": "Remove audit logs for the selected event types, checkbox \"Other events\" include all events not listed here ",
"INCLUDED_EVENT_TYPE_TOOLTIP": "Remove audit logs for the selected event types, the \"Other events\" checkbox includes all events not listed here",
"INCLUDED_EVENT_TYPE_ERROR": "Please select at least one event type",
"PURGE_NOW": "PURGE NOW",
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
@@ -1743,9 +1743,9 @@
"ENABLE_AUDIT_LOG_EVENT_TYPE_TOOLTIP": "The comma-separated name of the audit log event to be enabled.",
"AUDIT_LOG_EVENT_TYPE_EMPTY": "No audit log event type exists.",
"SKIP_DATABASE": "Skip Audit Log Database",
"SKIP_DATABASE_TOOLTIP": "Skip to log audit log in the database, only available when audit log forward endpoint is configured",
"STOP_GC_SUCCESS": "Trigger stopping GC operation successfully",
"STOP_PURGE_SUCCESS": "Trigger stopping purging operation successfully",
"SKIP_DATABASE_TOOLTIP": "Skip logging audit logs in the database; only available when audit log forward endpoint is configured",
"STOP_GC_SUCCESS": "Triggered stop of GC operation successfully",
"STOP_PURGE_SUCCESS": "Triggered stop of purging operation successfully",
"NO_GC_RECORDS": "We couldn't find any GC histories!",
"NO_PURGE_RECORDS": "We couldn't find any purge histories!"
},
@@ -1760,7 +1760,7 @@
"JOB_NAME": "Job Name",
"JOB_NAME_REQUIRED": "Job name is required",
"JOB_NAME_EXISTING": "Job name already exists",
"TRIGGER_EXPORT_SUCCESS": "Trigger exporting CVEs successfully!"
"TRIGGER_EXPORT_SUCCESS": "Triggered exporting CVEs successfully!"
},
"JOB_SERVICE_DASHBOARD": {
"SCHEDULE_PAUSED": "Scheduled(Paused)",

View File

@@ -45,7 +45,7 @@ func (m *memberAPI) CreateProjectMember(ctx context.Context, params operation.Cr
return m.SendError(ctx, err)
}
if params.ProjectMember == nil {
return m.SendError(ctx, errors.BadRequestError(nil).WithMessage("the project member should provide"))
return m.SendError(ctx, errors.BadRequestError(nil).WithMessage("the project member should be provided"))
}
req, err := toMemberReq(params.ProjectMember)
if err != nil {

View File

@@ -73,19 +73,19 @@ func (p *purgeAPI) CreatePurgeSchedule(ctx context.Context, params purge.CreateP
func verifyCreateRequest(params purge.CreatePurgeScheduleParams) error {
if params.Schedule == nil || params.Schedule.Schedule == nil {
return errors.BadRequestError(fmt.Errorf("schedule cann't be empty"))
return errors.BadRequestError(fmt.Errorf("schedule cannot be empty"))
}
if len(params.Schedule.Parameters) == 0 {
return errors.BadRequestError(fmt.Errorf("schedule parameter cann't be empty"))
return errors.BadRequestError(fmt.Errorf("schedule parameter cannot be empty"))
}
if _, exist := params.Schedule.Parameters[common.PurgeAuditRetentionHour]; !exist {
return errors.BadRequestError(fmt.Errorf("audit_retention_hour should provide"))
return errors.BadRequestError(fmt.Errorf("audit_retention_hour should be provided"))
}
if _, err := retentionHour(params.Schedule.Parameters); err != nil {
return err
}
if _, exist := params.Schedule.Parameters[common.PurgeAuditIncludeEventTypes]; !exist {
return errors.BadRequestError(fmt.Errorf("include_event_types should provide"))
return errors.BadRequestError(fmt.Errorf("include_event_types should be provided"))
}
return nil
}
@@ -301,19 +301,19 @@ func (p *purgeAPI) UpdatePurgeSchedule(ctx context.Context, params purge.UpdateP
func verifyUpdateRequest(params purge.UpdatePurgeScheduleParams) error {
if params.Schedule == nil || params.Schedule.Schedule == nil {
return errors.BadRequestError(fmt.Errorf("schedule cann't be empty"))
return errors.BadRequestError(fmt.Errorf("schedule cannot be empty"))
}
if len(params.Schedule.Parameters) == 0 {
return errors.BadRequestError(fmt.Errorf("schedule parameter cann't be empty"))
return errors.BadRequestError(fmt.Errorf("schedule parameter cannot be empty"))
}
if _, exist := params.Schedule.Parameters[common.PurgeAuditRetentionHour]; !exist {
return errors.BadRequestError(fmt.Errorf("audit_retention_hour should provide"))
return errors.BadRequestError(fmt.Errorf("audit_retention_hour should be provided"))
}
if _, err := retentionHour(params.Schedule.Parameters); err != nil {
return err
}
if _, exist := params.Schedule.Parameters[common.PurgeAuditIncludeEventTypes]; !exist {
return errors.BadRequestError(fmt.Errorf("include_event_types should provide"))
return errors.BadRequestError(fmt.Errorf("include_event_types should be provided"))
}
return nil
}

View File

@@ -184,7 +184,7 @@ func (r *retentionAPI) CreateRetention(ctx context.Context, params operation.Cre
return r.SendError(ctx, errors.BadRequestError(err))
}
default:
return r.SendError(ctx, errors.BadRequestError(fmt.Errorf("scope %s is not support", p.Scope.Level)))
return r.SendError(ctx, errors.BadRequestError(fmt.Errorf("scope %s is not supported", p.Scope.Level)))
}
old, err := r.proMetaMgr.Get(ctx, p.Scope.Reference, "retention_id")

View File

@@ -50,6 +50,10 @@ func newScanDataExportAPI() *scanDataExportAPI {
}
}
const (
defaultScanDataExportErrorStatusText = "The export job failed without reporting a reason; check the jobservice logs for details."
)
type scanDataExportAPI struct {
BaseAPI
scanDataExportCtl scandataexport.Controller
@@ -143,7 +147,7 @@ func (se *scanDataExportAPI) GetScanDataExportExecution(ctx context.Context, par
}
// add human friendly message when status is error
if sdeExec.Status == job.ErrorStatus.String() && sdeExec.StatusText == "" {
sdeExec.StatusText = "Please contact the system administrator to check the logs of jobservice."
sdeExec.StatusText = defaultScanDataExportErrorStatusText
}
return operation.NewGetScanDataExportExecutionOK().WithPayload(&sdeExec)
@@ -240,7 +244,7 @@ func (se *scanDataExportAPI) GetScanDataExportExecutionList(ctx context.Context,
}
// add human friendly message when status is error
if sdeExec.Status == job.ErrorStatus.String() && sdeExec.StatusText == "" {
sdeExec.StatusText = "Please contact the system administrator to check the logs of jobservice."
sdeExec.StatusText = defaultScanDataExportErrorStatusText
}
// store project ids
for _, pid := range execution.ProjectIDs {

View File

@@ -355,7 +355,7 @@ func (suite *ScanExportTestSuite) TestGetScanDataExportExecution() {
url := "/export/cve/execution/100"
endTime := time.Now()
startTime := endTime.Add(-10 * time.Minute)
defaultStatusMessage := "Please contact the system administrator to check the logs of jobservice."
defaultStatusMessage := defaultScanDataExportErrorStatusText
customizeStatusMessage := "No vulnerabilities found or matched"
execution := &export.Execution{
@@ -587,7 +587,7 @@ func (suite *ScanExportTestSuite) TestGetScanDataExportExecutionList() {
url.RawQuery = params.Encode()
endTime := time.Now()
startTime := endTime.Add(-10 * time.Minute)
defaultStatusMessage := "Please contact the system administrator to check the logs of jobservice."
defaultStatusMessage := defaultScanDataExportErrorStatusText
customizeStatusMessage := "No vulnerabilities found or matched"
execution := &export.Execution{