msgraph-sdk-python-core icon indicating copy to clipboard operation
msgraph-sdk-python-core copied to clipboard

NationalClouds are wrongly prefixed

Open Acurisu opened this issue 5 months ago • 1 comments

Describe the bug

NationalClouds is defined in https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/e54022acf0b0779ad471d324dae460175408d2c3/src/msgraph_core/_enums.py#L33-L43 where all values are prefixed by https,

however, since we pass them as allowed hosts to the AzureIdentityAuthenticationProvider by default in https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/e54022acf0b0779ad471d324dae460175408d2c3/src/msgraph_core/authentication/azure_identity_authentication_provider.py#L22

they are fed to the AllowedHostsValidator which in https://github.com/microsoft/kiota-python/blob/b23edcbf268efdb81d14ef59cecc6c9565288248/packages/abstractions/kiota_abstractions/authentication/allowed_hosts_validator.py#L20 raises an exception if they are prefixed.

Expected behavior

The validator should either strip the urls or the enum should be updated.

How to reproduce

Instantiate an AzureIdentityAuthenticationProvider with default allowed hosts.

SDK Version

1.3.3

Latest version known to work for scenario above?

No response

Known Workarounds

Pass allowed_hosts manually.

Debug output

No response

Configuration

No response

Other information

No response

Acurisu avatar May 13 '25 20:05 Acurisu

If the opinion is that the validator should be updated then this issue of course belongs to the corresponding repository.

Acurisu avatar May 13 '25 20:05 Acurisu

Can this be fixed one way or the other? I had to hardcode allowed_hosts=['graph.microsoft.com', 'graph.microsoft.us'] in a constructor call because of this bug.

tidux avatar Sep 03 '25 17:09 tidux