-
Notifications
You must be signed in to change notification settings - Fork 3.7k
add authentication to DownloadAction #91
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
Conversation
lingbin
commented
Sep 13, 2017
- use cluster_id as token;
- add dir limit, only files in data dir can be accessed.
1. use cluster_id as token; 2. add dir limit, only files in data dir can be accessed.
be/src/common/config.h
Outdated
| CONF_Bool(disable_kudu, "false") | ||
|
|
||
| // to forward compatibility, will be removed later | ||
| CONF_Bool(disable_deprecated_download, "false"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个配置名字不好,应该直接说明你做的是什么。比如在1年后,download模型可能更新多次了,而这个配置选项看名字都不知道在干嘛了。
另外,安全功能默认应该是开启的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改成enable_token_check了
be/src/http/download_action.cpp
Outdated
|
|
||
| Status DownloadAction::check_path(const std::string& file_path) { | ||
| for (auto& allow_path : _allow_paths) { | ||
| VLOG_ROW << "allow path: " << allow_path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this debug log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
be/src/util/filesystem_util.cc
Outdated
| boost::filesystem::path sub(sub_path); | ||
| parent = parent.lexically_normal(); | ||
| sub = sub.lexically_normal(); | ||
| VLOG_ROW << "parent lexically_normal: " << parent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove debug log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
be/src/util/filesystem_util.cc
Outdated
| parent = parent.lexically_normal(); | ||
| sub = sub.lexically_normal(); | ||
| VLOG_ROW << "parent lexically_normal: " << parent; | ||
| VLOG_ROW << "sub lexically_normal: " << sub; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove debug log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.