How to use the azure-cosmosdb-table.azure.cosmosdb.table.common._common_conversion._sign_string function in azure-cosmosdb-table

To help you get started, we’ve selected a few azure-cosmosdb-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-cosmos-table-python / azure-cosmosdb-table / azure / cosmosdb / table / common / _auth.py View on Github external
def _add_authorization_header(self, request, string_to_sign):
        try:
            signature = _sign_string(self.account_key, string_to_sign)
            auth_string = 'SharedKey ' + self.account_name + ':' + signature
            request.headers['Authorization'] = auth_string
        except Exception as ex:
            # Wrap any error that occurred as signing error
            # Doing so will clarify/locate the source of problem
            raise _wrap_exception(ex, AzureSigningError)
github Azure / azure-cosmos-table-python / azure-cosmosdb-table / azure / cosmosdb / table / common / sharedaccesssignature.py View on Github external
get_value_to_append(_QueryStringConstants.SIGNED_VERSION))

        if service == 'blob' or service == 'file':
            string_to_sign += \
                (get_value_to_append(_QueryStringConstants.SIGNED_CACHE_CONTROL) +
                 get_value_to_append(_QueryStringConstants.SIGNED_CONTENT_DISPOSITION) +
                 get_value_to_append(_QueryStringConstants.SIGNED_CONTENT_ENCODING) +
                 get_value_to_append(_QueryStringConstants.SIGNED_CONTENT_LANGUAGE) +
                 get_value_to_append(_QueryStringConstants.SIGNED_CONTENT_TYPE))

        # remove the trailing newline
        if string_to_sign[-1] == '\n':
            string_to_sign = string_to_sign[:-1]

        self._add_query(_QueryStringConstants.SIGNED_SIGNATURE,
                        _sign_string(account_key, string_to_sign))
github Azure / azure-cosmos-table-python / azure-cosmosdb-table / azure / cosmosdb / table / common / sharedaccesssignature.py View on Github external
return_value = self.query_dict.get(query) or ''
            return return_value + '\n'

        string_to_sign = \
            (account_name + '\n' +
             get_value_to_append(_QueryStringConstants.SIGNED_PERMISSION) +
             get_value_to_append(_QueryStringConstants.SIGNED_SERVICES) +
             get_value_to_append(_QueryStringConstants.SIGNED_RESOURCE_TYPES) +
             get_value_to_append(_QueryStringConstants.SIGNED_START) +
             get_value_to_append(_QueryStringConstants.SIGNED_EXPIRY) +
             get_value_to_append(_QueryStringConstants.SIGNED_IP) +
             get_value_to_append(_QueryStringConstants.SIGNED_PROTOCOL) +
             get_value_to_append(_QueryStringConstants.SIGNED_VERSION))

        self._add_query(_QueryStringConstants.SIGNED_SIGNATURE,
                        _sign_string(account_key, string_to_sign))

azure-cosmosdb-table

Microsoft Azure CosmosDB Table Client Library for Python

Apache-2.0
Latest version published 5 years ago

Package Health Score

55 / 100
Full package analysis

Popular azure-cosmosdb-table functions

Similar packages