Skip to content

Conversation

@ianbotsf
Copy link
Contributor

Issue #

(none)

Description of changes

This change adds validation for caller-provided regions specified in client config, such as region and regionProvider. The validation ensures the region is suitable to use in a URI hostname according to RFC 3986 § 3.2.2. Valid characters for regions now include:

  • URI unreserved characters:
    • Uppercase letters (A through Z)
    • Lowercase letters (a through z)
    • Digits (0 through 9)
    • Hyphen (-)
    • Period/dot (.)
    • Tilde (~)
    • Underscore (_)
  • Percent (%)
  • URI sub-delimiters
    • Ampersand (&)
    • Apostrophe (')
    • Asterisk (*)
    • Comma (,)
    • Dollar sign ($)
    • Equals sign (=)
    • Exclamation point (!)
    • Parentheses (( and ))
    • Plus (+)
    • Semicolon (;)

Notable characters which are invalid for regions include:

  • Space ( )
  • At sign (@)
  • Backtick/grave (`)
  • Braces ({ and })
  • Brackets ([ and ])
  • Caret (^)
  • Colon (:)
  • Double quote (")
  • Hash/number sign (#)
  • Inequality signs (< and >)
  • Pipe (|)
  • Question mark (?)
  • Slashes (/ and \)
  • All non-ASCII characters (e.g., Unicode characters)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ianbotsf ianbotsf requested a review from a team as a code owner November 21, 2025 23:15
@github-actions
Copy link

A new generated diff is ready to view.

Copy link
Contributor

@0marperez 0marperez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice documentation/comments throughout the PR👍

@github-actions
Copy link

A new generated diff is ready to view.

@ianbotsf ianbotsf merged commit 57bb93c into main Nov 24, 2025
21 checks passed
@ianbotsf ianbotsf deleted the feat-validate-region branch November 24, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants