{"record":{"id":"789bfcf1eabd04c1","repo":"influxdata/influxdb","slug":"role-description-exceeds-maximum-length-of-role-description","errorCode":null,"errorMessage":"role description exceeds maximum length of {ROLE_DESCRIPTION_MAX_LENGTH} characters","messagePattern":"role description exceeds maximum length of (.+?) characters","errorType":"validation","errorClass":"NewRoleDescriptionError","httpStatus":null,"severity":"error","filePath":"influxdb3_authz/src/role/role.rs","lineNumber":138,"sourceCode":"        }\n\n        Ok(Self(description.to_string()))\n    }\n\n    pub fn into_inner(self) -> String {\n        self.0\n    }\n\n    pub fn new_unchecked(description: String) -> Self {\n        Self(description)\n    }\n}\n\n#[derive(Debug, Clone, Error)]\npub enum NewRoleDescriptionError {\n    #[error(\"role description cannot be empty\")]\n    Empty,\n    #[error(\"role description exceeds maximum length of {ROLE_DESCRIPTION_MAX_LENGTH} characters\")]\n    TooLong,\n    #[error(\n        \"role description contains invalid characters: only alphanumeric and [{0}] are allowed\"\n    )]\n    InvalidCharacters(String),\n}\n\nfn format_allowed_chars(chars: &[char]) -> String {\n    chars\n        .iter()\n        .map(|c| format!(\"'{c}'\"))\n        .collect::<Vec<_>>()\n        .join(\", \")\n}\n","sourceCodeStart":120,"sourceCodeEnd":153,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_authz/src/role/role.rs#L120-L153","documentation":"NewRoleDescriptionError::TooLong, a validation guard in role.rs enforcing NewRoleDescription's ROLE_DESCRIPTION_MAX_LENGTH; it fires when constructing a role description from user-supplied input that exceeds the allowed character cap.","triggerScenarios":"Submitting a role description longer than ROLE_DESCRIPTION_MAX_LENGTH characters through role creation or update endpoints.","commonSituations":"Pasting long policy documents or runbooks into the description field; programmatic generation of verbose descriptions.","solutions":["Shorten the description to at most ROLE_DESCRIPTION_MAX_LENGTH characters","Move long documentation to external docs and keep a brief summary in the description","Truncate programmatically with the constant ROLE_DESCRIPTION_MAX_LENGTH before submitting"],"exampleFix":"// before\nlet desc = very_long_runbook_text; // > ROLE_DESCRIPTION_MAX_LENGTH\n// after\nlet desc: String = very_long_runbook_text.chars().take(ROLE_DESCRIPTION_MAX_LENGTH).collect();","handlingStrategy":"validation","validationCode":"const ROLE_DESCRIPTION_MAX_LENGTH: usize = 255; // confirm exact constant in influxdb3_authz/src/role/role.rs\nfn valid_role_description(desc: &str) -> bool {\n    desc.chars().count() <= ROLE_DESCRIPTION_MAX_LENGTH\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Truncate or summarize long text before assigning it to a role description","Keep role descriptions short; link to external docs for details","Enforce max length in UI text areas with a character counter"],"tags":["validation","role-management","rust"],"backgroundTag":"value-out-of-range","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"}