-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
feat: add file size and type restriction for local file uploads #6390
Conversation
application/src/main/resources/extensions/attachment-local-policy.yaml
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6390 +/- ##
============================================
+ Coverage 54.51% 58.15% +3.64%
- Complexity 3523 3770 +247
============================================
Files 646 651 +5
Lines 21862 22110 +248
Branches 1528 1555 +27
============================================
+ Hits 11917 12859 +942
+ Misses 9328 8628 -700
- Partials 617 623 +6 ☔ View full report in Codecov by Sentry. |
application/src/main/resources/extensions/attachment-local-policy.yaml
Outdated
Show resolved
Hide resolved
application/src/main/resources/extensions/attachment-local-policy.yaml
Outdated
Show resolved
Hide resolved
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.
/lgtm
Quality Gate passedIssues Measures |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ruibaby The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
/area core
What this PR does / why we need it:
本次 PR 为本地附件存储策略增加了对上传单文件大小和文件类型限制的功能,具体包括:
实现了对单个文件上传大小的验证功能,确保上传文件不超过设定的最大值。
添加了文件类型限制功能,使用 Apache Tika 读取上传文件的 magic numbers 得到文件 mime type 并根据用户配置来决定是否允许上传
参考链接:
Which issue(s) this PR fixes:
Fixes #6385
Does this PR introduce a user-facing change?