Function scratchstack_aws_principal::validate_path[][src]

pub fn validate_path<S: Into<String>>(path: S) -> Result<String, PrincipalError>

Verify that a path meets AWS requirements.

The AWS requirements for a path specify:

  • The path must contain between 1 and 512 characters.
  • The path must start and end with /.
  • All characters in the path must be in the ASCII range 0x21 (!) through 0x7E (~). The AWS documentation erroneously indicates that 0x7F (DEL) is acceptable; however, the IAM APIs reject this character.

If path meets these requirements, it is returned. Otherwise, a PrincipalError::InvalidPath error is returned.