Comments (13)
@gannan08 are you sure? The thing about register() is that it requires an already generated DID Doc to be passed in. What would be the point of returning it? (It's immutable.)
The reason it's returning an axios response is so that the calling code can judge success/failure.
from did-io.
@dmitrizagidulin there were some test written against this API that were working before largely based on this documentation: https://github.com/digitalbazaar/did-io#generating-and-registering-a-veres-one-did-document
Perhaps returning the did document is optional, but throwing an error on failure is a requirement. Discerning a failure condition based on axios response is did-io's job IMO.
from did-io.
Discerning a failure condition based on axios response is did-io's job IMO.
Sure, agreed. I was thinking more about app-level logic failures (like, the ledger saying "your accelerator proof didn't check out"), which are less the domain of axios? Or are you thinking like, those kind of errors should return as status 400 anyways, in which case axios will throw em? In which case, yeah.
there were some test written against this API that were working before
Wait, did the tests break now, or..?
from did-io.
The test in question was patched earlier today, it passes like this: veres-one/veres-one@3a69c04
We would like it to be restored to it's former self.
from did-io.
We're talking about the register
API. :)
from did-io.
We would like it to be restored to it's former self.
Ok. So you'd like register() to return the did doc, makes sense.
Do you foresee any need for the register call results from the ledger?
We're talking about the register API.
Riiight, ok, I was meta-confused :)
from did-io.
If the concern is that we might need to float axios errors up the stack, maybe something along these lines is appropriate? https://github.com/digitalbazaar/http-signature-header/blob/master/lib/HttpSignatureError.js
So, I would think that if the HTTP API returns some json schema validation error (for instance), the caller of did-io would need to have access to that information to address the cause of the failure.
from did-io.
@mattcollier So the errors I could see - they'll propagate like exceptions usually do.
What about successes? Do you foresee any need for the success results?
from did-io.
Are there different flavors of success? Are we speaking about the register
API specifically or did-io APIs generally?
from did-io.
I don't know, re different flavors of success. :) (And yeah, talking specifically about the register
API).
Tell you what, I'm cool with just having it return a did doc, and discarding the register results, for now. If we need em later, we can refactor.
from did-io.
To understand this correctly if the server returns a 204 (Success) we will be returning a did doc, else throw an error?
from did-io.
To understand this correctly if the server returns a 204 (Success) we will be returning a did doc, else throw an error?
Right!
from did-io.
Merged, closing.
from did-io.
Related Issues (20)
- Rename Capability properties HOT 1
- Rename `secretKeyBase58` => `privateKeyBase58` HOT 1
- Implement creation of DIDs from an existing key HOT 1
- JWE headers look wrong/dated for 0.7.x HOT 1
- Can bad things happen in the `default` case HOT 2
- Use veres-one-context external package
- Migrate DID Docs to use IPFS Multiformats
- Proper handling of unknown DIDs HOT 2
- Add some validation to catch null/undefined hostnames HOT 3
- Support unregistered/pairwise DID use case
- Allow for calling generate API with no arguments HOT 2
- Ensure UUID type DIDs have DID url-to-document-contents integrity protection HOT 2
- Where should `attachInvocationProof` live? HOT 2
- did-key… links return 404 HOT 2
- Add a buildDocumentLoader() convenience method to CachedResolver HOT 1
- npm deprecate did-io
- Switch to GitHub Actions.
- CachedResolver is a weird name
- Consider cache auto-updater
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from did-io.