-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: new Exception system #44
Feat: new Exception system #44
Conversation
@borisrizov-zf please add @bjoern-arnold and @DominikPinsel as reviewer. |
@koptan We can begin the move after the 23.12 release. You'll have to do a rebase first. |
This PR, will require some changes from MIW team, so I think it's better to talk to them and ask them to do the migration and test it from their side then we can do the merge. |
55fbfc0
to
a3ecc34
Compare
This PR is too large, we'll have to split it up to remain compliant. Let's plan the split next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if InvalidPrivateKeyFormatException extend KeyGenerationException. This would eliminate the need to wrap the message in a KeyGenerationException and rethrow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Creating an exception hierarchy with class KeyGenerationException as parent would be more elegant than wrapping and more specific exceptions in a KeyGenerationException and rethrowing it.
- Also think about adding a "serialVerionUID" field to all exception classes (see JavaDoc for java.ioSerializable)
src/main/java/org/eclipse/tractusx/ssi/lib/crypt/x21559/x21559Generator.java
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/crypt/x21559/x21559Generator.java
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/exception/key/InvalidPublicKeyFormatException.java
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/exception/key/InvalidPrivateKeyFormatException.java
Show resolved
Hide resolved
...lipse/tractusx/ssi/lib/exception/resolver/DidDocumentResolverAlreadyRegisteredException.java
Outdated
Show resolved
Hide resolved
...g/eclipse/tractusx/ssi/lib/exception/resolver/DidDocumentResolverNotRegisteredException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/exception/resolver/DidWebException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/did/resolver/DidResolverException.java
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/validation/JsonLdValidatorImpl.java
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/validation/JsonLdValidatorImpl.java
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtVerifier.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/tractusx/ssi/lib/exception/proof/SignatureVerificationFailedException.java
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/exception/proof/JwtAudienceCheckFailedException.java
Outdated
Show resolved
Hide resolved
@koptan please fix merge issues. Probably you need to just rebase. |
BREAKING CHANGE: a lot of Exception has been added and removed
BREAKING CHANGE: a lot of Exception has been added and removed
faa875d
to
9d6053a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the comments.
src/main/java/org/eclipse/tractusx/ssi/examples/Verification.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/crypt/x21559/x21559PrivateKey.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/crypt/x21559/x21559PublicKey.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/exception/json/TransformJsonLdException.java
Outdated
Show resolved
Hide resolved
|
||
/** The type Invalide private key format. */ | ||
public class InvalidPrivateKeyFormatException extends KeyGenerationException { | ||
private static final long serialVersionUID = -3348735256693555408L; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the @Serial
annotation
Make it equal 1L
. as it's a new class
Repeat for all new Exception classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to use this compilation option javac -Xlint:serial
to make it work, so I didn't change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's actually preferable to start at 1L
and increment only when you've changed the class, in order to ensure serialization doesn't break between compilers, platforms and other outside factors. For exceptions it is sufficient to set it at 1L
src/test/java/org/eclipse/tractusx/ssi/lib/util/identity/TestDidResolver.java
Outdated
Show resolved
Hide resolved
src/test/java/org/eclipse/tractusx/ssi/lib/util/identity/TestIdentity.java
Outdated
Show resolved
Hide resolved
src/test/java/org/eclipse/tractusx/ssi/lib/util/identity/TestIdentityTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/eclipse/tractusx/ssi/lib/validation/JsonLdValidatorTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/eclipse/tractusx/ssi/lib/verifiable/VerifiablePresentationTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/examples/Validation.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/tractusx/ssi/lib/did/resolver/CompositeDidResolver.java
Show resolved
Hide resolved
@koptan I've done another sweep of the PR. It looks good, so as soon as you update the |
To Fix #30, also some cleanup in the code.
BREAKING CHANGE: a lot of Exceptions have been added and removed, MIW needs to adopt the new changes.
Description
Pre-review checks
Please ensure to do as many of the following checks as possible, before asking for committer review: