-
Notifications
You must be signed in to change notification settings - Fork 5
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
Comment post support: api & cli #16
Conversation
These are not relevant or expected for comment. see https://github.com/orgs/PrivateBin/discussions/1290 For paste they are present when getting paste, not while posting, so make them optional. They should be part of PostPasteResponse, PostCommentResponse only.
makes some stuff easier. will be apparent in next commit
default helps creating skeleton structure. cipher generation is also automated for example. makes usage less error prone
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.
Thank you for the contribution! Just 2 (or basically one) minor questions. For me atleast it compiled without changes when changing those to be an URL, but I am not sure which impact that would have on uniffi
pub struct PostCommentResponse { | ||
pub id: String, | ||
pub status: u32, | ||
pub url: String, |
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.
Would changing this to an URL make sense or does that interfere with uniffi?
pub id: String, | ||
pub url: String, | ||
pub url: Option<String>, |
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.
Would changing this to an URL make sense or does that interfere with uniffi?
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.
There would be no issue with uniffi.
But the "url" returned by privatebin responses can be weird:
{"status":0,"id":"ba7bf946a542eee1","url":"\/?ba7bf946a542eee1","deletetoken":"9914b0e934253e2e327f9a6477b99f6fff5d1e0e10d3d3bd08d4d9b6a20ab2ea"}
So just need to test if it parses correctly.
Same with above.
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.
Update: We do indeed get error when actually parsing it to url. The url value should be fixed upstream before we try to make use of this property.
Error: Json(Error("invalid value: string \"/?518ad640b320f1a4\", expected relative URL without a base", line: 0, column: 0))
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.
Have opened an issue upstream regarding this PrivateBin/PrivateBin#1294
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.
Hey,
in that case it appears there is nothing that can be done from our side, so I will proceed and merge this. Thank you for the contribution!
Best Regards
Mydayyy
Greetings,
This PR completes comments support by adding support for posting comments.
In addition to the above, post paste has been updated to use defined paste type.
The typing should help give more confidence in future updates to the code.
Also, we are able to focus sensitive/error-prone tasks like generating cipher parameters in one place.
Best regards.