Skip to content

Commit

Permalink
Update given latest Nuts Node API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Sep 5, 2024
1 parent b832e86 commit 94ac7e9
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 165 deletions.
5 changes: 0 additions & 5 deletions api/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ var allowedProxyRoutes = []proxyRoute{
method: http.MethodDelete,
path: "/internal/discovery/v1/([a-z-A-Z0-9_\\-\\:\\.%]+)/([a-z-A-Z0-0_\\-\\:\\.%]+)",
},
// List owned DIDs
{
method: http.MethodGet,
path: "/internal/vdr/v2/did",
},
// Issue Verifiable Credentials
{
method: http.MethodPost,
Expand Down
15 changes: 0 additions & 15 deletions deploy/node.config.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions discovery/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "github.com/nuts-foundation/go-did/vc"

// DIDStatus represents the status of a DID in the discovery service
type DIDStatus struct {
ServiceID string `json:"id"`
Active bool `json:"active"`
Presentation *vc.VerifiablePresentation `json:"vp"`
ServiceID string `json:"id"`
Active bool `json:"active"`
Presentations []vc.VerifiablePresentation `json:"vps"`
}
120 changes: 63 additions & 57 deletions discovery/nuts_discovery_client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions discovery/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ func (i Service) ActivationStatus(ctx context.Context, serviceID string, subject
if response.JSON200 == nil {
return nil, errors.New("unable to get service activation")
}
return &DIDStatus{
ServiceID: serviceID,
Active: response.JSON200.Activated,
Presentation: response.JSON200.Vp,
}, nil
result := &DIDStatus{
ServiceID: serviceID,
Active: response.JSON200.Activated,
}
if response.JSON200.Vp != nil {
result.Presentations = *response.JSON200.Vp
}
return result, nil
}
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
NUTS_CRYPTO_STORAGE: fs
NUTS_HTTP_INTERNAL_ADDRESS: :8081
NUTS_URL: https://nuts.nl
NUTS_DISCOVERY_DEFINITIONS_DIRECTORY: /opt/nuts/discovery
# nuts-admin:
# build:
# context: .
Expand Down
Loading

0 comments on commit 94ac7e9

Please sign in to comment.