You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generated identifiers and access tokens should follow standard practice, and their character set settings should be read robustly:
Draw characters with secrets.choice (the standard library's module for tokens) instead of random.choice in generate_id().
Read the character set settings (endpoints.repository.id_charset, endpoints.user.uid_charset, endpoints.access_token.charset) with a fixed lookup of named character sets (e.g., string.ascii_lowercase, string.digits) plus literal characters, instead of eval. The current forms keep working: lists such as [string.ascii_lowercase, string.digits, '.', '-'] (as in the image's configuration), strings such as string.ascii_lowercase + string.digits + '.' + '-', single names, and literal characters.
Check these settings at start, and stop with an error naming the setting if one can't be used (unknown name, wrong type, no character left for the start and end of values).
Document the settings in the configuration reference and the upgrade notes.
Activity
fix: address Sourcery review findings