Compare commits

...

3 Commits
main ... 5.0.1

Author SHA1 Message Date
Paul Schaub d028480b1a
SOP-Java 5.0.1 2023-04-26 16:01:02 +02:00
Paul Schaub 01f7fc158c
Update changelog 2023-04-18 18:00:59 +02:00
Paul Schaub d53776dfc8
external-sop: Fix error code mapping of new exceptions 2023-04-18 17:59:16 +02:00
4 changed files with 23 additions and 1 deletions

View File

@ -6,6 +6,11 @@ SPDX-License-Identifier: Apache-2.0
# Changelog
## 5.0.1
- `external-sop`: Properly map error codes to new exception types:
- `UNSUPPORTED_PROFILE`
- `INCOMPATIBLE_OPTIONS`
## 5.0.0
- Update implementation to [SOP Specification revision 05](https://www.ietf.org/archive/id/draft-dkg-openpgp-stateless-cli-05.html).
- Add the concept of profiles

View File

@ -267,6 +267,14 @@ public class ExternalSOP implements SOP {
throw new SOPGPException.KeyCannotSign("External SOP backend reported error KeyCannotSign (" +
exitCode + "):\n" + errorMessage);
case SOPGPException.IncompatibleOptions.EXIT_CODE:
throw new SOPGPException.IncompatibleOptions("External SOP backend reported error IncompatibleOptions (" +
exitCode + "):\n" + errorMessage);
case SOPGPException.UnsupportedProfile.EXIT_CODE:
throw new SOPGPException.UnsupportedProfile("External SOP backend reported error UnsupportedProfile (" +
exitCode + "):\n" + errorMessage);
default:
throw new RuntimeException("External SOP backend reported unknown exit code (" +
exitCode + "):\n" + errorMessage);

View File

@ -9,12 +9,14 @@ import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import sop.Profile;
import sop.SOP;
import sop.exception.SOPGPException;
import java.io.IOException;
import java.util.List;
import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
public class ListProfilesTest extends AbstractSOPTest {
@ -30,4 +32,11 @@ public class ListProfilesTest extends AbstractSOPTest {
assertFalse(profiles.isEmpty());
}
@ParameterizedTest
@MethodSource("provideInstances")
public void listUnsupportedProfiles(SOP sop) throws IOException {
assertThrows(SOPGPException.UnsupportedProfile.class, () -> sop
.listProfiles()
.subcommand("invalid"));
}
}

View File

@ -5,7 +5,7 @@
allprojects {
ext {
shortVersion = '5.0.1'
isSnapshot = true
isSnapshot = false
minAndroidSdk = 10
javaSourceCompatibility = 1.8
gsonVersion = '2.10.1'