def create_anon_client(self, endpoint, **kwargs):
     authority = get_authority(endpoint)
     audience = get_audience(authority)
     return ContainerRegistryClient(endpoint=endpoint,
                                    credential=None,
                                    audience=audience,
                                    **kwargs)
Пример #2
0
 async def test_construct_container_registry_client(self, containerregistry_endpoint):
     authority = get_authority(containerregistry_endpoint)
     credential = self.get_credential(authority)
     
     client = ContainerRegistryClient(endpoint=containerregistry_endpoint, credential=credential, audience="https://microsoft.com")
     with pytest.raises(ClientAuthenticationError):
         properties = await client.get_repository_properties(HELLO_WORLD)
 def create_registry_client(self, endpoint, **kwargs):
     authority = get_authority(endpoint)
     audience = kwargs.pop("audience", None)
     if not audience:
         audience = get_audience(authority)
     credential = self.get_credential(authority=authority)
     return ContainerRegistryClient(endpoint=endpoint,
                                    credential=credential,
                                    audience=audience,
                                    **kwargs)