Make JsonMasker load mask keys from jars and be thread-safe
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
Start in JsonMasker: the singleton INSTANCE() double-checked locking, the INSTANCE(Set) key loading via Files.readAllLines(Path.of(uri)), and mask(..) are all in the same class. Change resource loading to URL.openStream(), replace the TreeSet with a concurrent set, skip blank lines, and handle non-JSON byte[] and nested arrays in mask(..). Add tests that load META-INF/mask.keys from a jar plus cases for blank keys, byte[] input and arrays inside arrays; done when the existing directory-based tests still pass alongside the new ones.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
JsonMasker loads the keys to mask from META-INF/mask.keys resources using Files.readAllLines(Path.of(uri)). For a resource inside a jar (for example a fat jar deployed to AWS Lambda) the jar: URI cannot be converted to a Path unless a zip file system is already open, so loading fails, a warning is logged and the key set stays empty. As a result nothing is masked in packaged deployments. The existing tests do not notice because their mask.keys is loaded from a directory.
Related problems in the same class:
- the singleton field is not volatile, so the double-checked locking in
INSTANCE()does not guarantee safe publication - the set of keys is a plain
TreeSetthat is modified byINSTANCE(Set)while other threads may be reading it inmask(..) - a blank line in
mask.keysregisters an empty string as a key mask(..)throwsClassCastExceptionfor abyte[]input that is not JSON- an array nested directly inside an array is not searched for keys to mask
Proposed change:
- read the resources with
URL.openStream()so that they also work from jars - create the instance with a holder class and keep the keys in a concurrent set
- skip blank entries
- return the text for non-JSON
byte[]input - mask keys in nested arrays
- add tests for loading keys from a jar and for the cases above
Public method signatures stay the same.
- Ngôn ngữ chính
- Java
- Star
- 1.1k
- Fork
- 655
- Merge trung bình
- 4 giờ 54 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của spring-cloud/spring-cloud-function
-
ClassCastException with spring-cloud-function 4.3.6 when a field of type Set is deserializedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
spring-cloud/spring-cloud-function#1542 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invokerCó thể đã có người làm @zemiles đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 32/100
spring-cloud/spring-cloud-function#1544 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
spring-cloud/spring-cloud-function#1538 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Kotlin function wrapper treats empty input as no inputCó thể đã có người làm @seonwooj0810 đã nhận hôm nay. Đang mở5.0.x backport bug
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 30/100
spring-cloud/spring-cloud-function#1537 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Default JSON mapper collection limit is hard-coded and replaces all collection deserializationĐang mở5.0.x backport bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
spring-cloud/spring-cloud-function#1536 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của spring-cloud/spring-cloud-function
Issue tương tự
-
[FEAT] Lambda: support the nodejs26.x runtimeCó thể đã có người làm @lBroth đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
floci-io/floci#9392 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/camel-website#1872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
area/backend component/c8-api kind/task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug devops low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày