Should we make SslOptions be more explicit about where it loads certifications?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc SslOptions.java quanh dòng 245 và theo dõi cách các đường dẫn chứng chỉ hiện được phân giải. So sánh các trường hợp classpath và file URI tường minh trong issue với hành vi fallback hiện có, sau đó xác nhận các quy tắc tương thích dự kiến và bổ sung coverage cho các đường dẫn phân giải đã thống nhất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I'm not sure I like the default fallback behavior here:
Instead I recommend something more like:
static InputStream getResource(
String path)
throws FileNotFoundException, IOException {
URI uri = URI.create(path);
/*
* Explicit
*/
if ("classpath".equals(uri.getScheme())) {
var classpath = uri.getPath();
if (classpath == null) {
throw new FileNotFoundException(path);
}
return getClasspathResource(classpath);
}
if ("file".equals(uri.getScheme())) {
return Files.newInputStream(Path.of(uri));
}
/*
* Implicit
*/
Path filepath = Paths.get(path);
if (Files.exists(filepath)) {
// absolute file:
return Files.newInputStream(filepath);
}
// Maybe do not do this
return getClasspathResource(path);
}
This is where classpath:/// and file:/// can be explicitly used and then if that is not used we do the original behavior with the eventual goal of not doing the classpath unless it has the classpath uri schema.
The reason is assume I package a certification in the classpath. It works normally. Then someone adds a classpath on the filesystem when I go deploy. It now overrides the classpath one.
Now I admit this is unlikely and if this was not certs I could care less but I think we should not go around sniffing for certs. It also seems more inline with how we no longer use the service loader. That is less implicit behavior.
Otherwise I mostly don't care but just think this is the right thing to do.
- Ngôn ngữ chính
- Java
- Star
- 1.8k
- Fork
- 202
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 6
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 jooby-project/jooby
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
jooby-project/jooby#3996 ·
-
bug web-server
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
jooby-project/jooby#3995 ·
-
Add Jooby CLI to SDKMAN Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
jooby-project/jooby#3521 · 2 bình luận ·
-
jooby-1.x are broken Đang mởquestion
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
jooby-project/jooby#1513 · 10 bình luận ·
Tất cả issue của jooby-project/jooby
Issue tương tự
-
Bug Java Platform: Java
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsentry/sentry-java#6138 · 1 bình luận ·
-
bug needs triage p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 bình luận ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/rocketmq-dashboard#4654 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100