{"record":{"id":"a8c87f51c4232470","repo":"influxdata/influxdb","slug":"invalid-resource-name-0","errorCode":null,"errorMessage":"invalid resource name {0}","messagePattern":"invalid resource name (.+?)","errorType":"error_code","errorClass":"ResourceMappingError","httpStatus":null,"severity":"error","filePath":"influxdb3_authz/src/permissions.rs","lineNumber":34,"sourceCode":"pub const AUTHZ_CREATE_DB_ACTION: &str = \"create\";\npub const AUTHZ_DESCRIBE_DB_ACTION: &str = \"describe\";\npub const AUTHZ_WRITE_DB_ACTION: &str = \"write\";\npub const AUTHZ_READ_DB_ACTION: &str = \"read\";\n\npub const AUTHZ_DELETE_ROW_ACTION: &str = \"delete\";\n\npub const AUTHZ_CREATE_CRUD_ACTION: &str = \"create\";\npub const AUTHZ_READ_CRUD_ACTION: &str = \"read\";\npub const AUTHZ_UPDATE_CRUD_ACTION: &str = \"update\";\npub const AUTHZ_DELETE_CRUD_ACTION: &str = \"delete\";\n\npub const AUTHZ_WILDCARD: &str = \"*\";\n\n#[derive(Debug, Error)]\npub enum ResourceMappingError {\n    #[error(\"resource type not supported {0}\")]\n    ResourceTypeNotSupported(String),\n    #[error(\"invalid resource name {0}\")]\n    InvalidResourceName(String),\n    #[error(\"mixed wildcard (*) and resource name\")]\n    MixedWildcardAndRegularResourceName,\n    #[error(\"missing resource name {0}\")]\n    MissingResourceName(String),\n    #[error(\"action not supported, {0}\")]\n    ActionNotSupported(String),\n    #[error(\"missing resource id {0}\")]\n    MissingResourceId(String),\n}\n\npub trait ResourceNameToIdProvider {\n    fn resource_name_to_id(\n        &self,\n        resource_type: ResourceType,\n        names: &[String],\n    ) -> Result<ResourceIdentifier, ResourceMappingError>;\n}","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_authz/src/permissions.rs#L16-L52","documentation":"ResourceMappingError::InvalidResourceName is thrown when a resource name string fails validation during conversion from a name to a resource identifier. The name is syntactically or semantically invalid for the permission mapping layer, distinct from a name that simply does not resolve.","triggerScenarios":"Passing a malformed resource name to the ResourceNameToIdProvider-based mapping functions used when constructing token permissions.","commonSituations":"Hand-written permission specs with misspelled resource names; whitespace or stray characters in configured resource names; copying names from another InfluxDB edition with a different naming scheme.","solutions":["Validate the resource name spelling and formatting against expected resource naming (alphanumeric/identifier rules).","Use the wildcard \"*\" explicitly if all resources of the type are intended, rather than a made-up name.","Log/inspect the offending string in the error payload and correct it in the permission configuration."],"exampleFix":"// before\nlet perm = resource_name(\"db 1 main\"); // invalid\n// after\nlet perm = resource_name(\"db1_main\");","handlingStrategy":"validation","validationCode":"fn is_valid_resource_name(name: &str) -> bool {\n    !name.is_empty() && name.chars().all(|c| c.is_alphanumeric() || c == '_' || c == '-')\n}","typeGuard":null,"tryCatchPattern":"match map_resource_name(name) {\n    Ok(id) => id,\n    Err(ResourceMappingError::InvalidResourceName(n)) => bail!(\"invalid resource name: {n}\"),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Trim and normalize resource names before mapping","Copy resource names from API responses instead of typing them by hand","Add unit tests covering every configured resource name"],"tags":["authz","permissions","validation"],"backgroundTag":"invalid-identifier-format","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}