Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

SIP-4: DWN Routes #113

Merged
merged 5 commits into from
Sep 27, 2022
Merged

Conversation

nitro-neal
Copy link
Contributor

New DWN route for publishing a manifest, with dwn config for dwn endpoint

Input:
{{baseUrl}}/v1/dwn/manifests

{
  "manifestId": "WA-DL-CLASS-A"
}

Output

credentialManifest: {...}
published: true

image

@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2022

Codecov Report

Merging #113 (3622ac3) into main (47a6a71) will decrease coverage by 0.06%.
The diff coverage is 26.56%.

@@            Coverage Diff             @@
##             main     #113      +/-   ##
==========================================
- Coverage   27.76%   27.69%   -0.07%     
==========================================
  Files          16       17       +1     
  Lines        1059     1123      +64     
==========================================
+ Hits          294      311      +17     
- Misses        723      769      +46     
- Partials       42       43       +1     
Impacted Files Coverage Δ
config/config.go 11.76% <0.00%> (-0.74%) ⬇️
pkg/server/router/dwn.go 16.66% <16.66%> (ø)
pkg/server/server.go 72.09% <75.00%> (+0.29%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

config/config.go Outdated Show resolved Hide resolved
pkg/server/framework/request.go Outdated Show resolved Hide resolved

resp, err := http.Post(endpoint, "application/json", bytes.NewBuffer(jsonData))

if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too - what kind of error would be returned to the client and logged to us?

pkg/server/router/dwn.go Show resolved Hide resolved
return framework.NewRequestError(errors.Wrap(err, errMsg), http.StatusBadRequest)
}

status := dwnResp.StatusCode >= 200 && dwnResp.StatusCode < 300
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status is a binary value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this

pkg/server/server.go Outdated Show resolved Hide resolved

if err != nil {
errMsg := "could not publish manifest to dwn"
if err != nil || &publishManifestResponse.Manifest == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider an IsEmpty method on publishManifestResponse

@nitro-neal nitro-neal merged commit ce425c4 into main Sep 27, 2022
@nitro-neal nitro-neal deleted the sip-4-create-a-new-package-boilerplate-ose-115 branch September 27, 2022 22:44
decentralgabe pushed a commit that referenced this pull request Sep 28, 2022
…-all-services-ose-122

* origin/main:
  SIP-4: DWN Routes (#113)
  Update README.md
  Add Sip 4 to table (#109)
  Adding SIP4 Doc (#108)

# Conflicts:
#	config/compose.toml
#	config/config.go
#	config/config.toml
#	go.mod
#	go.sum
#	pkg/server/server_test.go
#	pkg/service/service.go
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants