Example #1
0
    def from_config(cls, conf):
        access_key_id = get_default_client_id()
        secret_access_key = get_default_authentication_code()

        if None in (access_key_id, secret_access_key):
            raise ValueError(
                'Can\'t create azure client, credential is not configured')

        url = get_default_refresh_url()

        return cls(url,
                   aws_access_key_id=access_key_id,
                   aws_secret_access_key=secret_access_key)
Example #2
0
    def from_config(cls, conf='default', version=None):
        access_key_id = AZURE_ACCOUNTS['default'].CLIENT_ID.get()
        secret_access_key = AZURE_ACCOUNTS['default'].CLIENT_SECRET.get()

        if None in (access_key_id, secret_access_key):
            raise ValueError(
                'Can\'t create azure client, credential is not configured')

        url = get_default_refresh_url(version)

        return cls(url,
                   aws_access_key_id=access_key_id,
                   aws_secret_access_key=secret_access_key,
                   version=version)