UploaderStrategy still requires api_secret if parameter was already added externally
@yakirp arbeitet bereits daran.
Seit 07.5.2018.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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.
- Vorherrschende Sprache
- Java
- Sterne
- 176
- Forks
- 113
- Ø Merge
- 9 T. 20 Std.
- Gemergte PRs (30 T.)
- 2
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cloudinary/cloudinary_java
-
`options` map modified directlyEvtl. wieder frei @adimiz1 hat das vor 481 Tagen übernommen, und es ist kein Pull Request offen. Offen
cloudinary/cloudinary_java#383 · 3 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
-
Api#resourceByAssetID does not support same options as in documentationEvtl. wieder frei @adimiz1 hat das vor 646 Tagen übernommen, und es ist kein Pull Request offen. Offen
cloudinary/cloudinary_java#357 · 2 Kommentare · 1 zugewiesene Person ·
-
Readme - Maven dependencyEvtl. wieder frei @adimiz1 hat das vor 754 Tagen übernommen, und es ist kein Pull Request offen. Offen
cloudinary/cloudinary_java#349 · 1 Kommentar · 1 zugewiesene Person ·
-
cloudinary-http5 ignores system propertiesEvtl. wieder frei @adimiz1 hat das vor 754 Tagen übernommen, und es ist kein Pull Request offen. Offen
cloudinary/cloudinary_java#348 · 2 Kommentare · 1 zugewiesene Person ·
-
Make usage of http clients (apache, OkHttp, Jetty, Asynch) easierEvtl. wieder frei @ManishS6 hat das vor 772 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
cloudinary/cloudinary_java#343 · 6 Kommentare ·
Alle Issues in cloudinary/cloudinary_java
Ähnliche Issues
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted textEvtl. vergeben @Bhumit267 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation typeEvtl. vergeben @Carbon14-48 hat das heute übernommen. Offenapproved
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
checkstyle/checkstyle#22784 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ASSERT-KTH/depclean#591 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Api537FlareFlameModel.setStackHeightM accepts a negative heightEvtl. vergeben @EvenSol hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag