Skip to content

Commit 486ebea

Browse files
authored
Add support for remote signature authentication (#95)
* First swing at remote signature authentication * Restored the legacy async API in the Java SDK * Update .gitignore * Add live assembly integration test and .env-aware Docker harness * Revert "Restored the legacy async API in the Java SDK" This reverts commit 7431f71. * Update Transloadit.java * Update test-in-docker.sh * Fixes - Added the missing @throws LocalOperationException tags to the two getSignedSmartCDNUrl overloads so Javadoc no longer fails with doclint on CI. - Restored the Java docker script with the correct image name and quoting (spaces between gradle args intact); ./scripts/test-in-docker.sh now runs cleanly. - Verified the full suite (including the live Assembly integration test) with ./scripts/test-in-docker.sh. * fixes - Fixed Javadoc: closed the sample code block in SignatureProvider so doclint no longer hits “unterminated inline tag” or “unknown tag: Override”. - Added @throws LocalOperationException to both getSignedSmartCDNUrl overloads. - Introduced src/test/java/com/transloadit/sdk/integration/package-info.java and cleaned up unused imports in AssemblyIntegrationTest to satisfy Checkstyle. - Confirmed ./scripts/test-in-docker.sh (which runs unit + integration tests) completes successfully. * w * Create PLAN.md * save plan * plan * plan * wip * rewrite example * code tags * run docker e2e tests * no more docker * fix java 8 * CONTRIBUTING * Increase coverage * Fix #62 * Fix linting * Remove superlinter * improve coverage * coverage * coverage * tackle review * coverage * compare against reference * wip * java 8 fix
1 parent 21d5238 commit 486ebea

File tree

22 files changed

+1081
-143
lines changed

22 files changed

+1081
-143
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git
2+
.gradle
3+
build
4+
out
5+
.idea
6+
.DS_Store
7+
*.iml
8+
*.log

.github/workflows/lintChanges.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ jobs:
1717
strategy:
1818
matrix:
1919
java: ['8','11']
20-
20+
2121
runs-on: ubuntu-latest
22+
env:
23+
TRANSLOADIT_KEY: ${{ secrets.TRANSLOADIT_KEY }}
24+
TRANSLOADIT_SECRET: ${{ secrets.TRANSLOADIT_SECRET }}
2225

2326
steps:
2427
- name: Checkout Repository
@@ -30,6 +33,13 @@ jobs:
3033
java-version: ${{ matrix.java }}
3134
distribution: 'adopt'
3235

36+
# This allows us to test Smart CDN Signatures against the Node SDK reference
37+
# implementation for parity.
38+
- name: Set up Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 24
42+
3343
- name: Grant execute permission for gradlew
3444
run: chmod +x gradlew
3545

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
*.war
88
*.ear
99

10+
# Local logs
11+
*.log
12+
*-output.txt
13+
1014
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
1115
hs_err_pid*
1216

@@ -20,9 +24,11 @@ hs_err_pid*
2024
local.properties
2125
build/
2226
/examples/build
27+
.gradle-docker/
2328

2429
# Gradle
2530
.gradle/
2631

2732
# OSX
28-
.DS_Store
33+
.DS_Store
34+
.env

CHANGELOG.md

Lines changed: 116 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,175 @@
1-
### 2.0.1 / 2025-05-12 ###
1+
### 2.1.0 / 2025-10-15
22

3-
* Update tus-java-client dependency to 0.5.1
3+
- Added support for external signature generation via `SignatureProvider` interface ([#19](https://github.com/transloadit/android-sdk/issues/19))
4+
- New constructors in `Transloadit` accepting a `SignatureProvider`
5+
- Enables secure signature generation on backend servers for client applications and mobile apps
6+
- Added unit tests covering the new signing flow
7+
- Replaced the Nix-based developer environment with a lightweight Docker workflow (`scripts/test-in-docker.sh`) for consistent, fast test runs across platforms
48

5-
### 2.0.0 / 2024-01-14 ###
6-
#### Major Release
7-
* Exchange the Socket based assembly status fetching with a Server-Sent-Events (SSE) solution.
8-
* Added new methods to the AssemblyListener interface to provide more information about the assembly status. e.g. encoding progress with AssemblyListener#onAssemblyProgress().
9-
* Changed existing methods in the AssemblyListener interface to provide the bare JSON response from the api instead of pre-parsed data.
10-
* Removed the deprecated AsyncAssemblies class and functionality.
9+
### 2.0.1 / 2025-05-12
10+
11+
- Update tus-java-client dependency to 0.5.1
12+
13+
### 2.0.0 / 2024-01-14
14+
15+
#### Major Release
16+
17+
- Exchange the Socket based assembly status fetching with a Server-Sent-Events (SSE) solution.
18+
- Added new methods to the AssemblyListener interface to provide more information about the assembly status. e.g. encoding progress with AssemblyListener#onAssemblyProgress().
19+
- Changed existing methods in the AssemblyListener interface to provide the bare JSON response from the api instead of pre-parsed data.
20+
- Removed the deprecated AsyncAssemblies class and functionality.
1121

1222
##### Breaking Changes - Upgrade Guide
13-
* The AssemblyListener interface has been upgraded. As a result you will have to implement the following methods:
23+
24+
- The AssemblyListener interface has been upgraded. As a result you will have to implement the following methods:
25+
1426
- `onFileUploadFinished(JSONObject uploadInformation);`
1527
- `onAssemblyProgress(JSONObject progress)`
1628
- `onAssemblyResultFinished(JSONArray result)`
1729

18-
* The AsyncAssembly class has been removed. If you were using it, you will have to switch to the regular Assembly class.
19-
It has been extended with asynchronous upload capabilities in the past.
20-
The Example under `examples/src/main/java/com/transloadit/examples/MultiStepProcessing.java` shows how to use the new features.
21-
### 1.0.1 / 2024-11-28 ###
22-
* Added SDK support for generating signed Smart CDN URLs (see https://transloadit.com/docs/topics/signature-authentication/#smart-cdn).
30+
- The AsyncAssembly class has been removed. If you were using it, you will have to switch to the regular Assembly class.
31+
It has been extended with asynchronous upload capabilities in the past.
32+
The Example under `examples/src/main/java/com/transloadit/examples/MultiStepProcessing.java` shows how to use the new features.
33+
34+
### 1.0.1 / 2024-11-28
35+
36+
- Added SDK support for generating signed Smart CDN URLs (see https://transloadit.com/docs/topics/signature-authentication/#smart-cdn).
2337
This functionality ships as Transloadit#getSignedSmartCDNUrl() - Method.
24-
* Migrated test suite from JUnit4 to JUnit 5
25-
* Upgrade okhttp to 4.12.0 as a security update
38+
- Migrated test suite from JUnit4 to JUnit 5
39+
- Upgrade okhttp to 4.12.0 as a security update
40+
41+
### 1.0.0 / 2022-12-14
2642

27-
### 1.0.0 / 2022-12-14 ###
2843
#### Major Release
44+
2945
Warning: This version includes breaking changes and some experimental features, please keep that in mind when using it.
3046

31-
If you encounter any problems because of the upgrade, please do not hesitate to contact support@transloadit.com
47+
If you encounter any problems because of the upgrade, please do not hesitate to contact support@transloadit.com
3248
or open a GitHub-Issue.
3349

3450
##### Breaking Changes - Upgrade Guide
35-
* The AssemblyListener Interface has been upgraded. As a result you will have to implement the following methods:
51+
52+
- The AssemblyListener Interface has been upgraded. As a result you will have to implement the following methods:
3653
- `onFileUploadPaused(String name)`
3754
- `onFileUploadResumed(String name)`
3855
- `onFileUploadProgress(long uploadedBytes, long totalBytes)`
39-
If you do not need their functionality, just leave them blank.
40-
* Also take note of the deprecation of `AsyncAssemblies`. The normal `Assembly` class, thanks to its extended
56+
If you do not need their functionality, just leave them blank.
57+
- Also take note of the deprecation of `AsyncAssemblies`. The normal `Assembly` class, thanks to its extended
4158
functionality, serves as a replacement. You can find more about it further down in the text.
4259

4360
##### Most Important Innovations:
44-
* Introduction of multithreaded uploads. - Now you can upload multiple files in parallel:
45-
* The uploads are pausable via `Assembly#pauseUploads()`.
46-
* And resumable with `Assembly#resumeUploads()`.
47-
* The default value of files being uploaded at the same time is 2. You can adjust this with
48-
`Assembly#setMaxParallelUploads(int maxUploads)`.
49-
* If you want to turn off this feature use: `Assembly#setMaxParallelUploads(int maxUploads)` with a value of 1.
50-
* The `AssemblyListener` has now an extended feature set and provides also information to the new upload mode.
51-
* `AsyncAssemblies` are deprecated now in favor of multithreaded uploads.
52-
* Because some users, especially on Android, are using AsyncAssemblies
53-
this release ships a fix for the corresponding Listeners to avoid `NullPointerExceptions`.
54-
* If you want to add a `Step` to an `Assembly`, providing the Robot's name is now optional. This helps if you want to do a Template Override.
61+
62+
- Introduction of multithreaded uploads. - Now you can upload multiple files in parallel:
63+
- The uploads are pausable via `Assembly#pauseUploads()`.
64+
- And resumable with `Assembly#resumeUploads()`.
65+
- The default value of files being uploaded at the same time is 2. You can adjust this with
66+
`Assembly#setMaxParallelUploads(int maxUploads)`.
67+
- If you want to turn off this feature use: `Assembly#setMaxParallelUploads(int maxUploads)` with a value of 1.
68+
- The `AssemblyListener` has now an extended feature set and provides also information to the new upload mode.
69+
- `AsyncAssemblies` are deprecated now in favor of multithreaded uploads.
70+
- Because some users, especially on Android, are using AsyncAssemblies
71+
this release ships a fix for the corresponding Listeners to avoid `NullPointerExceptions`.
72+
- If you want to add a `Step` to an `Assembly`, providing the Robot's name is now optional. This helps if you want to do a Template Override.
5573
The provided Examples were revised and new examples have been added.
5674

5775
##### Minor changes:
58-
* All dependencies are up-to-date now and include all necessary security patches.
59-
* Signature Authentication uses HmacSHA384 now.
60-
* Signature Authentication uses a unique nonce per assembly in order to prevent signature reuse errors.
6176

62-
### 0.4.4 / 2022-10-30 ###
63-
* The Socket-IO plugin has been updated to version 4, which is also used by the API.
77+
- All dependencies are up-to-date now and include all necessary security patches.
78+
- Signature Authentication uses HmacSHA384 now.
79+
- Signature Authentication uses a unique nonce per assembly in order to prevent signature reuse errors.
80+
81+
### 0.4.4 / 2022-10-30
82+
83+
- The Socket-IO plugin has been updated to version 4, which is also used by the API.
84+
85+
### 0.4.3 / 2022-10-28
86+
87+
- Includes a vulnerability patch in the used socket-io implementation
6488

65-
### 0.4.3 / 2022-10-28 ###
66-
* Includes a vulnerability patch in the used socket-io implementation
89+
### 0.4.2 / 2022-02-03
6790

68-
### 0.4.2 / 2022-02-03 ###
69-
* Added possibility for SDKs using this SDK to send their own version number to the server in the Transloadit-Client header.
70-
* Resolved some file-name conflicts with the tus-java-client library.
91+
- Added possibility for SDKs using this SDK to send their own version number to the server in the Transloadit-Client header.
92+
- Resolved some file-name conflicts with the tus-java-client library.
7193

72-
### 0.4.1 / 2021-09-26 ###
73-
* Added debugging features regarding HTTP-requests, which should not be used in production without contacting Transloadit support.
94+
### 0.4.1 / 2021-09-26
7495

75-
### 0.4.0 / 2021-09-26 ###
76-
* Added support for client-side Assembly IDs. You can obtain the ID of an Assembly now before even uploading/saving it. You can achieve this with the brand-new Assembly#getAssemblyID() method.
77-
* Added debugging features regarding AssemblyIDs, which should not be used in production without contacting Transloadit support.
78-
* Also updated the AssemblyListener interface to provide HashMaps instead of JSONObjects.
96+
- Added debugging features regarding HTTP-requests, which should not be used in production without contacting Transloadit support.
7997

80-
### 0.3.0 / 2021-06-27 ###
81-
* Updated all dependencies to their most recent, compatible version
98+
### 0.4.0 / 2021-09-26
99+
100+
- Added support for client-side Assembly IDs. You can obtain the ID of an Assembly now before even uploading/saving it. You can achieve this with the brand-new Assembly#getAssemblyID() method.
101+
- Added debugging features regarding AssemblyIDs, which should not be used in production without contacting Transloadit support.
102+
- Also updated the AssemblyListener interface to provide HashMaps instead of JSONObjects.
103+
104+
### 0.3.0 / 2021-06-27
105+
106+
- Updated all dependencies to their most recent, compatible version
82107
=> minimal requirements for the SDK are now Android 5+ and Java 8+.
83-
* Add (form) fields to an Assembly or Template with the addField()- and addFields() - methods
84-
* Extended support for Assembly progress updates via the Websocket.
108+
- Add (form) fields to an Assembly or Template with the addField()- and addFields() - methods
109+
- Extended support for Assembly progress updates via the Websocket.
85110
=> AssemblyListener Interface provides more callback functions now. This should be considered before the update.
86-
* Codebase received a review and an updated JavaDoc
87-
* New Example added that uses [Kotlin](https://kotlinlang.org/).
88-
89-
### 0.2.0 / 2021-05-17 ###
90-
* Added retry functionality for assemblies in case of reaching the rate limit
111+
- Codebase received a review and an updated JavaDoc
112+
- New Example added that uses [Kotlin](https://kotlinlang.org/).
113+
114+
### 0.2.0 / 2021-05-17
115+
116+
- Added retry functionality for assemblies in case of reaching the rate limit
91117

92-
### 0.1.6 / 2021-02-24 ###
118+
### 0.1.6 / 2021-02-24
93119

94-
* Fix bug that doesn't allow usage of templates that have disabled allow steps override.
95-
* Added some new examples
120+
- Fix bug that doesn't allow usage of templates that have disabled allow steps override.
121+
- Added some new examples
96122

97-
### 0.1.5 / 2019-07-16 ###
123+
### 0.1.5 / 2019-07-16
98124

99-
* Make tus uploads to assembly's tus url
100-
* Make assembly wait till completion
125+
- Make tus uploads to assembly's tus url
126+
- Make assembly wait till completion
101127

102-
### 0.1.4 / 2019-04-27 ###
128+
### 0.1.4 / 2019-04-27
103129

104-
* Use a fallback version
130+
- Use a fallback version
105131

106-
### 0.1.3 / 2019-04-18 ###
132+
### 0.1.3 / 2019-04-18
107133

108-
* load sdk version via ResourceBundle
134+
- load sdk version via ResourceBundle
109135

110-
### 0.1.2 / 2019-04-09 ###
136+
### 0.1.2 / 2019-04-09
111137

112-
* send client version via "Transloadit-Client" header
113-
* Do not use deprecated status_endpoint property
114-
* update tus-java-client version
138+
- send client version via "Transloadit-Client" header
139+
- Do not use deprecated status_endpoint property
140+
- update tus-java-client version
115141

116-
### 0.1.1 / 2018-04-23 ###
142+
### 0.1.1 / 2018-04-23
117143

118-
* Allow configurable upload chunk size [#21](https://github.com/transloadit/java-sdk/issues/21)
144+
- Allow configurable upload chunk size [#21](https://github.com/transloadit/java-sdk/issues/21)
119145

120-
### 0.1.0 / 2018-04-05 ###
146+
### 0.1.0 / 2018-04-05
121147

122-
* Support for Pausable/Resumable Asynchronous assemblies
123-
* Add assembly files as Inputstream
148+
- Support for Pausable/Resumable Asynchronous assemblies
149+
- Add assembly files as Inputstream
124150

125-
### 0.0.6 / 2018-01-19 ###
151+
### 0.0.6 / 2018-01-19
126152

127-
* Do tus uploads only when there are files to upload.
153+
- Do tus uploads only when there are files to upload.
128154

129-
### 0.0.5 / 2018-01-18 ###
155+
### 0.0.5 / 2018-01-18
130156

131-
* Check for assembly error before proceeding with tus upload
157+
- Check for assembly error before proceeding with tus upload
132158

133-
### 0.0.4 / 2018-01-08 ###
159+
### 0.0.4 / 2018-01-08
134160

135-
* Remove tus upload chunksize
161+
- Remove tus upload chunksize
136162

137-
### 0.0.3 / 2017-05-15 ###
163+
### 0.0.3 / 2017-05-15
138164

139-
* `Steps.removeStep` method
140-
* Added example project for sample codes
141-
* Maven compliant deployment build.
165+
- `Steps.removeStep` method
166+
- Added example project for sample codes
167+
- Maven compliant deployment build.
142168

143-
### 0.0.2 / 2017-05-12 ###
169+
### 0.0.2 / 2017-05-12
144170

145-
* `AssemblyResponse.getStepResult` method
171+
- `AssemblyResponse.getStepResult` method
146172

147-
### 0.0.1 / 2017-05-09 ###
173+
### 0.0.1 / 2017-05-09
148174

149-
* Initial release
175+
- Initial release

0 commit comments

Comments
 (0)