-
Notifications
You must be signed in to change notification settings - Fork 26
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
Epic VDR phase 3 branch #1245
Epic VDR phase 3 branch #1245
Conversation
Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]> Signed-off-by: Hyperledger Bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hyperledger Bot <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: FabioPinheiro <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Yurii Shynbuiev - IOHK <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Bassam Riman <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Pat Losoponkul <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Pat Losoponkul <[email protected]> Signed-off-by: Hyperledger Bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hyperledger Bot <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Yurii Shynbuiev - IOHK <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
…ci] (#1257) Signed-off-by: Yurii Shynbuiev <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Pat Losoponkul <[email protected]> Signed-off-by: Hyperledger Bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hyperledger Bot <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
#1264) Signed-off-by: Pat Losoponkul <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Allain Magyar <[email protected]> Signed-off-by: Hyperledger Bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hyperledger Bot <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
# [1.38.0](cloud-agent-v1.37.0...cloud-agent-v1.38.0) (2024-07-15) ### Bug Fixes * Move InMemory classes to the test moduels ([#1240](#1240)) ([823057a](823057a)) * move mocks into the test modules ([#1236](#1236)) ([df83026](df83026)) * use Put and Get for DID in doobie statement ([#1250](#1250)) ([fc1cf51](fc1cf51)) * Wallet Management Error Handling ([#1248](#1248)) ([cfd5101](cfd5101)) ### Features * upgrade docusaurus and semantic-release packages ([de53f1d](de53f1d)) Signed-off-by: Allain Magyar <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: FabioPinheiro <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Pat Losoponkul <[email protected]> Signed-off-by: patlo-iog <[email protected]> Signed-off-by: Hyperledger Bot <[email protected]> Co-authored-by: Yurii Shynbuiev - IOHK <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hyperledger Bot <[email protected]> Signed-off-by: Shota Jolbordi <[email protected]>
e6048eb
to
ff2d9b6
Compare
Signed-off-by: Shota Jolbordi <[email protected]>
… envelope (#1283) Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]>
val res = for { | ||
cd <- service.getByGUID(guid, ResourceResolutionMethod.did) | ||
response <- ZIO | ||
.fromEither(CredentialDefinitionDidUrlResponse.asPrismEnvelopeResponse(cd, baseUrlServiceName)) | ||
.mapError(couldNotParseCredDefResponse) | ||
|
||
} yield response | ||
|
||
res | ||
} |
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 it be better to use a for-comprehension
without val res
in the beginning and res
in the end?
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.
its a stylistic choise, I like this because its easier to debug later, and see the response type by hovering over.
.withBaseUri(rc.request.uri) | ||
) | ||
): IO[ErrorResponse, PrismEnvelopeResponse] = { | ||
val res = for { |
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.
same here. What is the purpose of this code style?
.mapError(_ => MissingRequiredParams(uri)) | ||
(resourceService, resourcePath) = serviceAndPath | ||
didStr = parsed.removeQueryString().toString | ||
didDocument <- didResolver.resolve(didStr).flatMap { |
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.
I'm not sure this way of error detail complies with the current error-handling strategy.
Let's commit to it as it is, but discuss it with @bvoiturier at the AoH meeting.
class DidUrlResolver(httpUrlResolver: HttpUrlResolver, didResolver: DidResolver) extends UriResolver { | ||
import DidUrlResolver.* | ||
|
||
def resolve(uri: String): IO[GenericUriResolverError, 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.
I would also try to refactor the long function and split it into the stages/phases:
- parse Uri => get DID
- resolve DID
- fetch Services
- compose the resource Url
- get the resource by Url
- check resource integrity (if needed)
ZIO.fail(UnexpectedUpstreamResponseReceived(status.code)) | ||
} | ||
} yield body | ||
program.provideSomeLayer(zio.Scope.default) |
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.
What is the purpose of the Scope.default
here?
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.
I'm not sure It is a refactored code, but if I recall, ZIO HTTP client needs this layer to function
import org.hyperledger.identus.pollux.vc.jwt.{CredentialPayload, DidResolver, JWT, JWTVerification, JwtCredential} | ||
import org.hyperledger.identus.pollux.vc.jwt.CredentialPayload.Implicits | ||
import org.hyperledger.identus.shared.http.UriResolver | ||
// import org.hyperledger.identus.pollux.vc.jwt.CredentialPayload.Implicits //TODO: might not be necessary |
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.
you can always run optimize imports
from the Intellij Idea
Signed-off-by: Shota Jolbordi <[email protected]>
Closing this one due to DCO issues, see #1385 |
Description:
Epic branch for https://input-output.atlassian.net/browse/ATL-6543
This Epic PR contains commits from other feature PRs that have been reviewed separately
Closed in favor of #1385
Alternatives Considered (optional):
Link to existing ADR (Architecture Decision Record), if any. If relevant, describe other approaches explored and the selected approach. Documenting why the methods were not selected will create a knowledge base for future reference, helping prevent others from revisiting less optimal ideas.
Checklist: