Skip to content
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

fix: support hashed content CIP-30 data content which is typically g… #593

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

matiwinnetou
Copy link
Contributor

@matiwinnetou matiwinnetou commented Sep 29, 2024

…enerated by hardware wallets.

Many thanks to the OG Cardano Community member: Martin Lang (@gitmachtl) in helping to debug and find out the root cause.

@@ -78,7 +79,7 @@ dependencies {
runtimeOnly("org.postgresql:postgresql")

implementation("org.cardanofoundation:merkle-tree-java:0.0.7")
implementation("org.cardanofoundation:cip30-data-signature-parser:0.0.11")
implementation("org.cardanofoundation:cip30-data-signature-parser:0.0.12-SNAPSHOT")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO:
change when released 0.0.12 to maven central

@matiwinnetou matiwinnetou requested review from rcmorano and removed request for rcmorano, nemo83, jimcase, satran004 and jorgenavben September 29, 2024 21:38
@matiwinnetou matiwinnetou marked this pull request as draft September 29, 2024 21:39
@matiwinnetou matiwinnetou marked this pull request as ready for review September 29, 2024 21:54
@@ -28,6 +28,7 @@ configurations {
}

repositories {
mavenLocal()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO remove when cip30-data-signature-parser:0.0.12-SNAPSHOT is released

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually safe to keep it as well, right?

@@ -60,7 +60,7 @@ public class Vote extends AbstractTimestampEntity {
private String signature;

@Column(name = "payload", nullable = false, columnDefinition = "text", length = 2048)
@Nullable
@Nullable // TODO remove nullable since payload is now always required
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in future releases, don't wanna do db migration now, too risky and not necessary.

@matiwinnetou matiwinnetou changed the title feat: support hashed content CIP-30 data content which is typically g… fix: support hashed content CIP-30 data content which is typically g… Sep 29, 2024
@@ -122,7 +125,37 @@ protected void doFilterInternal(HttpServletRequest req,

val walletId = maybeAddress.orElseThrow();

val cipBody = cipVerificationResult.getMessage(MessageFormat.TEXT);
var cipBody = cipVerificationResult.getMessage(MessageFormat.TEXT);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because i saw this: a cose_sign1 signature/structure is still valid even without a payload embedded. not sure how often this is used, but the requesting process already know the payload, so there is no 100% need to have a payload included.

@rcmorano rcmorano changed the base branch from main to develop October 2, 2024 12:40
Copy link
Contributor

@rcmorano rcmorano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and it works :)

@@ -28,6 +28,7 @@ configurations {
}

repositories {
mavenLocal()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually safe to keep it as well, right?

@rcmorano rcmorano changed the base branch from develop to main October 2, 2024 16:24
@rcmorano rcmorano changed the base branch from main to develop October 2, 2024 16:24
@matiwinnetou matiwinnetou merged commit 58d25c2 into develop Nov 6, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants