question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]ResourceIdentifier allows whitespace?!

See original GitHub issue

Library name and version

Azure.Core 1.32.0

Describe the bug

I’m using ResourceIdentifier.TryParse() to validate user input of a resource ID. Just noticed that this accepts resource IDs with whitespace in them. I believe this is a bug since those are not valid IDs?!

Samples which are not being caught by the validation:

"/subscriptions/7ddfffd7-9b32-40df-b352-828cbd55d6f4/resourceGroups/group-with spaces/providers/Microsoft.Network/publicIpAddresses/public-ip-nerd"

"/subscriptions/ 7ddfffd7-9b32-40df-b352-828cbd55d6f4/resourceGroups/group/providers/Microsoft.Network/publicIpAddresses/public-ip-nerd"

"/subscriptions/7ddfffd7-9b32-40df-b352-828cbd55d6f4/resourceGroups/groupwith\nnewline/providers/Microsoft.Network/publicIpAddresses/public-ip-nerd"

Was added in https://github.com/Azure/azure-sdk-for-net/pull/32039 by @m-nash

Expected behavior

Resource IDs with spaces anywhere in them should not pass validation.

Actual behavior

See above

Reproduction Steps

ResourceIdentifier.TryParse("/subscriptions/7ddfffd7-9b32-40df-b352-828cbd55d6f4/resourceGroups/group-with spaces/providers/Microsoft.Network/publicIpAddresses/public-ip-nerd", out var _);

Environment

dotnet 7

Issue Analytics

  • State:open
  • Created 2 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sebadercommented, Jul 27, 2023

No real case has been reported for this bug, so it’s not urgent. Put it on the backlog with low priority.

I am reporting a real case here 😉

0reactions
ArthurMa1978commented, Aug 2, 2023

No real case has been reported for this bug, so it’s not urgent. Put it on the backlog with low priority.

I am reporting a real case here 😉

I meant service return an arm-id like this, but anyway this is definitely a bug, @live1206 will follow up with this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regular expression to allow spaces between words
A string that leads and / or trails with spaces, " Hello World ". A string that contains multiple spaces in between words,...
Read more >
reStructuredText Markup Specification - Docutils - SourceForge
Indented literal blocks are indicated by indentation relative to the surrounding text (leading whitespace on each line). The minimum indentation will be removed ......
Read more >
MathML Fundamentals
In MathML, as in XML, "whitespace" means simple spaces, tabs, newlines, or carriage returns, i.e., characters with hexadecimal Unicode codes U+0020, U+0009, U+ ......
Read more >
How whitespace is handled by HTML, CSS, and in the DOM
Whitespace is any string of text composed only of spaces, tabs or line breaks (to be precise, CRLF sequences, carriage returns or line...
Read more >
Has whitespace in identifiers ever been idiomatic? [closed]
Whitespace is a language that seeks to redress the balance. Any non whitespace characters are ignored; only spaces, tabs and newlines are ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found