UploaderStrategy still requires api_secret if parameter was already added externally
@yakirp đang làm issue này rồi.
Từ ngày 7/5/2018.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
This issue affects all current http artifacts:
https://github.com/cloudinary/cloudinary_java/blob/090788607f1b92f895b7b79c67e1e628719666c6/cloudinary-http42/src/main/java/com/cloudinary/http42/UploaderStrategy.java#L45-L49
Compared to the implementation on cloudinary-android:
if (requiresSigning(action, options)) {
String apiKey = ObjectUtils.asString(options.get("api_key"), this.cloudinary().config.apiKey);
if (apiKey == null)
throw new IllegalArgumentException("Must supply api_key");
if (options.containsKey("signature") && options.containsKey("timestamp")) {
params.put("timestamp", options.get("timestamp"));
params.put("signature", options.get("signature"));
params.put("api_key", apiKey);
} else {
String apiSecret = ObjectUtils.asString(options.get("api_secret"), this.cloudinary().config.apiSecret);
if (apiSecret == null)
throw new IllegalArgumentException("Must supply api_secret");
params.put("timestamp", Long.valueOf(System.currentTimeMillis() / 1000L).toString());
params.put("signature", this.cloudinary().apiSignRequest(params, apiSecret));
params.put("api_key", apiKey);
}
}
Cloudinary Android Source: https://github.com/cloudinary/cloudinary_android/blob/f7a0b32cfd9f2b6507bb6461043e6c89d9478c03/lib/src/main/java/com/cloudinary/android/UploaderStrategy.java#L43-L59
My suggestion is to implement that for each http artifact or simply refactor the android implementation upwards to the core AbstractUploaderStrategy.
This allows cloudinary-java users to not have to enter api_secret if say the signature is generated via other microservices/authorization servers. This also allows easier server-side integration tests.
While I understand the audience for cloudinary-java is more towards server users where the secret key is most likely exposed within a monolithic service, the two reasons above are currently forcing us to mangle a separate UploaderStrategy which simply use the above Android part instead.
- Ngôn ngữ chính
- Java
- Star
- 176
- Fork
- 113
- Merge trung bình
- 9 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không 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 cloudinary/cloudinary_java
-
`options` map modified directlyCó thể làm lại được @adimiz1 đã nhận 481 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_java#383 · 3 bình luận · 1 reaction · 1 người được giao ·
-
Api#resourceByAssetID does not support same options as in documentationCó thể làm lại được @adimiz1 đã nhận 646 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_java#357 · 2 bình luận · 1 người được giao ·
-
Readme - Maven dependencyCó thể làm lại được @adimiz1 đã nhận 754 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_java#349 · 1 bình luận · 1 người được giao ·
-
cloudinary-http5 ignores system propertiesCó thể làm lại được @adimiz1 đã nhận 754 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_java#348 · 2 bình luận · 1 người được giao ·
-
Make usage of http clients (apache, OkHttp, Jetty, Asynch) easierCó thể làm lại được @ManishS6 đã nhận 772 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
cloudinary/cloudinary_java#343 · 6 bình luận ·
Tất cả issue của cloudinary/cloudinary_java
Issue tương tự
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted textCó thể đã có người làm @Bhumit267 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation typeCó thể đã có người làm @Carbon14-48 đã nhận hôm nay. Đang mởapproved
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
checkstyle/checkstyle#22784 · 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 74/100
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 62/100
ASSERT-KTH/depclean#591 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Api537FlareFlameModel.setStackHeightM accepts a negative heightCó thể đã có người làm @EvenSol đã nhận hôm nay. Đang mở
Độ 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