Skip to content

NationalClouds are wrongly prefixed #917

@Acurisu

Description

@Acurisu

Describe the bug

NationalClouds is defined in

class NationalClouds(str, Enum):
"""Enumerated list of supported sovereign clouds"""
China = 'https://microsoftgraph.chinacloudapi.cn'
Germany = 'https://graph.microsoft.de'
Global = 'https://graph.microsoft.com'
US_DoD = 'https://dod-graph.microsoft.us'
US_GOV = 'https://graph.microsoft.us'
def __str__(self):
return self.value
where all values are prefixed by https,

however, since we pass them as allowed hosts to the AzureIdentityAuthenticationProvider by default in

allowed_hosts: list[str] = [nc.value for nc in NationalClouds]

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions