Conversation
…map types to a string value manually. `SigningAlgorithm.rawValue` will automatically contain the case identifier as string. `CaseIterable` provides `.allCases` which makes sure, we catch all available algorithms in the test. Which, to be honest now became somewhat superfluous.
…e-form text string for a parameter which is only allowed to have 2 different values.
…rid of the switch here.
…ertible`. (Even when they're not localized. You're in good company with Apple…)
…chainSigner` to `SigningAlgorithm` to improve code clarity.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
==========================================
+ Coverage 54.26% 55.61% +1.34%
==========================================
Files 39 39
Lines 1301 1291 -10
==========================================
+ Hits 706 718 +12
+ Misses 595 573 -22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Aaaah, almost forgot this one: C2PA namespace overloadUnfortunately, the package namespace As a consuming app, I get an unresolvable problem under the following conditions:
I completely get the idea of the TBH: I myself would need some more time to come up with the clean solution here. Well, 2 hard things in programming: null pointers and naming. (And I think the modern languages pretty much solved the null pointer problem.) Anyway, the situation as it is now is very much not good and needs to change. Let me know, if I should spend some more time to find that good solution. |
|
@tladesignz Per our discussion in the chat, please proceed with fixes for the ‘additional findings’ and suggest a plan for how to deal with the C2PA namespace problem. |
…using the `C2PAError.api` error.
|
Since this library is working on macOS, too, the Github handle How about renaming the library to This would kill 2 birds with one stone. |
|
At least, the repo should be renamed. I use |
@redaranj, let's discuss this, esp. my Additional findings!
Changes in this pull request
SigningAlgorithmenum to avoidswitching. Strengthens guarantees already at compile time.printwith proper logging.LocalizedErrorinstead ofCustomStringConvertibleonErrortypes.Stream(fileURL:)in documentation.Types of changes
Checklist
TO DOitems (or similar) have been entered as GitHub issues and the link to that issue has been included in a commentAdditional findings
URL arguments
All URL arguments seem to be of type
String. To improve clarity and discourage wrong usageof the API, I would suggest, to make all of them of type
URL.Even though, many of them are converted back to String on usage.
You could then also drop the "URL" suffix on the argument names.
In
WebServiceSigner, you could then also drop these lines:URLSession
WebServiceSignerhardcodesURLSession.sharedusage.This can be problematic for consuming apps, as they might also use some tunneling (e.g. Tor…)
I suggest to add an optional
initarg, so apps can hand over their preconfiguredURLSession.C2PAError.api
It seems, someone got lazy and used
C2PAError.api(String)instead of adding more error cases.In at least one place, I found this:
I suggest to replace them with custom errors resp. throw the actual error directly.
In case a consuming app wants to something special on specific errors, they would otherwise
resort to string matching, which is seriously ugly.
Also, this is misleading debugging.