-
Notifications
You must be signed in to change notification settings - Fork 3
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
Probably too much #29
Conversation
export './crypto/jwk.dart'; | ||
export './crypto/dsa.dart'; | ||
export './crypto/ed25519.dart'; | ||
export './crypto/dsa_name.dart'; | ||
export './crypto/dsa_alias.dart'; | ||
export './crypto/secp256k1.dart'; | ||
export './crypto/key_manager.dart'; | ||
export './crypto/dsa_algorithms.dart'; | ||
export './crypto/in_memory_key_manager.dart'; |
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.
nice!
return resource; | ||
} | ||
|
||
resource = service?.firstWhere((vm) => idVariations.contains(vm.id)); |
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's a firstOrNullWhere
as well if it's possible vm.id
is not found. With this code, it will throw if it's not found. With firstOrNullWhere
it will just return null
.
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.
ah nice! good call. didn't realize the collections package had fancy extensions.
done! 0c9dda6
import 'package:web5/src/dids/data_models/did_document.dart'; | ||
import 'package:web5/src/dids/data_models/did_document_metadata.dart'; | ||
import 'package:web5/src/dids/data_models/resolution_metadata.dart'; |
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.
data_models
feels like a strange name, but maybe it makes sense in this context. Would just models
work?
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.
totally agreed. changed to structures
: f358533
if (resource != null) { | ||
return DidDereferenceResult(contentStream: resource); | ||
} else { | ||
return DidDereferenceResult.withError('notFound'); | ||
} |
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.
nit.
return resource != null ?
DidDereferenceResult(contentStream: resource) :
DidDereferenceResult.withError('notFound');
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.
love it. changing now
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.
done: fa5dbae
packages/web5/lib/src/jwt/jwt.dart
Outdated
); | ||
} | ||
|
||
if (header.typ == null || header.typ != 'JWT') { |
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.
is this case sensitive? Do we want/need to support jwt
as well?
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 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.
done! 97b8889
Woot! This is awesome. In the future it would be nice to separate the restructure PR from the new stuff PR but these are early days so there are no rules!!! :) |
Co-Authored-By: Wes <wesbillman@users.noreply.github.com>
Co-Authored-By: Wes <wesbillman@users.noreply.github.com>
Co-Authored-By: Wes <wesbillman@users.noreply.github.com>
Co-Authored-By: Wes <wesbillman@users.noreply.github.com>
What's Changed
Implemented DID URL Dereferencing
Implemented JWS signing and verification
Implemented JWT verification
Not all that happy with
Jwt.dart
right now for the reasons described here. will tackle that in another PRReorganized
web5
package to reduce the amount of import statements that we end up with in any given file.@wesbillman and i chatted about this and decided it'd be interesting to get a feel for what it'd be like if we introduced rollup files for directories where the rollup file exports everything we want to export out of any given directory.
so for example, instead of having to import n thangs out of the
crypto
directory, you can now. just plop aimport 'package:web5/src/crypto.dart';
in and get it all.Selective importing are still possible using
show
,hide
, or continuing to import each file individually.reorganized
web5/dids
directory.the
dids
directory in main felt pretty noisy and it wasn't exactly clear what functionality the directory should showcase on initial glance.Concretely,
data_models
dir.did_jwk
,did_dht
dns_packet
intodid_dht
because it's only relevant todid_dht
i think this potentially does a better job of highlighting the most important aspects of that directory but interested to hear other opinions.
Note
eventually. might be worth moving
dns_packet
into its own individual package/repo and publishing it. need tests and shiz for that tho