-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
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
Escape control characters #32
Comments
Just to be precise, kamaki needs to escape anything that can be semantically identified as metadata. If something is semantically considered raw content, it should not be modified by recipients. |
This should be reverted. If you need to display or log strings which may contain control characters, this must happen at the point where the strings are to be shown to the user, or logged. It doesn't make sense to modify the response so early in the ResponseManager. Finally, please review all instances of using "unicode_escape" that have been added after this commit. |
Refs grnet#32 Implement method escape_ctrl_chars Escape control characters in HTTP data logs Remove misleading separators from HTTP logs
Refs grnet#32 Implement method escape_ctrl_chars Escape control characters in HTTP data logs Remove misleading separators from HTTP logs
Refs grnet#32 Implement method escape_ctrl_chars Escape control characters in HTTP data logs Remove misleading separators from HTTP logs
Refs grnet#32 Implement method escape_ctrl_chars Escape control characters in HTTP data logs Remove misleading separators from HTTP logs
Refs grnet#32 Implement method escape_ctrl_chars Escape control characters in HTTP data logs Remove misleading separators from HTTP logs
Closes grnet#32 Kamaki CLI commands use some generic output methods to handle outputs. Generic output methods that escape control characters: - in kamaki.cli.utils: print_items, print_dict, print_list - in kamaki.cli.cmds: error Generic output methods that don't escape control characters: - in kamaki.cli.cmds: writeln, write The methods that don't escape control characters are used when the standard methods are not sufficient. For example, in "kamaki.cli.pithos" the "PithosAccount.print_objects" method adds decorative escape characters (i.e., bold, alignment), but has to escape the parts object and container names. To achieve this, escaping is handled in the method, and the output is printed with the "write" and "writeln" methods mentioned earlier. Also, fix flake8 errors on files affected by the above changes
Refs grnet#32 Implement method escape_ctrl_chars Escape control characters in HTTP data logs Remove misleading separators from HTTP logs
Closes grnet#32 Kamaki CLI commands use some generic output methods to handle outputs. Generic output methods that escape control characters: - in kamaki.cli.utils: print_items, print_dict, print_list - in kamaki.cli.cmds: error Generic output methods that don't escape control characters: - in kamaki.cli.cmds: writeln, write The methods that don't escape control characters are used when the standard methods are not sufficient. For example, in "kamaki.cli.pithos" the "PithosAccount.print_objects" method adds decorative escape characters (i.e., bold, alignment), but has to escape the parts object and container names. To achieve this, escaping is handled in the method, and the output is printed with the "write" and "writeln" methods mentioned earlier. Also, fix flake8 errors on files affected by the above changes
Refs grnet#32 Implement method escape_ctrl_chars Escape control characters in HTTP data logs Remove misleading separators from HTTP logs
Closes grnet#32 Kamaki CLI commands use some generic output methods to handle outputs. Generic output methods that escape control characters: - in kamaki.cli.utils: print_items, print_dict, print_list - in kamaki.cli.cmds: error Generic output methods that don't escape control characters: - in kamaki.cli.cmds: writeln, write The methods that don't escape control characters are used when the standard methods are not sufficient. For example, in "kamaki.cli.pithos" the "PithosAccount.print_objects" method adds decorative escape characters (i.e., bold, alignment), but has to escape the parts object and container names. To achieve this, escaping is handled in the method, and the output is printed with the "write" and "writeln" methods mentioned earlier. Also, fix flake8 errors on files affected by the above changes
Refs grnet#32 Implement method escape_ctrl_chars Escape control characters in HTTP data logs Remove misleading separators from HTTP logs
Closes grnet#32 Kamaki CLI commands use some generic output methods to handle outputs. Generic output methods that escape control characters: - in kamaki.cli.utils: print_items, print_dict, print_list - in kamaki.cli.cmds: error Generic output methods that don't escape control characters: - in kamaki.cli.cmds: writeln, write The methods that don't escape control characters are used when the standard methods are not sufficient. For example, in "kamaki.cli.pithos" the "PithosAccount.print_objects" method adds decorative escape characters (i.e., bold, alignment), but has to escape the parts object and container names. To achieve this, escaping is handled in the method, and the output is printed with the "write" and "writeln" methods mentioned earlier. An encoding issue with kamaki.cli.errors.CLIError and the Exceptions extending it, is fixed. It is now ensured that the error message will always me in unicode. Also, fix flake8 errors on files affected by the above changes
Closes grnet#32 Kamaki CLI commands use some generic output methods to handle outputs. Generic output methods that escape control characters: - in kamaki.cli.utils: print_items, print_dict, print_list - in kamaki.cli.cmds: error Generic output methods that don't escape control characters: - in kamaki.cli.cmds: writeln, write The methods that don't escape control characters are used when the standard methods are not sufficient. For example, in "kamaki.cli.pithos" the "PithosAccount.print_objects" method adds decorative escape characters (i.e., bold, alignment), but has to escape the parts object and container names. To achieve this, escaping is handled in the method, and the output is printed with the "write" and "writeln" methods mentioned earlier. An encoding issue with kamaki.cli.errors.CLIError and the Exceptions extending it, is fixed. It is now ensured that the error message will always me in unicode. Also, fix flake8 errors on files affected by the above changes
Closes grnet#32 Kamaki CLI commands use some generic output methods to handle outputs. Generic output methods that escape control characters: - in kamaki.cli.utils: print_items, print_dict, print_list - in kamaki.cli.cmds: error Generic output methods that don't escape control characters: - in kamaki.cli.cmds: writeln, write The methods that don't escape control characters are used when the standard methods are not sufficient. For example, in "kamaki.cli.pithos" the "PithosAccount.print_objects" method adds decorative escape characters (i.e., bold, alignment), but has to escape the parts object and container names. To achieve this, escaping is handled in the method, and the output is printed with the "write" and "writeln" methods mentioned earlier. An encoding issue with kamaki.cli.errors.CLIError and the Exceptions extending it, is fixed. It is now ensured that the error message will always be in unicode. Also, fix flake8 errors on files affected by the above changes
As discussed by @vkoukis some time ago, Kamaki should escape all control characters from data received by the user/server.
Here is a proof of concept demonstrating the problem:
I've tested this with servers/volumes/files and it works in all three of them, so I believe it's a global problem across Kamaki.
The text was updated successfully, but these errors were encountered: