Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate Namespace Does Not Allow Whitespace, Which Is Allowed by EMF Spec #158

Open
ryandjoseph opened this issue Oct 3, 2024 · 1 comment

Comments

@ryandjoseph
Copy link

ryandjoseph commented Oct 3, 2024

The Validator#validateNamespace function uses the regex ^[a-zA-Z0-9._#:/-]+$, which does not allow whitespace in namespaces.

However, per CloudWatch docs:

Possible [namespace] characters are: alphanumeric characters (0-9A-Za-z), period (.), hyphen (-), underscore (_), forward slash (/), hash (#), colon (:), and the space character.

Changing this to ^[a-zA-Z0-9 ._#:/-]+$ would solve the problem.

This is an issue for me, as I am trying to upgrade an old codebase from version 1.0 to version 4.0, however we used (out of my control) a namespace with whitespace in it. To retain continuity, and not have to manually finagle with alarms, I'd like to see this changed to allow whitespace.

I can submit PR for this, but want to confirm if this deviation from CloudWatch standard was on purpose?

@gordonpn
Copy link
Member

Hey @ryandjoseph, thank you for raising this issue. The library is meant to stay as close as possible to what CloudWatch allows.

Please feel free to submit a PR with unit tests!

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

No branches or pull requests

2 participants