{"record":{"id":"624b4f031e0ae6f7","repo":"goharbor/harbor","slug":"invalid-s-should-be-s-or-s","errorCode":null,"errorMessage":"invalid %s, should be %s or %s","messagePattern":"invalid (.+?), should be (.+?) or (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/config/metadata/type.go","lineNumber":81,"sourceCode":"\tStringType\n}\n\nfunc (t *AuthModeType) validate(str string) error {\n\tif str == common.LDAPAuth || str == common.DBAuth || str == common.UAAAuth || str == common.HTTPAuth || str == common.OIDCAuth {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"invalid %s, shoud be one of %s, %s, %s, %s, %s\",\n\t\tcommon.AUTHMode, common.DBAuth, common.LDAPAuth, common.UAAAuth, common.HTTPAuth, common.OIDCAuth)\n}\n\n// ProjectCreationRestrictionType ...\ntype ProjectCreationRestrictionType struct {\n\tStringType\n}\n\nfunc (t *ProjectCreationRestrictionType) validate(str string) error {\n\tif !(str == common.ProCrtRestrAdmOnly || str == common.ProCrtRestrEveryone) {\n\t\treturn fmt.Errorf(\"invalid %s, should be %s or %s\",\n\t\t\tcommon.ProjectCreationRestriction,\n\t\t\tcommon.ProCrtRestrAdmOnly,\n\t\t\tcommon.ProCrtRestrEveryone)\n\t}\n\treturn nil\n}\n\n// IntType ..\ntype IntType struct {\n}\n\nfunc (t *IntType) validate(str string) error {\n\t_, err := parseInt(str)\n\treturn err\n}\n\nfunc (t *IntType) get(str string) (any, error) {\n\treturn parseInt(str)","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/lib/config/metadata/type.go#L63-L99","documentation":"Error \"invalid %s, should be %s or %s\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/lib/config/metadata/type.go:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}