-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support HomeMonitoring use case (#474)
- Loading branch information
Showing
35 changed files
with
3,308 additions
and
1,388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.PHONY: dev | ||
|
||
run-generators: gen-api | ||
|
||
install-tools: | ||
go install github.com/deepmap/oapi-codegen/v2/cmd/[email protected] | ||
|
||
gen-api: | ||
npm run gen-api | ||
|
||
oapi-codegen -generate types -package types -o domain/types/generated_types.go api/api.yaml | ||
oapi-codegen -generate server -package api -o api/generated.go api/api.yaml | ||
oapi-codegen -generate client,types -package auth \ | ||
-import-mapping='../common/ssi_types.yaml:github.com/nuts-foundation/nuts-demo-ehr/nuts/client/common' \ | ||
-o nuts/client/auth/generated.go https://nuts-node.readthedocs.io/en/latest/_static/auth/v1.yaml | ||
oapi-codegen -generate client,types -package common -exclude-schemas VerifiableCredential,VerifiablePresentation,DID,DIDDocument -generate types,skip-prune -o nuts/client/common/generated.go https://nuts-node.readthedocs.io/en/latest/_static/common/ssi_types.yaml | ||
oapi-codegen -generate client,types -package discovery \ | ||
-import-mapping='../common/ssi_types.yaml:github.com/nuts-foundation/nuts-demo-ehr/nuts/client/common' \ | ||
-exclude-schemas SearchVCRequest,CredentialSubject \ | ||
-o nuts/client/discovery/generated.go https://nuts-node.readthedocs.io/en/latest/_static/discovery/v1.yaml | ||
oapi-codegen -generate client,types -package vcr \ | ||
-import-mapping='../common/ssi_types.yaml:github.com/nuts-foundation/nuts-demo-ehr/nuts/client/common' \ | ||
-exclude-schemas SearchVCRequest,CredentialSubject \ | ||
-o nuts/client/vcr/generated.go https://nuts-node.readthedocs.io/en/latest/_static/vcr/vcr_v2.yaml | ||
oapi-codegen -generate client,types -package didman \ | ||
-import-mapping='../common/ssi_types.yaml:github.com/nuts-foundation/nuts-demo-ehr/nuts/client/common' \ | ||
-o nuts/client/didman/generated.go -exclude-schemas OrganizationSearchResult https://nuts-node.readthedocs.io/en/latest/_static/didman/v1.yaml | ||
oapi-codegen -generate client,types -package vdr \ | ||
-import-mapping='../common/ssi_types.yaml:github.com/nuts-foundation/nuts-demo-ehr/nuts/client/common' \ | ||
-o nuts/client/vdr/generated.go https://nuts-node.readthedocs.io/en/latest/_static/vdr/v1.yaml | ||
oapi-codegen -generate client,types -package vdr_v2 \ | ||
-import-mapping='../common/ssi_types.yaml:github.com/nuts-foundation/nuts-demo-ehr/nuts/client/common' \ | ||
-o nuts/client/vdr_v2/generated.go https://nuts-node.readthedocs.io/en/latest/_static/vdr/v2.yaml | ||
oapi-codegen -generate client,types -package iam \ | ||
-import-mapping='../common/ssi_types.yaml:github.com/nuts-foundation/nuts-demo-ehr/nuts/client/common' \ | ||
-o nuts/client/iam/generated.go https://nuts-node.readthedocs.io/en/latest/_static/auth/iam.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package api | ||
|
||
import ( | ||
"github.com/labstack/echo/v4" | ||
"net/http" | ||
) | ||
|
||
func (w Wrapper) GetACL(ctx echo.Context, tenantDID string, authorizedDID string) error { | ||
authorizedResources, err := w.ACL.AuthorizedResources(ctx.Request().Context(), tenantDID, authorizedDID) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
result := make(map[string][]string) | ||
for _, resource := range authorizedResources { | ||
result[resource.Resource] = append(result[resource.Resource], resource.Operation) | ||
} | ||
|
||
return ctx.JSON(http.StatusOK, result) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.