apollo-client-python icon indicating copy to clipboard operation
apollo-client-python copied to clipboard

401错误

Open kinglf opened this issue 4 years ago • 1 comments

当config_url 为 https://dev.apollo.com/config-dev 时, get_value会报401.

给header增加加签需求

def _signHeaders(self, url):
    headers = {}
    if self.secret == '':
        return headers
    # 不合理处
    uri = url[len(self.config_url):len(url)]
    time_unix_now = str(int(round(time.time() * 1000)))
    headers['Authorization'] = 'Apollo ' + self.app_id + ':' + signature(time_unix_now, uri, self.secret)
    headers['Timestamp'] = time_unix_now
    return headers

kinglf avatar Jan 24 '22 08:01 kinglf

401 是不是权限不足

xhrg avatar Mar 07 '23 08:03 xhrg