We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This code:
apiKey = str(current_app.config['ALGOLIA_API_KEY']) restrictions = dict({ 'userToken': str(userId) }) key = SearchClientSync.generate_secured_api_key(apiKey,restrictions)
Fails with the error Error Message: 'dict' object has no attribute 'encode'
Error Message: 'dict' object has no attribute 'encode'
Which, when looking in your code I notice:
secured_key = hmac.new( parent_api_key.encode(encoding="utf-8"), query_parameters.encode(encoding="utf-8"), hashlib.sha256, ).hexdigest()
Where it's expecting a dict object to have the encode method, which it does not.
This is your API documentation:
public_key = SearchClient.generate_secured_api_key( 'YourSearchOnlyApiKey', {'userToken': 'user_42'} )
Note that when I switch this argument to a string, it works, supposedly:
apiKey = str(current_app.config['ALGOLIA_API_KEY']) restrictions = str({ 'userToken': str(userId) }) key = SearchClientSync.generate_secured_api_key(apiKey,restrictions)
The documentation is pretty misleading or out of date.
Search
4.11.2
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
This code:
Fails with the error
Error Message: 'dict' object has no attribute 'encode'
Which, when looking in your code I notice:
Where it's expecting a dict object to have the encode method, which it does not.
This is your API documentation:
Note that when I switch this argument to a string, it works, supposedly:
The documentation is pretty misleading or out of date.
Client
Search
Version
4.11.2
Relevant log output
No response
The text was updated successfully, but these errors were encountered: