diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..ae896ee3 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +.PHONY: dev + +run-generators: gen-api + +install-tools: + go install github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@v2.0.0 + +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 diff --git a/README.md b/README.md index 715f5eb5..615adf14 100644 --- a/README.md +++ b/README.md @@ -43,30 +43,7 @@ go run . live The API and domain types are generated from the `api/api.yaml`. ```shell -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 discovery \ - -import-mapping='../common/ssi_types.yaml:github.com/nuts-foundation/nuts-demo-ehr/nuts/client/common' \ - -o nuts/client/discovery/generated.go https://nuts-node.readthedocs.io/en/latest/_static/discovery/v1.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 -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 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 +make gen-api ``` ### Docker diff --git a/api/acl.go b/api/acl.go new file mode 100644 index 00000000..ffe7eb62 --- /dev/null +++ b/api/acl.go @@ -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) +} diff --git a/api/api.go b/api/api.go index d25b8c06..1b042e5b 100644 --- a/api/api.go +++ b/api/api.go @@ -3,6 +3,8 @@ package api import ( "encoding/json" "fmt" + "github.com/nuts-foundation/nuts-demo-ehr/domain" + "github.com/nuts-foundation/nuts-demo-ehr/domain/acl" "github.com/nuts-foundation/nuts-demo-ehr/domain/fhir" "net/http" "strconv" @@ -41,9 +43,8 @@ var _ ServerInterface = (*Wrapper)(nil) type Wrapper struct { APIAuth *Auth - NutsAuth nutsClient.Auth - NutsIam nutsClient.Iam - NutsDiscovery nutsClient.Discovery + ACL *acl.Repository + NutsClient *nutsClient.HTTPClient CustomerRepository customers.Repository PatientRepository patients.Repository ReportRepository reports.Repository @@ -53,6 +54,7 @@ type Wrapper struct { TransferSenderService sender.TransferService TransferReceiverService receiver.TransferService TransferReceiverRepo receiver.TransferRepository + ZorginzageService domain.ZorginzageService FHIRService fhir.Service EpisodeService episode.Service NotificationHandler notification.Handler @@ -115,7 +117,7 @@ func (w Wrapper) CreateAuthorizationRequest(ctx echo.Context) error { if err != nil { return ctx.JSON(http.StatusInternalServerError, errorResponse{err}) } - response, err := w.NutsIam.CreateAuthenticationRequest(*customer.Did) + response, err := w.NutsClient.CreateAuthenticationRequest(*customer.Did) if err != nil { return err } @@ -133,7 +135,7 @@ func (w Wrapper) GetOpenID4VPAuthenticationResult(ctx echo.Context, token string //if err != nil { // return ctx.JSON(http.StatusInternalServerError, errorResponse{err}) //} - response, err := w.NutsIam.GetAuthenticationResult(token) + response, err := w.NutsClient.GetAuthenticationResult(token) if err != nil { return err } @@ -153,7 +155,7 @@ func (w Wrapper) AuthenticateWithIRMA(ctx echo.Context) error { } // forward to node - bytes, err := w.NutsAuth.CreateIrmaSession(*customer.Did) + bytes, err := w.NutsClient.CreateIrmaSession(*customer.Did) if err != nil { return err } @@ -171,7 +173,7 @@ func (w Wrapper) GetIRMAAuthenticationResult(ctx echo.Context, sessionToken stri } // forward to node - sessionStatus, err := w.NutsAuth.GetIrmaSessionResult(sessionToken) + sessionStatus, err := w.NutsClient.GetIrmaSessionResult(sessionToken) if err != nil { return err } @@ -183,7 +185,7 @@ func (w Wrapper) GetIRMAAuthenticationResult(ctx echo.Context, sessionToken stri authSessionID, err := w.getSessionID(ctx) if err != nil { // No current session, create a new one. Introspect IRMA VP and extract properties for UserInfo. - userPresentation, err := w.NutsAuth.VerifyPresentation(*sessionStatus.VerifiablePresentation) + userPresentation, err := w.NutsClient.VerifyPresentation(*sessionStatus.VerifiablePresentation) if err != nil { return fmt.Errorf("unable to verify presentation: %w", err) } @@ -245,7 +247,7 @@ func (w Wrapper) AuthenticateWithEmployeeID(ctx echo.Context) error { "familyName": session.UserInfo.FamilyName, }, } - bytes, err := w.NutsAuth.CreateEmployeeIDSession(params) + bytes, err := w.NutsClient.CreateEmployeeIDSession(params) if err != nil { return err } @@ -268,7 +270,7 @@ func (w Wrapper) GetEmployeeIDAuthenticationResult(ctx echo.Context, sessionToke authSessionID, _ := w.getSessionID(ctx) // can't fail // forward to node - sessionStatus, err := w.NutsAuth.GetEmployeeIDSessionResult(sessionToken) + sessionStatus, err := w.NutsClient.GetEmployeeIDSessionResult(sessionToken) if err != nil { return err } @@ -306,7 +308,7 @@ func (w Wrapper) AuthenticateWithDummy(ctx echo.Context) error { return ctx.JSON(http.StatusInternalServerError, errorResponse{err}) } - bytes, err := w.NutsAuth.CreateDummySession(*customer.Did) + bytes, err := w.NutsClient.CreateDummySession(*customer.Did) if err != nil { return err } @@ -338,7 +340,7 @@ func (w Wrapper) GetDummyAuthenticationResult(ctx echo.Context, sessionToken str // for dummy, it takes a few request to get to status completed. for i := 0; i < 4; i++ { // forward to node - sessionResult, err = w.NutsAuth.GetDummySessionResult(sessionToken) + sessionResult, err = w.NutsClient.GetDummySessionResult(sessionToken) if err != nil { return err } diff --git a/api/api.yaml b/api/api.yaml index abf7e5cf..db801f77 100644 --- a/api/api.yaml +++ b/api/api.yaml @@ -592,41 +592,86 @@ paths: schema: $ref: "#/components/schemas/Patient" - /private/network/organizations: - get: + /private/network/discovery: + # Search has become a POST instead of GET, since it uses an object (query) as input, + # which OpenAPI Codegenerator does not handle properly for GET operations. + post: description: Searches for other care organizations on Nuts Network. operationId: searchOrganizations - parameters: - - name: query - in: query - description: Keyword for finding care organizations. - required: true - schema: - type: string - - name: didServiceType - in: query - description: > - Filters other care organizations on the Nuts Network on service, only returning care organizations have a service in their DID Document which' type matches the given didServiceType and not including your own. - If not supplied, care organizations aren't filtered on service. - required: false - schema: - type: string - - name: discoveryServiceType - in: query - description: > - Filters other care organizations on the Nuts Network on service, only returning care organizations that registered for the given service at a discovery server. - required: true - schema: - type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - query + properties: + query: + type: object + additionalProperties: + type: string + description: > + The search query, key-value string properties. E.g.: + 'credentialSubject.organization.name: Ziekenhuis' + discoveryServiceID: + description: > + Filters other care organizations on the Nuts Network, only returning care organizations that registered for the given Discovery Service. + It false, it will search on all Discovery Services. + type: string + didServiceType: + description: > + Filters other care organizations on the Nuts Network on service, only returning care organizations have a service in their DID Document which' type matches the given didServiceType and not including your own. + If not supplied, care organizations aren't filtered on service. + type: string + excludeOwn: + description: > + If true, the current care organization is excluded from the search results. + Defaults to false. + type: boolean responses: 200: description: Search successful. content: application/json: schema: - type: array - items: - $ref: "#/components/schemas/Organization" + type: object + additionalProperties: + type: array + items: + type: object + + /private/network/patient: + parameters: + - name: patientSSN + in: query + description: The patient's SSN + required: true + schema: + type: string + - name: remotePartyDID + in: query + description: The DID of the remote party. + required: true + schema: + type: string + - name: scope + in: query + description: The OAuth2 scope to request. + required: true + schema: + type: string + get: + description: Load the medical records of a patient at a remote XIS. + operationId: getRemotePatient + responses: + 200: + description: The patient's medical records from the remote XIS. + content: + application/json: + schema: + $ref: "#/components/schemas/RemotePatientFile" + /private/network/inbox: get: @@ -693,11 +738,8 @@ paths: schema: $ref: "#/components/schemas/Report" responses: - 200: + 204: description: The creation of the new report is completed - content: - applaction/json: - schema: /private/dossier/{patientID}: get: description: Get list of dossiers for a patient @@ -754,6 +796,45 @@ paths: 204: description: Notification processed successfully. + /internal/acl/{tenantDID}/{authorizedDID}: + parameters: + - name: tenantDID + in: path + description: The DID of the tenant who owns the resources + required: true + content: + plain/text: + schema: + type: string + example: did:web:example.com + - name: authorizedDID + in: path + description: The DID of the authorized party + required: true + content: + plain/text: + schema: + type: string + example: did:web:example.com + get: + description: | + Get all resource/operation combinations the authorized party was granted access to by the tenant. + + When a collaboration is initiated in the application, it registers the related FHIR resources on the ACL. + The Policy Decision Point (PDP) can then use this ACL to make authorization decisions. + An example consumer of this endpoint is Open Policy Agent using http.send() + operationId: getACL + responses: + 200: + description: The ACL for the tenant and authorized party + content: + application/json: + schema: + type: object + additionalProperties: + type: array + items: + type: string /internal/customer/{customerID}/task/{taskID}: parameters: - name: customerID @@ -951,6 +1032,7 @@ components: - name - city - did + - discoveryServices properties: name: description: Name of the care organization. @@ -961,6 +1043,12 @@ components: did: description: Decentralized Identifier which uniquely identifies the care organization on the Nuts Network. type: string + discoveryServices: + description: > + List of Discovery Services the care organization is registered with. + type: array + items: + type: string CreateTransferNegotiationRequest: description: An request object to create a new transfer negotiation. type: object @@ -1205,6 +1293,19 @@ components: status: description: State of the transfer request. Maps to FHIR task state. type: string + RemotePatientFile: + description: A patient file from a remote XIS. + required: + - patient + - observations + properties: + patient: + $ref: '#/components/schemas/Patient' + observations: + description: List of FHIR Observation resources for the patient. + type: array + items: + type: object Report: required: - id @@ -1289,4 +1390,4 @@ security: - bearerAuth: [ ] # Apply Bearer Auth to all endpoints servers: - - url: "/web" + - url: "./web" diff --git a/api/collaboration.go b/api/collaboration.go index b02baadd..7cb64cd7 100644 --- a/api/collaboration.go +++ b/api/collaboration.go @@ -2,6 +2,7 @@ package api import ( "errors" + "github.com/nuts-foundation/nuts-demo-ehr/domain/fhir" "github.com/nuts-foundation/nuts-demo-ehr/domain/types" "net/http" @@ -21,6 +22,12 @@ func (w Wrapper) CreateCollaboration(ctx echo.Context, dossierID string) error { if err != nil { return err } + if customer.Did == nil || *customer.Did == "" { + return errors.New("DID missing for customer") + } + if request.Sender.Did == "" { + return errors.New("DID missing for other party") + } dossier, err := w.DossierRepository.FindByID(ctx.Request().Context(), customer.Id, dossierID) if err != nil { @@ -42,6 +49,7 @@ func (w Wrapper) CreateCollaboration(ctx echo.Context, dossierID string) error { dossierID, *patient.Ssn, request.Sender.Did, + w.FHIRService.ClientFactory(fhir.WithTenant(customer.Id)), ); err != nil { return err } @@ -73,7 +81,9 @@ func (w Wrapper) GetCollaboration(ctx echo.Context, dossierID string) error { } // We want to find collaborations pointing to us, so we don't want to search on the customer DID - collaborations, err := w.EpisodeService.GetCollaborations(ctx.Request().Context(), "", dossierID, *patient.Ssn) + // TODO: We changed this API to showing organizations we shared this episode with, need to + // add another method that shows organizations that shared with us + collaborations, err := w.EpisodeService.GetCollaborations(ctx.Request().Context(), *customer.Did, dossierID, *patient.Ssn, w.FHIRService.ClientFactory(fhir.WithTenant(customer.Id))) if err != nil { return err } diff --git a/api/generated.go b/api/generated.go index 26d2b69c..32445d24 100644 --- a/api/generated.go +++ b/api/generated.go @@ -50,6 +50,9 @@ type ServerInterface interface { // (POST /external/transfer/notify/{taskID}) NotifyTransferUpdate(ctx echo.Context, taskID string) error + // (GET /internal/acl/{tenantDID}/{authorizedDID}) + GetACL(ctx echo.Context, tenantDID string, authorizedDID string) error + // (PUT /internal/customer/{customerID}/task/{taskID}) TaskUpdate(ctx echo.Context, customerID int, taskID string) error @@ -77,14 +80,17 @@ type ServerInterface interface { // (POST /private/episode/{episodeID}/collaboration) CreateCollaboration(ctx echo.Context, episodeID string) error + // (POST /private/network/discovery) + SearchOrganizations(ctx echo.Context) error + // (GET /private/network/inbox) GetInbox(ctx echo.Context) error // (GET /private/network/inbox/info) GetInboxInfo(ctx echo.Context) error - // (GET /private/network/organizations) - SearchOrganizations(ctx echo.Context, params SearchOrganizationsParams) error + // (GET /private/network/patient) + GetRemotePatient(ctx echo.Context, params GetRemotePatientParams) error // (GET /private/patient/{patientID}) GetPatient(ctx echo.Context, patientID string) error @@ -310,6 +316,26 @@ func (w *ServerInterfaceWrapper) NotifyTransferUpdate(ctx echo.Context) error { return err } +// GetACL converts echo context to params. +func (w *ServerInterfaceWrapper) GetACL(ctx echo.Context) error { + var err error + // ------------- Path parameter "tenantDID" ------------- + var tenantDID string + + tenantDID = ctx.Param("tenantDID") + + // ------------- Path parameter "authorizedDID" ------------- + var authorizedDID string + + authorizedDID = ctx.Param("authorizedDID") + + ctx.Set(BearerAuthScopes, []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetACL(ctx, tenantDID, authorizedDID) + return err +} + // TaskUpdate converts echo context to params. func (w *ServerInterfaceWrapper) TaskUpdate(ctx echo.Context) error { var err error @@ -452,6 +478,17 @@ func (w *ServerInterfaceWrapper) CreateCollaboration(ctx echo.Context) error { return err } +// SearchOrganizations converts echo context to params. +func (w *ServerInterfaceWrapper) SearchOrganizations(ctx echo.Context) error { + var err error + + ctx.Set(BearerAuthScopes, []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.SearchOrganizations(ctx) + return err +} + // GetInbox converts echo context to params. func (w *ServerInterfaceWrapper) GetInbox(ctx echo.Context) error { var err error @@ -474,37 +511,37 @@ func (w *ServerInterfaceWrapper) GetInboxInfo(ctx echo.Context) error { return err } -// SearchOrganizations converts echo context to params. -func (w *ServerInterfaceWrapper) SearchOrganizations(ctx echo.Context) error { +// GetRemotePatient converts echo context to params. +func (w *ServerInterfaceWrapper) GetRemotePatient(ctx echo.Context) error { var err error ctx.Set(BearerAuthScopes, []string{}) // Parameter object where we will unmarshal all parameters from the context - var params SearchOrganizationsParams - // ------------- Required query parameter "query" ------------- + var params GetRemotePatientParams + // ------------- Required query parameter "patientSSN" ------------- - err = runtime.BindQueryParameter("form", true, true, "query", ctx.QueryParams(), ¶ms.Query) + err = runtime.BindQueryParameter("form", true, true, "patientSSN", ctx.QueryParams(), ¶ms.PatientSSN) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter query: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter patientSSN: %s", err)) } - // ------------- Optional query parameter "didServiceType" ------------- + // ------------- Required query parameter "remotePartyDID" ------------- - err = runtime.BindQueryParameter("form", true, false, "didServiceType", ctx.QueryParams(), ¶ms.DidServiceType) + err = runtime.BindQueryParameter("form", true, true, "remotePartyDID", ctx.QueryParams(), ¶ms.RemotePartyDID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter didServiceType: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter remotePartyDID: %s", err)) } - // ------------- Required query parameter "discoveryServiceType" ------------- + // ------------- Required query parameter "scope" ------------- - err = runtime.BindQueryParameter("form", true, true, "discoveryServiceType", ctx.QueryParams(), ¶ms.DiscoveryServiceType) + err = runtime.BindQueryParameter("form", true, true, "scope", ctx.QueryParams(), ¶ms.Scope) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter discoveryServiceType: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter scope: %s", err)) } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.SearchOrganizations(ctx, params) + err = w.Handler.GetRemotePatient(ctx, params) return err } @@ -877,6 +914,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.POST(baseURL+"/auth/passwd", wrapper.AuthenticateWithPassword) router.GET(baseURL+"/customers", wrapper.ListCustomers) router.POST(baseURL+"/external/transfer/notify/:taskID", wrapper.NotifyTransferUpdate) + router.GET(baseURL+"/internal/acl/:tenantDID/:authorizedDID", wrapper.GetACL) router.PUT(baseURL+"/internal/customer/:customerID/task/:taskID", wrapper.TaskUpdate) router.GET(baseURL+"/private", wrapper.CheckSession) router.GET(baseURL+"/private/customer", wrapper.GetCustomer) @@ -886,9 +924,10 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/private/episode/:episodeID", wrapper.GetEpisode) router.GET(baseURL+"/private/episode/:episodeID/collaboration", wrapper.GetCollaboration) router.POST(baseURL+"/private/episode/:episodeID/collaboration", wrapper.CreateCollaboration) + router.POST(baseURL+"/private/network/discovery", wrapper.SearchOrganizations) router.GET(baseURL+"/private/network/inbox", wrapper.GetInbox) router.GET(baseURL+"/private/network/inbox/info", wrapper.GetInboxInfo) - router.GET(baseURL+"/private/network/organizations", wrapper.SearchOrganizations) + router.GET(baseURL+"/private/network/patient", wrapper.GetRemotePatient) router.GET(baseURL+"/private/patient/:patientID", wrapper.GetPatient) router.PUT(baseURL+"/private/patient/:patientID", wrapper.UpdatePatient) router.GET(baseURL+"/private/patients", wrapper.GetPatients) diff --git a/api/patient.go b/api/patient.go index 4a88d712..9e30bb15 100644 --- a/api/patient.go +++ b/api/patient.go @@ -2,6 +2,7 @@ package api import ( "errors" + "fmt" "net/http" "sort" "strings" @@ -17,6 +18,8 @@ type GetPatientsParams struct { Name *string `json:"name,omitempty"` } +type GetRemotePatientParams = types.GetRemotePatientParams + func (w Wrapper) GetPatients(ctx echo.Context, params GetPatientsParams) error { customerID, err := w.getCustomerID(ctx) if err != nil { @@ -97,7 +100,18 @@ func (w Wrapper) GetPatient(ctx echo.Context, patientID string) error { return ctx.NoContent(http.StatusNotFound) } return ctx.JSON(http.StatusOK, patient) +} +func (w Wrapper) GetRemotePatient(ctx echo.Context, params GetRemotePatientParams) error { + customer, err := w.getCustomer(ctx) + if err != nil { + return err + } + patient, err := w.ZorginzageService.RemotePatient(ctx.Request().Context(), *customer.Did, params.RemotePartyDID, params.PatientSSN) + if err != nil { + return fmt.Errorf("unable to load remote patient: %w", err) + } + return ctx.JSON(http.StatusOK, patient) } func (w Wrapper) getSessionID(ctx echo.Context) (string, error) { @@ -115,7 +129,7 @@ func (w Wrapper) getSession(ctx echo.Context) (*Session, error) { } session := w.APIAuth.GetSession(sessionID) if session == nil { - return nil, errors.New("unknown session ID") + return nil, echo.NewHTTPError(http.StatusUnauthorized, "unknown session ID") } sessionCopy := *session // Return copy return &sessionCopy, nil diff --git a/api/registry.go b/api/registry.go index 0db91cb8..067049cd 100644 --- a/api/registry.go +++ b/api/registry.go @@ -7,28 +7,33 @@ import ( "github.com/nuts-foundation/nuts-demo-ehr/domain/types" ) -type SearchOrganizationsParams = types.SearchOrganizationsParams - -func (w Wrapper) SearchOrganizations(ctx echo.Context, params SearchOrganizationsParams) error { +func (w Wrapper) SearchOrganizations(ctx echo.Context) error { customer, err := w.getCustomer(ctx) if err != nil { return err } - organizations, err := w.NutsDiscovery.SearchService(ctx.Request().Context(), params.Query, params.DiscoveryServiceType, params.DidServiceType) + var request types.SearchOrganizationsJSONRequestBody + if err := ctx.Bind(&request); err != nil { + return echo.NewHTTPError(http.StatusBadRequest, err) + } + organizations, err := w.NutsClient.SearchDiscoveryService(ctx.Request().Context(), request.Query, request.DiscoveryServiceID, request.DidServiceType) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err) } - var results = make([]types.Organization, 0) - + var results = make(map[string]types.Organization, 0) for _, organization := range organizations { // Hide our own organization - if organization.ID == *customer.Did { + if request.ExcludeOwn != nil && *request.ExcludeOwn && organization.ID == *customer.Did { continue } - - results = append(results, types.FromNutsOrganization(organization)) + current, exists := results[organization.ID] + if !exists { + current = types.FromNutsOrganization(organization.NutsOrganization) + } + current.DiscoveryServices = append(current.DiscoveryServices, organization.ServiceID) + results[organization.ID] = current } return ctx.JSON(http.StatusOK, results) diff --git a/domain/acl/repository.go b/domain/acl/repository.go new file mode 100644 index 00000000..e8cc777c --- /dev/null +++ b/domain/acl/repository.go @@ -0,0 +1,109 @@ +package acl + +import ( + "context" + "github.com/google/uuid" + "github.com/jmoiron/sqlx" + sqlUtil "github.com/nuts-foundation/nuts-demo-ehr/sql" +) + +type aclEntry struct { + ID string `db:"id"` + // TenantDID is the DID of the tenant that is granting access. It is the owner of the resource. + TenantDID string `db:"tenant_did"` + // AuthorizedDID is the DID of the entity that is being granted access + AuthorizedDID string `db:"authorized_did"` + Operation string `db:"operation"` + Resource string `db:"resource"` +} + +type AuthorizedResource struct { + Resource string + Operation string +} + +const schema = ` + CREATE TABLE IF NOT EXISTS acl ( + id char(36) NOT NULL, + tenant_did char(240) NOT NULL, + authorized_did char(240) NOT NULL, + operation char(50) NOT NULL, + resource varchar(400) NOT NULL, + PRIMARY KEY (id) + ); +` + +func NewRepository(db *sqlx.DB) (*Repository, error) { + tx, err := db.Beginx() + if err != nil { + return nil, err + } + tx.MustExec(schema) + if err := tx.Commit(); err != nil { + return nil, err + } + + return &Repository{}, nil +} + +type Repository struct { +} + +func (r Repository) GrantAccess(ctx context.Context, tenantDID, authorizedDID, operation string, resource string) error { + // First check whether the authorized does not already have access + if hasAccess, err := r.HasAccess(ctx, tenantDID, authorizedDID, operation, resource); err != nil { + return err + } else if hasAccess { + return nil + } + + const query = `INSERT INTO acl + (id, tenant_did, authorized_did, operation, resource) + VALUES (:id, :tenant_did, :authorized_did, :operation, :resource)` + tx, err := sqlUtil.GetTransaction(ctx) + if err != nil { + return err + } + _, err = tx.NamedExec(query, aclEntry{ + ID: uuid.NewString(), + TenantDID: tenantDID, + AuthorizedDID: authorizedDID, + Operation: operation, + Resource: resource, + }) + return err +} + +func (r Repository) AuthorizedResources(ctx context.Context, tenantDID, authorizedDID string) ([]AuthorizedResource, error) { + const query = `SELECT operation, resource FROM acl WHERE tenant_did = ? AND authorized_did = ?` + tx, err := sqlUtil.GetTransaction(ctx) + if err != nil { + return nil, err + } + var result []AuthorizedResource + err = tx.Select(&result, query, tenantDID, authorizedDID) + return result, err +} + +// AuthorizedParties returns the DIDs of the parties that are authorized to perform the given operation on the given resource +func (r Repository) AuthorizedParties(ctx context.Context, tenantDID, resource, operation string) ([]string, error) { + const query = `SELECT authorized_did FROM acl WHERE tenant_did = ? AND resource = ? AND operation = ?` + tx, err := sqlUtil.GetTransaction(ctx) + if err != nil { + return nil, err + } + var result []string + err = tx.Select(&result, query, tenantDID, resource, operation) + return result, err +} + +func (r Repository) HasAccess(ctx context.Context, tenantDID, authorizedDID, operation, resource string) (bool, error) { + const query = `SELECT COUNT(*) FROM acl WHERE tenant_did = ? AND authorized_did = ? AND operation = ? AND resource = ?` + tx, err := sqlUtil.GetTransaction(ctx) + if err != nil { + return false, err + } + var count int + err = tx.Get(&count, query, tenantDID, authorizedDID, operation, resource) + return count > 0, err +} diff --git a/domain/episode/service.go b/domain/episode/service.go index 5a981cf0..825ecb71 100644 --- a/domain/episode/service.go +++ b/domain/episode/service.go @@ -4,6 +4,10 @@ import ( "context" "errors" "fmt" + "github.com/nuts-foundation/nuts-demo-ehr/domain/acl" + nutsClient "github.com/nuts-foundation/nuts-demo-ehr/nuts/client" + "github.com/sirupsen/logrus" + "net/url" "strings" "github.com/monarko/fhirgo/STU3/resources" @@ -14,23 +18,22 @@ import ( "github.com/nuts-foundation/nuts-demo-ehr/domain/types" "github.com/nuts-foundation/nuts-demo-ehr/http/auth" "github.com/nuts-foundation/nuts-demo-ehr/nuts/registry" - "github.com/nuts-foundation/nuts-node/vcr/credential" ) type Service interface { Create(ctx context.Context, customerID int, patientID string, request types.CreateEpisodeRequest) (*types.Episode, error) Get(ctx context.Context, customerID int, dossierID string) (*types.Episode, error) GetReports(ctx context.Context, customerDID, patientSSN string) ([]types.Report, error) - CreateCollaboration(ctx context.Context, customerDID, dossierID, patientSSN, senderDID string) error - GetCollaborations(ctx context.Context, customerDID, dossierID, patientSSN string) ([]types.Collaboration, error) + CreateCollaboration(ctx context.Context, customerDID, dossierID, patientSSN, senderDID string, client fhir.Client) error + GetCollaborations(ctx context.Context, customerDID, dossierID, patientSSN string, client fhir.Client) ([]types.Collaboration, error) } func ssnURN(ssn string) string { return fmt.Sprintf("urn:oid:2.16.840.1.113883.2.4.6.3:%s", ssn) } -func parseAuthCredentialSubject(authCredential vc.VerifiableCredential) (*credential.NutsAuthorizationCredentialSubject, error) { - subject := make([]credential.NutsAuthorizationCredentialSubject, 0) +func parseAuthCredentialSubject(authCredential vc.VerifiableCredential) (*registry.NutsAuthorizationCredentialSubject, error) { + subject := make([]registry.NutsAuthorizationCredentialSubject, 0) if err := authCredential.UnmarshalCredentialSubject(&subject); err != nil { return nil, fmt.Errorf("invalid content for NutsAuthorizationCredential credentialSubject: %w", err) @@ -40,14 +43,16 @@ func parseAuthCredentialSubject(authCredential vc.VerifiableCredential) (*creden } type service struct { - factory fhir.Factory - auth auth.Service - registry registry.OrganizationRegistry - vcr registry.VerifiableCredentialRegistry + factory fhir.Factory + auth auth.Service + aclRepository *acl.Repository + nutsClient nutsClient.HTTPClient + registry registry.OrganizationRegistry + vcr registry.VerifiableCredentialRegistry } -func NewService(factory fhir.Factory, auth auth.Service, registry registry.OrganizationRegistry, vcr registry.VerifiableCredentialRegistry) Service { - return &service{factory: factory, auth: auth, registry: registry, vcr: vcr} +func NewService(factory fhir.Factory, auth auth.Service, registry registry.OrganizationRegistry, vcr registry.VerifiableCredentialRegistry, aclRepository *acl.Repository) Service { + return &service{factory: factory, auth: auth, registry: registry, vcr: vcr, aclRepository: aclRepository} } func parseEpisodeOfCareID(authCredential vc.VerifiableCredential) (string, error) { @@ -87,66 +92,96 @@ func (service *service) Get(ctx context.Context, customerID int, dossierID strin return zorginzage.ToEpisode(episode), nil } -func (service *service) CreateCollaboration(ctx context.Context, customerDID, dossierID, patientSSN, senderDID string) error { - subject := ssnURN(patientSSN) - - return service.vcr.CreateAuthorizationCredential(ctx, customerDID, &credential.NutsAuthorizationCredentialSubject{ - ID: senderDID, - Subject: &subject, - PurposeOfUse: zorginzage.ServiceName, - Resources: []credential.Resource{ - { - Path: fmt.Sprintf("/EpisodeOfCare/%s", dossierID), - Operations: []string{"read"}, - }, +func (service *service) CreateCollaboration(ctx context.Context, customerDID, dossierID, patientSSN, senderDID string, client fhir.Client) error { + // TODO: Need to formalize this in a use case specification + type authorizedResource struct { + Path string + Parameters map[string]string + Operations []string + } + authorizedResources := []authorizedResource{ + { + Path: "Patient", + Parameters: map[string]string{"identifier": patientSSN}, + Operations: []string{"read"}, + }, + // TODO: Do we need this particular one? + { + Path: fmt.Sprintf("/EpisodeOfCare/%s", dossierID), + Operations: []string{"read"}, + }, + { + Path: "/EpisodeOfCare", + Parameters: map[string]string{"patient.identifier": patientSSN}, + Operations: []string{"read"}, + }, + { + Path: "/Observation", + Parameters: map[string]string{"patient.identifier": patientSSN}, + Operations: []string{"read"}, }, - }) -} - -func (service *service) GetCollaborations(ctx context.Context, customerDID, dossierID, patientSSN string) ([]types.Collaboration, error) { - params := ®istry.VCRSearchParams{ - PurposeOfUse: zorginzage.ServiceName, - Subject: ssnURN(patientSSN), - ResourcePath: fmt.Sprintf("/EpisodeOfCare/%s", dossierID), } - - if customerDID != "" { - params.SubjectID = customerDID + for _, resource := range authorizedResources { + resourceURL := buildResourcePath(client, resource.Path, resource.Parameters) + for _, op := range resource.Operations { + if err := service.aclRepository.GrantAccess(ctx, customerDID, senderDID, op, resourceURL); err != nil { + return err + } + } } + return nil +} - credentials, err := service.vcr.FindAuthorizationCredentials( - ctx, - params, - ) - if err != nil { - return nil, err +func buildResourcePath(client fhir.Client, resourcePath string, query map[string]string) string { + resourceURL := client.BuildRequestURI(resourcePath) + resourceURL.Host = "" + resourceURL.Scheme = "" + if len(query) > 0 { + values := url.Values{} + for key, value := range query { + values.Add(key, value) + } + resourceURL.RawQuery = values.Encode() } + return resourceURL.String() +} - var subjects []credential.NutsAuthorizationCredentialSubject - - for _, authCredential := range credentials { - subject, err := parseAuthCredentialSubject(authCredential) +func (service *service) GetCollaborations(ctx context.Context, customerDID, dossierID, patientSSN string, client fhir.Client) ([]types.Collaboration, error) { + // Find collaborators given the parties that have access to relevant FHIR resources + searchResources := []string{ + buildResourcePath(client, "EpisodeOfCare/"+dossierID, nil), + } + authorizedDIDs := make(map[string]struct{}) + for _, resource := range searchResources { + dids, err := service.aclRepository.AuthorizedParties(ctx, customerDID, resource, "read") if err != nil { return nil, err } - - subjects = append(subjects, *subject) + for _, did := range dids { + authorizedDIDs[did] = struct{}{} + } } - episodeID := types.ObjectID(dossierID) + episodeID := dossierID var collaborations []types.Collaboration - for _, subject := range subjects { - org, err := service.registry.Get(ctx, subject.ID) + for authorizedDID, _ := range authorizedDIDs { + org, err := service.registry.Get(ctx, authorizedDID) if err != nil { - return nil, err + logrus.WithError(err).Warn("Error looking up episode collaborator organization") + collaborations = append(collaborations, types.Collaboration{ + EpisodeID: episodeID, + OrganizationDID: authorizedDID, + OrganizationName: "!ERROR! " + err.Error(), + }) + } else { + collaborations = append(collaborations, types.Collaboration{ + EpisodeID: episodeID, + OrganizationDID: authorizedDID, + OrganizationName: org.Details.Name, + }) } - collaborations = append(collaborations, types.Collaboration{ - EpisodeID: episodeID, - OrganizationDID: subject.ID, - OrganizationName: org.Details.Name, - }) } return collaborations, nil diff --git a/domain/fhir/client.go b/domain/fhir/client.go index 3d98c1a4..23e2a5bf 100644 --- a/domain/fhir/client.go +++ b/domain/fhir/client.go @@ -65,6 +65,7 @@ type Client interface { CreateOrUpdate(ctx context.Context, resource interface{}) error ReadMultiple(ctx context.Context, path string, params map[string]string, results interface{}) error ReadOne(ctx context.Context, path string, result interface{}) error + BuildRequestURI(fhirResourcePath string) *url.URL } type httpClient struct { @@ -80,8 +81,8 @@ func (h httpClient) CreateOrUpdate(ctx context.Context, resource interface{}) er if err != nil { return fmt.Errorf("unable to determine resource path: %w", err) } - requestURI := h.buildRequestURI(resourcePath) - resp, err := h.restClient.R().SetBody(resource).SetContext(ctx).Put(requestURI) + requestURI := h.BuildRequestURI(resourcePath) + resp, err := h.restClient.R().SetBody(resource).SetContext(ctx).Put(requestURI.String()) if err != nil { return fmt.Errorf("unable to write FHIR resource (path=%s): %w", requestURI, err) } @@ -123,9 +124,9 @@ func (h httpClient) ReadOne(ctx context.Context, path string, result interface{} } func (h httpClient) getResource(ctx context.Context, path string, params map[string]string) (gjson.Result, error) { - url := h.buildRequestURI(path) + url := h.BuildRequestURI(path) logrus.Debugf("Performing FHIR request with url: %s", url) - resp, err := h.restClient.R().SetQueryParams(params).SetContext(ctx).SetHeader("Cache-Control", "no-cache").Get(url) + resp, err := h.restClient.R().SetQueryParams(params).SetContext(ctx).SetHeader("Cache-Control", "no-cache").Get(url.String()) if err != nil { return gjson.Result{}, err } @@ -140,7 +141,7 @@ func (h httpClient) getResource(ctx context.Context, path string, params map[str return gjson.ParseBytes(body), nil } -func (h httpClient) buildRequestURI(fhirResourcePath string) string { +func (h httpClient) BuildRequestURI(fhirResourcePath string) *url.URL { if !h.multiTenancyEnabled { return buildRequestURI(h.url, "", fhirResourcePath) } @@ -165,9 +166,8 @@ func resolveResourcePath(resource interface{}) (string, error) { return resourceType + "/" + resourceID, nil } -func buildRequestURI(baseURL string, tenant string, resourcePath string) string { +func buildRequestURI(baseURL string, tenant string, resourcePath string) *url.URL { parsedBaseURL, _ := url.Parse(baseURL) - parsedBaseURL.Path = path.Join("/", parsedBaseURL.Path, tenant, resourcePath) - - return parsedBaseURL.String() + parsedBaseURL, _ = parsedBaseURL.Parse(path.Join("/", parsedBaseURL.Path, tenant, resourcePath)) + return parsedBaseURL } diff --git a/domain/fhir/environment.go b/domain/fhir/environment.go index 6bacbb4c..5a5d12a0 100644 --- a/domain/fhir/environment.go +++ b/domain/fhir/environment.go @@ -13,7 +13,7 @@ func InitializeTenant(fhirServerURL string, tenant string) error { restClient := resty.New() // Check if tenant already exists - response, err := restClient.R().SetQueryParam("id", tenant).Get(buildRequestURI(fhirServerURL, "DEFAULT", "$partition-management-read-partition")) + response, err := restClient.R().SetQueryParam("id", tenant).Get(buildRequestURI(fhirServerURL, "DEFAULT", "$partition-management-read-partition").String()) if err != nil { return err } @@ -39,7 +39,7 @@ func InitializeTenant(fhirServerURL string, tenant string) error { {Name: ToStringPtr("name"), ValueCode: ToCodePtr(tenant)}, }, } - response, err = restClient.R().SetHeader("Content-Type", "application/json").SetBody(parameters).Post(buildRequestURI(fhirServerURL, "DEFAULT", "$partition-management-create-partition")) + response, err = restClient.R().SetHeader("Content-Type", "application/json").SetBody(parameters).Post(buildRequestURI(fhirServerURL, "DEFAULT", "$partition-management-create-partition").String()) if err != nil { return fmt.Errorf("unable create new HAPI FHIR Server partition: %w", err) } diff --git a/domain/transfer/sender/service.go b/domain/transfer/sender/service.go index c50bfaf3..6a22649f 100644 --- a/domain/transfer/sender/service.go +++ b/domain/transfer/sender/service.go @@ -10,7 +10,6 @@ import ( "github.com/avast/retry-go/v4" sqlUtil "github.com/nuts-foundation/nuts-demo-ehr/sql" - "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/sirupsen/logrus" "github.com/nuts-foundation/nuts-demo-ehr/domain/customers" @@ -184,7 +183,7 @@ func (s service) CreateNegotiation(ctx context.Context, customerID int, transfer } // Build the list of resources for the authorization credential: - authorizedResources := []credential.Resource{ + authorizedResources := []registry.Resource{ { Path: fmt.Sprintf("/Task/%s", transferTask.ID), Operations: []string{"read", "update"}, @@ -203,7 +202,7 @@ func (s service) CreateNegotiation(ctx context.Context, customerID int, transfer // Include subject reference (patient) resourcePaths = append(resourcePaths, fhir.FromStringPtr(composition.Subject.Reference)) for _, path := range resourcePaths { - authorizedResources = append(authorizedResources, credential.Resource{ + authorizedResources = append(authorizedResources, registry.Resource{ Path: path, Operations: []string{"read", "document"}, UserContext: true, @@ -211,7 +210,7 @@ func (s service) CreateNegotiation(ctx context.Context, customerID int, transfer }) } - if err := s.vcr.CreateAuthorizationCredential(ctx, *customer.Did, &credential.NutsAuthorizationCredentialSubject{ + if err := s.vcr.CreateAuthorizationCredential(ctx, *customer.Did, ®istry.NutsAuthorizationCredentialSubject{ ID: organizationDID, PurposeOfUse: transfer.SenderServiceName, Resources: authorizedResources, @@ -342,7 +341,7 @@ func (s service) ConfirmNegotiation(ctx context.Context, customerID int, transfe return nil, fmt.Errorf("unable to confirm negotiation: could not revoke advance notice authorization credential: %w", err) } - authorizedResources := []credential.Resource{ + authorizedResources := []registry.Resource{ { Path: fmt.Sprintf("/Task/%s", negotiation.TaskID), Operations: []string{"read", "update"}, @@ -362,7 +361,7 @@ func (s service) ConfirmNegotiation(ctx context.Context, customerID int, transfe if _, exists := processedPaths[path]; exists { continue } - authorizedResources = append(authorizedResources, credential.Resource{ + authorizedResources = append(authorizedResources, registry.Resource{ Path: path, Operations: []string{"read", "document"}, UserContext: true, @@ -372,7 +371,7 @@ func (s service) ConfirmNegotiation(ctx context.Context, customerID int, transfe } // Create a new AuthorizationCredential for the Task, AdvanceNotice and NursingHandoff - if err = s.vcr.CreateAuthorizationCredential(ctx, *customer.Did, &credential.NutsAuthorizationCredentialSubject{ + if err = s.vcr.CreateAuthorizationCredential(ctx, *customer.Did, ®istry.NutsAuthorizationCredentialSubject{ ID: negotiation.OrganizationDID, PurposeOfUse: transfer.SenderServiceName, Resources: authorizedResources, @@ -712,7 +711,7 @@ func (s service) AssignTransfer(ctx context.Context, customerID int, transferID, func (s service) createAuthCredentials(ctx context.Context, transferTask *eoverdracht.TransferTask, nursingHandoffComposition *fhir.Composition, customerDID, organizationDID string) error { // Create an Auth Credential for the Task authorizedTask := s.taskForNursingHandoff(transferTask.ID) - if err := s.vcr.CreateAuthorizationCredential(ctx, customerDID, &credential.NutsAuthorizationCredentialSubject{ + if err := s.vcr.CreateAuthorizationCredential(ctx, customerDID, ®istry.NutsAuthorizationCredentialSubject{ ID: organizationDID, PurposeOfUse: transfer.SenderServiceName, Resources: authorizedTask, @@ -723,7 +722,7 @@ func (s service) createAuthCredentials(ctx context.Context, transferTask *eoverd // Build the list of resources for the authorization credential: authorizedResources := s.resourcesForNursingHandoff(nursingHandoffComposition) - if err := s.vcr.CreateAuthorizationCredential(ctx, customerDID, &credential.NutsAuthorizationCredentialSubject{ + if err := s.vcr.CreateAuthorizationCredential(ctx, customerDID, ®istry.NutsAuthorizationCredentialSubject{ ID: organizationDID, PurposeOfUse: transfer.SenderServiceName, Resources: authorizedResources, @@ -752,8 +751,8 @@ func (s service) advanceNoticeToNursingHandoff(ctx context.Context, customerID i return &nursingHandoffComposition, err } -func (s service) taskForNursingHandoff(taskID string) []credential.Resource { - return []credential.Resource{ +func (s service) taskForNursingHandoff(taskID string) []registry.Resource { + return []registry.Resource{ { Path: fmt.Sprintf("/Task/%s", taskID), Operations: []string{"read", "update"}, @@ -761,8 +760,8 @@ func (s service) taskForNursingHandoff(taskID string) []credential.Resource { } } -func (s service) resourcesForNursingHandoff(nursingHandoffComposition *fhir.Composition) []credential.Resource { - authorizedResources := []credential.Resource{ +func (s service) resourcesForNursingHandoff(nursingHandoffComposition *fhir.Composition) []registry.Resource { + authorizedResources := []registry.Resource{ { Path: fmt.Sprintf("/Composition/%s", fhir.FromIDPtr(nursingHandoffComposition.ID)), Operations: []string{"read", "document"}, @@ -779,7 +778,7 @@ func (s service) resourcesForNursingHandoff(nursingHandoffComposition *fhir.Comp // Add paths of resources of both the advance notice and the nursing handoff resourcePaths := resourcePathsFromSection(nursingHandoffComposition.Section, []string{}) for _, path := range resourcePaths { - authorizedResources = append(authorizedResources, credential.Resource{ + authorizedResources = append(authorizedResources, registry.Resource{ Path: path, Operations: []string{"read"}, UserContext: true, diff --git a/domain/types/generated_types.go b/domain/types/generated_types.go index 31e79e28..a010740a 100644 --- a/domain/types/generated_types.go +++ b/domain/types/generated_types.go @@ -235,6 +235,9 @@ type Organization struct { // Did Decentralized Identifier which uniquely identifies the care organization on the Nuts Network. Did string `json:"did"` + // DiscoveryServices List of Discovery Services the care organization is registered with. + DiscoveryServices []string `json:"discoveryServices"` + // Name Name of the care organization. Name string `json:"name"` } @@ -320,6 +323,13 @@ type Problem struct { // ProblemStatus defines model for Problem.Status. type ProblemStatus string +// RemotePatientFile A patient file from a remote XIS. +type RemotePatientFile struct { + // Observations List of FHIR Observation resources for the patient. + Observations []map[string]interface{} `json:"observations"` + Patient Patient `json:"patient"` +} + // Report defines model for Report. type Report struct { // EpisodeID An internal object UUID which can be used as unique identifier for entities. @@ -451,16 +461,31 @@ type TransferRequest struct { TransferDate *openapi_types.Date `json:"transferDate,omitempty"` } -// SearchOrganizationsParams defines parameters for SearchOrganizations. -type SearchOrganizationsParams struct { - // Query Keyword for finding care organizations. - Query string `form:"query" json:"query"` - +// SearchOrganizationsJSONBody defines parameters for SearchOrganizations. +type SearchOrganizationsJSONBody struct { // DidServiceType Filters other care organizations on the Nuts Network on service, only returning care organizations have a service in their DID Document which' type matches the given didServiceType and not including your own. If not supplied, care organizations aren't filtered on service. - DidServiceType *string `form:"didServiceType,omitempty" json:"didServiceType,omitempty"` + DidServiceType *string `json:"didServiceType,omitempty"` + + // DiscoveryServiceID Filters other care organizations on the Nuts Network, only returning care organizations that registered for the given Discovery Service. It false, it will search on all Discovery Services. + DiscoveryServiceID *string `json:"discoveryServiceID,omitempty"` + + // ExcludeOwn If true, the current care organization is excluded from the search results. Defaults to false. + ExcludeOwn *bool `json:"excludeOwn,omitempty"` - // DiscoveryServiceType Filters other care organizations on the Nuts Network on service, only returning care organizations that registered for the given service at a discovery server. - DiscoveryServiceType string `form:"discoveryServiceType" json:"discoveryServiceType"` + // Query The search query, key-value string properties. E.g.: 'credentialSubject.organization.name: Ziekenhuis' + Query map[string]string `json:"query"` +} + +// GetRemotePatientParams defines parameters for GetRemotePatient. +type GetRemotePatientParams struct { + // PatientSSN The patient's SSN + PatientSSN string `form:"patientSSN" json:"patientSSN"` + + // RemotePartyDID The DID of the remote party. + RemotePartyDID string `form:"remotePartyDID" json:"remotePartyDID"` + + // Scope The OAuth2 scope to request. + Scope string `form:"scope" json:"scope"` } // GetPatientsParams defines parameters for GetPatients. @@ -496,6 +521,9 @@ type CreateEpisodeJSONRequestBody = CreateEpisodeRequest // CreateCollaborationJSONRequestBody defines body for CreateCollaboration for application/json ContentType. type CreateCollaborationJSONRequestBody = CreateCollaborationRequest +// SearchOrganizationsJSONRequestBody defines body for SearchOrganizations for application/json ContentType. +type SearchOrganizationsJSONRequestBody SearchOrganizationsJSONBody + // UpdatePatientJSONRequestBody defines body for UpdatePatient for application/json ContentType. type UpdatePatientJSONRequestBody = PatientProperties diff --git a/domain/zorginzage.go b/domain/zorginzage.go new file mode 100644 index 00000000..dc01de7a --- /dev/null +++ b/domain/zorginzage.go @@ -0,0 +1,77 @@ +package domain + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "github.com/monarko/fhirgo/STU3/resources" + "github.com/nuts-foundation/nuts-demo-ehr/domain/fhir" + "github.com/nuts-foundation/nuts-demo-ehr/domain/patients" + "github.com/nuts-foundation/nuts-demo-ehr/domain/types" + nutsClient "github.com/nuts-foundation/nuts-demo-ehr/nuts/client" + "net/url" +) + +type ZorginzageService struct { + NutsClient *nutsClient.HTTPClient +} + +func (z ZorginzageService) RemotePatient(ctx context.Context, localDID, remotePartyDID string, patientSSN string) (*types.RemotePatientFile, error) { + fhirClient, err := z.fhirClient(ctx, localDID, remotePartyDID, "homemonitoring", "homemonitoring") + if err != nil { + return nil, err + } + + var result types.RemotePatientFile + // Load Patient resource + searchResult := resources.Bundle{} + if err = fhirClient.ReadOne(ctx, "Patient?identifier="+url.QueryEscape(patientSSN), &searchResult); err != nil { + return nil, fmt.Errorf("unable to read remote Patient resource: %w", err) + } + patientBundle, err := searchResult.Transform("Patient") + if err != nil { + return nil, fmt.Errorf("unable to transform search result FHIR Bundle into Bundle with Patients: %w", err) + } + if len(patientBundle.Entry) == 0 { + return nil, errors.New("patient not found at remote FHIR server") + } + result.Patient = patients.ToDomainPatient(patientBundle.Entry[0].Resource.(resources.Patient)) + // Load Observation resources + if err = fhirClient.ReadOne(ctx, "Observation?patient.identifier="+url.QueryEscape(patientSSN), &searchResult); err != nil { + return nil, fmt.Errorf("unable to read remote Observation resources for patient: %w", err) + } + observationBundle, err := searchResult.Transform("Observation") + if err != nil { + return nil, fmt.Errorf("unable to transform search result FHIR Bundle into Bundle with Observations: %w", err) + } + for _, entry := range observationBundle.Entry { + // remarshal into map + observationJSON, _ := json.Marshal(entry.Resource.(resources.Observation)) + observation := make(map[string]interface{}, 0) + _ = json.Unmarshal(observationJSON, &observation) + result.Observations = append(result.Observations, observation) + } + return &result, nil +} + +func (z ZorginzageService) fhirClient(ctx context.Context, localDID string, remotePartyDID string, scope string, serviceName string) (fhir.Client, error) { + endpointsInterf, err := z.NutsClient.ResolveServiceEndpoint(ctx, remotePartyDID, serviceName, "object") + if err != nil { + return nil, fmt.Errorf("resolve DID service (DID=%s, service=%s): %w", remotePartyDID, serviceName, err) + } + endpoints := endpointsInterf.(map[string]interface{}) + fhirEndpointInterf := endpoints["fhir"] + if fhirEndpointInterf == nil { + return nil, fmt.Errorf("remote XIS does not have its FHIR endpoint registered (DID=%s)", remotePartyDID) + } + fhirEndpoint, ok := fhirEndpointInterf.(string) + if !ok { + return nil, fmt.Errorf("FHIR endpoint is not a string (DID=%s)", remotePartyDID) + } + accessToken, err := z.NutsClient.RequestServiceAccessToken(ctx, localDID, remotePartyDID, scope) + if err != nil { + return nil, fmt.Errorf("unable to get access token (DID=%s,scope=%s): %w", remotePartyDID, scope, err) + } + return fhir.NewFactory(fhir.WithURL(fhirEndpoint), fhir.WithAuthToken(accessToken))(), nil +} diff --git a/go.mod b/go.mod index adf342fc..5d879d2a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.22 require ( github.com/avast/retry-go/v4 v4.5.1 - github.com/deepmap/oapi-codegen v1.16.2 github.com/go-resty/resty/v2 v2.11.0 github.com/golang-jwt/jwt v3.2.2+incompatible github.com/google/uuid v1.6.0 @@ -16,8 +15,8 @@ require ( github.com/lestrrat-go/jwx/v2 v2.0.21 github.com/mattn/go-sqlite3 v2.0.3+incompatible github.com/monarko/fhirgo v0.0.0-20200616214506-ca0a03fb1f7a - github.com/nuts-foundation/go-did v0.12.0 - github.com/nuts-foundation/nuts-node v1.0.1-0.20240211124130-dcf636dfc035 + github.com/nuts-foundation/go-did v0.13.0 + github.com/oapi-codegen/runtime v1.1.1 github.com/sirupsen/logrus v1.9.3 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 @@ -26,74 +25,14 @@ require ( ) require ( - github.com/BurntSushi/toml v1.3.2 // indirect - github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect - github.com/CloudyKit/jet/v6 v6.2.0 // indirect - github.com/Joker/jade v1.1.3 // indirect - github.com/PaesslerAG/gval v1.2.2 // indirect - github.com/PaesslerAG/jsonpath v0.1.2-0.20230323094847-3484786d6f97 // indirect - github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect - github.com/amacneil/dbmate/v2 v2.11.0 // indirect - github.com/andybalholm/brotli v1.1.0 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect - github.com/aymerick/douceur v0.2.0 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/bytedance/sonic v1.10.0-rc3 // indirect - github.com/cenkalti/backoff/v3 v3.0.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect - github.com/chenzhuoyu/iasm v0.9.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/dlclark/regexp2 v1.10.0 // indirect - github.com/fatih/structs v1.1.0 // indirect - github.com/flosch/pongo2/v4 v4.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/gin-gonic/gin v1.9.1 // indirect - github.com/go-jose/go-jose/v3 v3.0.3 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.14.1 // indirect - github.com/go-redsync/redsync/v4 v4.8.1 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/goccy/go-json v0.10.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/gomarkdown/markdown v0.0.0-20230922112808-5421fefb8386 // indirect - github.com/gorilla/css v1.0.0 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.2.1 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.1 // indirect - github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect - github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect - github.com/hashicorp/go-sockaddr v1.0.2 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/vault/api v1.12.0 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/iris-contrib/schema v0.0.6 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/jackc/pgx/v5 v5.5.4 // indirect - github.com/jackc/puddle/v2 v2.2.1 // indirect - github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jinzhu/now v1.1.5 // indirect - github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/kataras/blocks v0.0.7 // indirect - github.com/kataras/golog v0.1.9 // indirect - github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9 // indirect - github.com/kataras/pio v0.0.12 // indirect - github.com/kataras/sitemap v0.0.6 // indirect - github.com/kataras/tunnel v0.0.4 // indirect - github.com/klauspost/compress v1.17.5 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect - github.com/leodido/go-urn v1.2.4 // indirect + github.com/joho/godotenv v1.5.1 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect github.com/lestrrat-go/blackmagic v1.0.2 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect @@ -101,82 +40,32 @@ require ( github.com/lestrrat-go/iter v1.0.2 // indirect github.com/lestrrat-go/option v1.0.1 // indirect github.com/lib/pq v1.10.9 // indirect - github.com/mailgun/raymond/v2 v2.0.48 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect - github.com/microcosm-cc/bluemonday v1.0.25 // indirect - github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/multiformats/go-base32 v0.0.3 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-multibase v0.2.0 // indirect - github.com/multiformats/go-multicodec v0.9.0 // indirect - github.com/nats-io/jwt/v2 v2.5.3 // indirect - github.com/nats-io/nats-server/v2 v2.10.10 // indirect - github.com/nats-io/nats.go v1.32.0 // indirect - github.com/nats-io/nkeys v0.4.7 // indirect - github.com/nats-io/nuid v1.0.1 // indirect - github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b // indirect - github.com/nuts-foundation/go-leia/v4 v4.0.1 // indirect - github.com/nuts-foundation/go-stoabs v1.9.0 // indirect - github.com/oapi-codegen/runtime v1.1.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.9 // indirect - github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/redis/go-redis/v9 v9.4.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/ryanuber/go-glob v1.0.0 // indirect - github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect - github.com/schollz/closestmatch v2.1.0+incompatible // indirect + github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/segmentio/asm v1.2.0 // indirect github.com/shengdoushi/base58 v1.0.0 // indirect - github.com/shopspring/decimal v1.3.1 // indirect - github.com/spf13/cobra v1.8.0 // indirect - github.com/tdewolff/minify/v2 v2.12.9 // indirect - github.com/tdewolff/parse/v2 v2.6.8 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/twmb/murmur3 v1.1.8 // indirect - github.com/ugorji/go/codec v1.2.11 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect - github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect - github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - github.com/yosssi/ace v0.0.5 // indirect - go.etcd.io/bbolt v1.3.8 // indirect - go.uber.org/mock v0.4.0 // indirect - golang.org/x/arch v0.4.0 // indirect golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect - google.golang.org/grpc v1.61.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gorm.io/driver/postgres v1.5.6 // indirect - gorm.io/driver/sqlite v1.5.5 // indirect - gorm.io/gorm v1.25.7 // indirect - schneider.vip/problem v1.9.1 // indirect ) diff --git a/go.sum b/go.sum index 856e29aa..f7334c76 100644 --- a/go.sum +++ b/go.sum @@ -1,39 +1,12 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v6 v6.2.0 h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME= -github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4= -github.com/Joker/hpp v1.0.0 h1:65+iuJYdRXv/XyN62C1uEmmOx3432rNG/rKlX6V7Kkc= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Joker/jade v1.1.3 h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk= -github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM= -github.com/PaesslerAG/gval v1.2.2 h1:Y7iBzhgE09IGTt5QgGQ2IdaYYYOU134YGHBThD+wm9E= -github.com/PaesslerAG/gval v1.2.2/go.mod h1:XRFLwvmkTEdYziLdaCeCa5ImcGVrfQbeNUbVR+C6xac= -github.com/PaesslerAG/jsonpath v0.1.0/go.mod h1:4BzmtoM/PI8fPO4aQGIusjGxGir2BzcV0grWtFzq1Y8= -github.com/PaesslerAG/jsonpath v0.1.2-0.20230323094847-3484786d6f97 h1:XIsQOSBJi/9Bexr+rjUpuYi0IkQ+YqNKKlE7Yt/sw9Q= -github.com/PaesslerAG/jsonpath v0.1.2-0.20230323094847-3484786d6f97/go.mod h1:zTyVtYhYjcHpfCtqnCMxejgp0pEEwb/xJzhn05NrkJk= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= -github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 h1:KkH3I3sJuOLP3TjA/dfr4NAY8bghDwnXiU7cTKxQqo0= -github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjKLwalezA0k99cWs5L11HWOAPNjdUZ6RxH1BXbbM= -github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.31.1 h1:7XAt0uUg3DtwEKW5ZAGa+K7FZV2DdKQo5K/6TTnfX8Y= -github.com/alicebob/miniredis/v2 v2.31.1/go.mod h1:UB/T2Uztp7MlFSDakaX1sTXUv5CASoprx0wulRT6HBg= -github.com/amacneil/dbmate/v2 v2.11.0 h1:YN4OfvWdHX0bLTn71IX7J4RlI57exM5WeVWvdi889/M= -github.com/amacneil/dbmate/v2 v2.11.0/go.mod h1:4vWmgtfhA2rj/cLWeDBS5jNl4BbcLhADhn1FoNZKyOY= -github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= -github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= @@ -53,62 +26,26 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72H github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= -github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= -github.com/bsm/ginkgo/v2 v2.5.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w= -github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= -github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= -github.com/bsm/gomega v1.20.0/go.mod h1:JifAceMQ4crZIWYUKrlGcmbN3bqHogVTADMD2ATsbwk= -github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= -github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.10.0-rc3 h1:uNSnscRapXTwUgTyOF0GVljYD08p9X/Lbr9MweSV3V0= -github.com/bytedance/sonic v1.10.0-rc3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= -github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= -github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= -github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= -github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/deepmap/oapi-codegen v1.16.2 h1:xGHx0dNqYfy9gE8a7AVgVM8Sd5oF9SEgePzP+UPAUXI= -github.com/deepmap/oapi-codegen v1.16.2/go.mod h1:rdYoEA2GE+riuZ91DvpmBX9hJbQpuY9wchXpfQ3n+ho= -github.com/dgraph-io/badger/v4 v4.1.0 h1:E38jc0f+RATYrycSUf9LMv/t47XAy+3CApyYSq4APOQ= -github.com/dgraph-io/badger/v4 v4.1.0/go.mod h1:P50u28d39ibBRmIJuQC/NSdBOg46HnHw7al2SW5QRHg= -github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= -github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0= -github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -116,26 +53,11 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw= -github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= -github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -143,48 +65,21 @@ github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= -github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= -github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-redis/redis/v7 v7.4.0 h1:7obg6wUoj05T0EpY0o8B59S9w5yeMWql7sw2kwNW1x4= -github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg= -github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= -github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= -github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-redsync/redsync/v4 v4.8.1 h1:rq2RvdTI0obznMdxKUWGdmmulo7lS9yCzb8fgDKOlbM= -github.com/go-redsync/redsync/v4 v4.8.1/go.mod h1:LmUAsQuQxhzZAoGY7JS6+dNhNmZyonMZiiEDY9plotM= github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= -github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= -github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -200,18 +95,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomarkdown/markdown v0.0.0-20230922112808-5421fefb8386 h1:EcQR3gusLHN46TAD+G+EbaaqJArt5vHhNpXAa12PQf4= -github.com/gomarkdown/markdown v0.0.0-20230922112808-5421fefb8386/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= -github.com/gomodule/redigo v1.8.2 h1:H5XSIre1MB5NbPYFp+i1NBbb5qN1W8Y8YAQoAYbkm8k= -github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM= -github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -221,56 +106,29 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.1 h1:YQsLlGDJgwhXFpucSPyVbCBviQtjlHv3jLTlp8YmtEw= -github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= -github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -285,34 +143,11 @@ github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/ github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= -github.com/hashicorp/vault/api v1.12.0 h1:meCpJSesvzQyao8FCOgk2fGdoADAnbDu2WPJN1lDLJ4= -github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck= github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs= github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/iris-contrib/httpexpect/v2 v2.15.2 h1:T9THsdP1woyAqKHwjkEsbCnMefsAFvk8iJJKokcJ3Go= -github.com/iris-contrib/httpexpect/v2 v2.15.2/go.mod h1:JLDgIqnFy5loDSUv1OA2j0mb6p/rDhiCqigP22Uq9xE= -github.com/iris-contrib/schema v0.0.6 h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw= -github.com/iris-contrib/schema v0.0.6/go.mod h1:iYszG0IOsuIsfzjymw1kMzTL8YQcCWlm65f3wX8J5iA= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.5.4 h1:Xp2aQS8uXButQdnCMWNmvx6UysWQQC+u1EoizjguY+8= -github.com/jackc/pgx/v5 v5.5.4/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= -github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= -github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= @@ -320,55 +155,33 @@ github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Cc github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kataras/blocks v0.0.7 h1:cF3RDY/vxnSRezc7vLFlQFTYXG/yAr1o7WImJuZbzC4= -github.com/kataras/blocks v0.0.7/go.mod h1:UJIU97CluDo0f+zEjbnbkeMRlvYORtmc1304EeyXf4I= -github.com/kataras/golog v0.1.9 h1:vLvSDpP7kihFGKFAvBSofYo7qZNULYSHOH2D7rPTKJk= -github.com/kataras/golog v0.1.9/go.mod h1:jlpk/bOaYCyqDqH18pgDHdaJab72yBE6i0O3s30hpWY= -github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9 h1:Vx8kDVhO2qepK8w44lBtp+RzN3ld743i+LYPzODJSpQ= -github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9/go.mod h1:ldkoR3iXABBeqlTibQ3MYaviA1oSlPvim6f55biwBh4= -github.com/kataras/pio v0.0.12 h1:o52SfVYauS3J5X08fNjlGS5arXHjW/ItLkyLcKjoH6w= -github.com/kataras/pio v0.0.12/go.mod h1:ODK/8XBhhQ5WqrAhKy+9lTPS7sBf6O3KcLhc9klfRcY= -github.com/kataras/sitemap v0.0.6 h1:w71CRMMKYMJh6LR2wTgnk5hSgjVNB9KL60n5e2KHvLY= -github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIRwuj5jA4= -github.com/kataras/tunnel v0.0.4 h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA= -github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= -github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/labstack/echo/v4 v4.11.4 h1:vDZmA+qNeh1pd/cCkEicDMrjtrnMGQ1QFI9gWN1zGq8= github.com/labstack/echo/v4 v4.11.4/go.mod h1:noh7EvLwqDsmh/X/HWKPUl1AjzJrhyptRyEbQJfxen8= github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A= github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k= @@ -389,17 +202,9 @@ github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmt github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailgun/raymond/v2 v2.0.48 h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqACtjw= -github.com/mailgun/raymond/v2 v2.0.48/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -407,7 +212,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= @@ -415,41 +219,28 @@ github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg= -github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= -github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monarko/fhirgo v0.0.0-20200616214506-ca0a03fb1f7a h1:p9djamXkGAcjEN2fgPujHSe/FJXlydfUorC5KQaP3nA= github.com/monarko/fhirgo v0.0.0-20200616214506-ca0a03fb1f7a/go.mod h1:oj4XYikho7d07oYs1bZDkBFqpp2QDybFpsVs/wFDHyI= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= @@ -460,55 +251,23 @@ github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ8 github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= -github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= -github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt/v2 v2.5.3 h1:/9SWvzc6hTfamcgXJ3uYRpgj+QuY2aLNqRiqrKcrpEo= -github.com/nats-io/jwt/v2 v2.5.3/go.mod h1:iysuPemFcc7p4IoYots3IuELSI4EDe9Y0bQMe+I3Bf4= -github.com/nats-io/nats-server/v2 v2.10.10 h1:g1Wd64J5SGsoqWSx1qoNu9/At7a2x+jE7Qtf2XpEx/I= -github.com/nats-io/nats-server/v2 v2.10.10/go.mod h1:/TE61Dos8NlwZnjzyE3ZlOnM6dgl7tf937dnf4VclrA= -github.com/nats-io/nats.go v1.32.0 h1:Bx9BZS+aXYlxW08k8Gd3yR2s73pV5XSoAQUyp1Kwvp0= -github.com/nats-io/nats.go v1.32.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= -github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI= -github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= -github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= -github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b h1:80icUxWHwE1MrIOOEK5rxrtyKOgZeq5Iu1IjAEkggTY= -github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b/go.mod h1:6YUioYirD6/8IahZkoS4Ypc8xbeJW76Xdk1QKcziNTM= github.com/nuts-foundation/go-did v0.12.0 h1:XmttEpFOxrUXzdXHj2x9h8KlhhPgyr02vgtygWg8xnY= github.com/nuts-foundation/go-did v0.12.0/go.mod h1:cZiOP2Is9hgIsP5g1FqkfhBDi8f6ktxkP6K4iTX9qns= -github.com/nuts-foundation/go-leia/v4 v4.0.1 h1:+Sbk3Bew1QnRUqRXSOwomMw3nIZgncmTX425J7U5Q34= -github.com/nuts-foundation/go-leia/v4 v4.0.1/go.mod h1:eaZuWIolpU61TMvTMcen85+SOEOnHiALdg5SxqLXzz8= -github.com/nuts-foundation/go-stoabs v1.9.0 h1:zK+ugfolaJYyBvGwsRuavLVdycXk4Yw/1gI+tz17lWQ= -github.com/nuts-foundation/go-stoabs v1.9.0/go.mod h1:htbUqSZiaihqAvJfHwtAbQusGaJtIeWpm1pmKjBYXlM= -github.com/nuts-foundation/nuts-node v1.0.1-0.20240211124130-dcf636dfc035 h1:ZRXrWaOk8B3onG7kAeDqWClnlZiv7ciZVPakrZBsi9g= -github.com/nuts-foundation/nuts-node v1.0.1-0.20240211124130-dcf636dfc035/go.mod h1:T0c4QAxiqfWNXSE/PtWP4uJ95zA9TYh2zqFEDZBJ+Tg= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/nuts-foundation/go-did v0.13.0 h1:09pSZoL9ugraORuHNFti4Qjy6uu+I+xMlcE8tHgsAmQ= +github.com/nuts-foundation/go-did v0.13.0/go.mod h1:A5c1UPimAxpLCqURRIvQsd3BVXm+bk3iqy/FU5LEegc= github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= -github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f h1:HlPa7RcxTCrva5izPfTEfvYecO7LTahgmMRD1Qp13xg= -github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f/go.mod h1:WZ501QQMbZZ+3pXFPhQKzNwS1+jls0oqov3uQ2WasLs= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -517,67 +276,39 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 h1:J9b7z+QKAmPf4YLrFg6oQUotqHQeUNWwkvo7jZp1GLU= -github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps= -github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk= -github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo= -github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= -github.com/santhosh-tekuri/jsonschema v1.2.4 h1:hNhW8e7t+H1vgY+1QeEQpveR6D4+OwKPXCfD2aieJis= -github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= -github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shengdoushi/base58 v1.0.0 h1:tGe4o6TmdXFJWoI31VoSWvuaKxf0Px3gqa3sUWhAxBs= github.com/shengdoushi/base58 v1.0.0/go.mod h1:m5uIILfzcKMw6238iWAhP4l3s5+uXyF3+bJKUNhAL9I= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= @@ -593,83 +324,36 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203 h1:QVqDTf3h2WHt08YuiTGPZLls0Wq99X9bWd0Q5ZSBesM= -github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8= -github.com/tdewolff/minify/v2 v2.12.9 h1:dvn5MtmuQ/DFMwqf5j8QhEVpPX6fi3WGImhv8RUB4zA= -github.com/tdewolff/minify/v2 v2.12.9/go.mod h1:qOqdlDfL+7v0/fyymB+OP497nIxJYSvX4MQWA8OoiXU= -github.com/tdewolff/parse/v2 v2.6.8 h1:mhNZXYCx//xG7Yq2e/kVLNZw4YfYmeHbhx+Zc0OvFMA= -github.com/tdewolff/parse/v2 v2.6.8/go.mod h1:XHDhaU6IBgsryfdnpzUXBlT6leW/l25yrFBTEb4eIyM= -github.com/tdewolff/test v1.0.9 h1:SswqJCmeN4B+9gEAi/5uqT0qpi1y2/2O47V/1hhGZT0= -github.com/tdewolff/test v1.0.9/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= -github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= -github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= -github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yosssi/ace v0.0.5 h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA= -github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= -github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= -github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04 h1:qXafrlZL1WsJW5OokjraLLRURHiw0OzKHD/RNdspp4w= -github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04/go.mod h1:FiwNQxz6hGoNFBC4nIx+CxZhI3nne5RmIOlT/MXcSD4= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= -go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= -golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= @@ -689,31 +373,25 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= @@ -734,28 +412,21 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -765,19 +436,13 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -823,10 +488,8 @@ golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -841,8 +504,6 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -851,8 +512,6 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -864,20 +523,13 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -885,24 +537,11 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.5.6 h1:ydr9xEd5YAM0vxVDY0X139dyzNz10spDiDlC7+ibLeU= -gorm.io/driver/postgres v1.5.6/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA= -gorm.io/driver/sqlite v1.5.5 h1:7MDMtUZhV065SilG62E0MquljeArQZNfJnjd9i9gx3E= -gorm.io/driver/sqlite v1.5.5/go.mod h1:6NgQ7sQWAIFsPrJJl1lSNSu2TABh0ZZ/zm5fosATavE= -gorm.io/gorm v1.25.7 h1:VsD6acwRjz2zFxGO50gPO6AkNs7KKnvfzUjHQhZDz/A= -gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -moul.io/http2curl/v2 v2.3.0 h1:9r3JfDzWPcbIklMOs2TnIFzDYvfAZvjeavG6EzP7jYs= -moul.io/http2curl/v2 v2.3.0/go.mod h1:RW4hyBjTWSYDOxapodpNEtX0g5Eb16sxklBqmd2RHcE= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -schneider.vip/problem v1.9.1 h1:HYdGPzbTHnNziF7cC4ftbn/eTrjSIXhKfricAMaLIMk= -schneider.vip/problem v1.9.1/go.mod h1:6hLRfO1e1MQWdG23Kl5b3Yp5FSexE+YiGVqCkAp3HUQ= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/http/proxy/server.go b/http/proxy/server.go index 60d153aa..022fc05f 100644 --- a/http/proxy/server.go +++ b/http/proxy/server.go @@ -17,7 +17,6 @@ import ( "github.com/nuts-foundation/nuts-demo-ehr/nuts/registry" "github.com/nuts-foundation/nuts-demo-ehr/domain/customers" - "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/sirupsen/logrus" "github.com/labstack/echo/v4" @@ -221,8 +220,8 @@ func (server *Server) verifyAccess(ctx echo.Context, request *http.Request, toke return nil } -func (server *Server) parseNutsAuthorizationCredentials(ctx context.Context, token *nutsAuthClient.TokenIntrospectionResponse) ([]credential.NutsAuthorizationCredentialSubject, error) { - var subjects []credential.NutsAuthorizationCredentialSubject +func (server *Server) parseNutsAuthorizationCredentials(ctx context.Context, token *nutsAuthClient.TokenIntrospectionResponse) ([]registry.NutsAuthorizationCredentialSubject, error) { + var subjects []registry.NutsAuthorizationCredentialSubject if token.Vcs == nil { return subjects, nil @@ -239,7 +238,7 @@ func (server *Server) parseNutsAuthorizationCredentials(ctx context.Context, tok continue } - subject := make([]credential.NutsAuthorizationCredentialSubject, 0) + subject := make([]registry.NutsAuthorizationCredentialSubject, 0) if err := authCredential.UnmarshalCredentialSubject(&subject); err != nil { return nil, fmt.Errorf("invalid content for NutsAuthorizationCredential credentialSubject: %w", err) @@ -251,7 +250,7 @@ func (server *Server) parseNutsAuthorizationCredentials(ctx context.Context, tok return subjects, nil } -func (server *Server) validateWithNutsAuthorizationCredential(token *nutsAuthClient.TokenIntrospectionResponse, subjects []credential.NutsAuthorizationCredentialSubject, route fhirRoute) error { +func (server *Server) validateWithNutsAuthorizationCredential(token *nutsAuthClient.TokenIntrospectionResponse, subjects []registry.NutsAuthorizationCredentialSubject, route fhirRoute) error { hasUser := token.Email != nil if token.Vcs != nil { @@ -295,5 +294,5 @@ func (server *Server) getTenant(requesterDID string) (int, error) { } func validCredentialType(verifiableCredential vc.VerifiableCredential) bool { - return verifiableCredential.IsType(*credential.NutsAuthorizationCredentialTypeURI) + return verifiableCredential.IsType(registry.NutsAuthorizationCredentialTypeURI) } diff --git a/main.go b/main.go index 7079e1b7..322a9959 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,10 @@ import ( "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-demo-ehr/domain" + "github.com/nuts-foundation/nuts-demo-ehr/domain/acl" openapiTypes "github.com/oapi-codegen/runtime/types" + "io" "io/fs" "log" @@ -45,6 +48,7 @@ import ( nutsAuthClient "github.com/nuts-foundation/nuts-demo-ehr/nuts/client/auth" "github.com/nuts-foundation/nuts-demo-ehr/nuts/registry" "github.com/nuts-foundation/nuts-demo-ehr/sql" + "github.com/sirupsen/logrus" ) @@ -226,12 +230,16 @@ func registerEHR(server *echo.Echo, config Config, customerRepository customers. } auth := api.NewAuth(config.sessionKey, customerRepository, passwd) + aclRepository, err := acl.NewRepository(sqlDB) + if err != nil { + log.Fatal(err) + } + // Initialize wrapper apiWrapper := api.Wrapper{ APIAuth: auth, - NutsAuth: nodeClient, - NutsIam: nodeClient, - NutsDiscovery: nodeClient, + ACL: aclRepository, + NutsClient: nodeClient, CustomerRepository: customerRepository, PatientRepository: patientRepository, ReportRepository: reportRepository, @@ -241,8 +249,9 @@ func registerEHR(server *echo.Echo, config Config, customerRepository customers. TransferSenderService: transferSenderService, TransferReceiverService: transferReceiverService, TransferReceiverRepo: transferReceiverRepo, + ZorginzageService: domain.ZorginzageService{NutsClient: nodeClient}, FHIRService: fhir.Service{ClientFactory: fhirClientFactory}, - EpisodeService: episode.NewService(fhirClientFactory, authService, orgRegistry, vcRegistry), + EpisodeService: episode.NewService(fhirClientFactory, authService, orgRegistry, vcRegistry, aclRepository), TenantInitializer: tenantInitializer, NotificationHandler: notification.NewHandler(authService, fhirClientFactory, transferReceiverService, orgRegistry, vcRegistry), } diff --git a/nuts/client/discovery.go b/nuts/client/discovery.go index e69a4085..8bce9bc0 100644 --- a/nuts/client/discovery.go +++ b/nuts/client/discovery.go @@ -6,26 +6,55 @@ import ( "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-demo-ehr/nuts" nutsDiscoveryClient "github.com/nuts-foundation/nuts-demo-ehr/nuts/client/discovery" - "github.com/nuts-foundation/nuts-node/vdr/didweb" - "io" + "github.com/nuts-foundation/nuts-demo-ehr/nuts/client/vdr_v2" "net/http" "time" ) var _ Discovery = (*HTTPClient)(nil) +// DiscoverySearchResult models a single result for when searching on Discovery Services. +type DiscoverySearchResult struct { + nuts.NutsOrganization + ServiceID string `json:"service_id"` +} + type Discovery interface { - SearchService(ctx context.Context, organizationSearchParam string, discoveryServiceID string, didServiceType *string) ([]nuts.NutsOrganization, error) + SearchDiscoveryService(ctx context.Context, query map[string]string, discoveryServiceID *string, didServiceType *string) ([]DiscoverySearchResult, error) } -func (c HTTPClient) SearchService(ctx context.Context, organizationSearchParam string, discoveryServiceID string, didServiceType *string) ([]nuts.NutsOrganization, error) { +func (c HTTPClient) SearchDiscoveryService(ctx context.Context, query map[string]string, discoveryServiceID *string, didServiceType *string) ([]DiscoverySearchResult, error) { ctx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() - searchParams := map[string]interface{}{ - "credentialSubject.organization.name": organizationSearchParam + "*", + var serviceIDs []string + if discoveryServiceID != nil { + serviceIDs = append(serviceIDs, *discoveryServiceID) + } else { + // service ID not specified, search all discovery services + var err error + serviceIDs, err = c.getDiscoveryServices(ctx) + if err != nil { + return nil, err + } } - params := nutsDiscoveryClient.SearchPresentationsParams{Query: &searchParams} + searchResults := make([]DiscoverySearchResult, 0) + for _, serviceID := range serviceIDs { + currResults, err := c.searchDiscoveryService(ctx, query, serviceID, didServiceType) + if err != nil { + return nil, err + } + searchResults = append(searchResults, currResults...) + } + return searchResults, nil +} + +func (c HTTPClient) searchDiscoveryService(ctx context.Context, query map[string]string, discoveryServiceID string, didServiceType *string) ([]DiscoverySearchResult, error) { + queryAsMap := make(map[string]interface{}, 0) + for key, value := range query { + queryAsMap[key] = value + } + params := nutsDiscoveryClient.SearchPresentationsParams{Query: &queryAsMap} resp, err := c.discovery().SearchPresentations(ctx, discoveryServiceID, ¶ms) if err != nil { @@ -41,11 +70,11 @@ func (c HTTPClient) SearchService(ctx context.Context, organizationSearchParam s } // resolve all DIDs from .subjectId and filter on given didServiceType if given - results := make([]nuts.NutsOrganization, 0) + results := make([]DiscoverySearchResult, 0) for _, searchResult := range response { if didServiceType != nil { // parse did and convert did:web to url - doc, err := resolve(ctx, searchResult.SubjectId) + doc, err := c.resolveDID(ctx, searchResult.SubjectId) if err != nil { return nil, err } @@ -61,38 +90,27 @@ func (c HTTPClient) SearchService(ctx context.Context, organizationSearchParam s continue } } - // convert searchResult to NutsOrganization and use the toCache method to store the results in the cache - results = append(results, organizationSearchResultToDomain(searchResult)) + results = append(results, DiscoverySearchResult{ + NutsOrganization: organizationSearchResultToDomain(searchResult), + ServiceID: discoveryServiceID, + }) } - return results, nil } -// resolve a did:web document. This is a helper function to resolve a did:web document to a did.Document. -// construct the right URL, call it and parse the result to a did.Document. -func resolve(ctx context.Context, didStr string) (*did.Document, error) { - id, err := did.ParseDID(didStr) - if err != nil { - return nil, err - } - didURL, err := didweb.DIDToURL(*id) - if err != nil { - return nil, err - } - didURL = didURL.JoinPath("did.json") - req, err := http.NewRequestWithContext(ctx, http.MethodGet, didURL.String(), nil) +func (c HTTPClient) resolveDID(ctx context.Context, didStr string) (*did.Document, error) { + response, err := c.vdr().ResolveDID(ctx, didStr) if err != nil { - return nil, err + return nil, nil } - resp, err := http.DefaultClient.Do(req) - if err != nil { + if err := testResponseCode(http.StatusOK, response); err != nil { return nil, err } - bytes, err := io.ReadAll(resp.Body) + didResponse, err := vdr_v2.ParseResolveDIDResponse(response) if err != nil { return nil, err } - return did.ParseDocument(string(bytes)) + return &didResponse.JSON200.Document, nil } func organizationSearchResultToDomain(searchResult nutsDiscoveryClient.SearchResult) nuts.NutsOrganization { @@ -105,6 +123,26 @@ func organizationSearchResultToDomain(searchResult nutsDiscoveryClient.SearchRes } } +func (c HTTPClient) getDiscoveryServices(ctx context.Context) ([]string, error) { + response, err := c.discovery().GetServices(ctx) + if err != nil { + return nil, err + } + err = testResponseCode(http.StatusOK, response) + if err != nil { + return nil, err + } + services, err := nutsDiscoveryClient.ParseGetServicesResponse(response) + if err != nil { + return nil, err + } + result := make([]string, 0) + for _, service := range *services.JSON200 { + result = append(result, service.Id) + } + return result, nil +} + func (c HTTPClient) discovery() nutsDiscoveryClient.ClientInterface { var response nutsDiscoveryClient.ClientInterface var err error diff --git a/nuts/client/iam.go b/nuts/client/iam.go index 1f56b4c1..fe316c61 100644 --- a/nuts/client/iam.go +++ b/nuts/client/iam.go @@ -3,6 +3,7 @@ package client import ( "context" "encoding/json" + "fmt" nutsIamClient "github.com/nuts-foundation/nuts-demo-ehr/nuts/client/iam" "net/http" "time" @@ -63,6 +64,30 @@ func (c HTTPClient) GetAuthenticationResult(token string) (*nutsIamClient.TokenR return response, nil } +func (c HTTPClient) RequestServiceAccessToken(ctx context.Context, relyingPartyDID, authorizationServerDID string, scope string) (string, error) { + response, err := c.iam().RequestServiceAccessToken(ctx, relyingPartyDID, nutsIamClient.RequestServiceAccessTokenJSONRequestBody{ + Scope: scope, + Verifier: authorizationServerDID, + }) + if err != nil { + return "", err + } + tokenResponse, err := nutsIamClient.ParseRequestServiceAccessTokenResponse(response) + if err != nil { + return "", err + } + + if tokenResponse.JSON200 == nil { + var detail string + if tokenResponse.ApplicationproblemJSONDefault != nil { + detail = tokenResponse.ApplicationproblemJSONDefault.Detail + } + return "", fmt.Errorf("unable to get access token: %s", detail) + } + return tokenResponse.JSON200.AccessToken, nil + +} + func (c HTTPClient) iam() nutsIamClient.ClientInterface { var response nutsIamClient.ClientInterface var err error diff --git a/nuts/client/iam/generated.go b/nuts/client/iam/generated.go index 7bf3e95e..35731dac 100644 --- a/nuts/client/iam/generated.go +++ b/nuts/client/iam/generated.go @@ -162,6 +162,30 @@ type VerifiableCredential = externalRef0.VerifiableCredential // VerifiablePresentation Verifiable Presentation type VerifiablePresentation = externalRef0.VerifiablePresentation +// RequestServiceAccessTokenJSONBody defines parameters for RequestServiceAccessToken. +type RequestServiceAccessTokenJSONBody struct { + // Scope The scope that will be the service for which this access token can be used. + Scope string `json:"scope"` + Verifier string `json:"verifier"` +} + +// RequestUserAccessTokenJSONBody defines parameters for RequestUserAccessToken. +type RequestUserAccessTokenJSONBody struct { + // RedirectUri The URL to which the user-agent will be redirected after the authorization request. + // This is the URL of the calling application. + // The OAuth2 flow will finish at the /callback URL of the node and the node will redirect the user to this redirect_uri. + RedirectUri string `json:"redirect_uri"` + + // Scope The scope that will be the service for which this access token can be used. + Scope string `json:"scope"` + + // UserId The ID of the user for which this access token is requested. + UserId string `json:"user_id"` + + // Verifier The DID of the verifier, the relying party for which this access token is requested. + Verifier string `json:"verifier"` +} + // HandleAuthorizeRequestParams defines parameters for HandleAuthorizeRequest. type HandleAuthorizeRequestParams struct { Params *map[string]string `form:"params,omitempty" json:"params,omitempty"` @@ -214,36 +238,6 @@ type HandleTokenRequestFormdataBody struct { Scope *string `form:"scope,omitempty" json:"scope,omitempty"` } -// RequestServiceAccessTokenJSONBody defines parameters for RequestServiceAccessToken. -type RequestServiceAccessTokenJSONBody struct { - // Scope The scope that will be the service for which this access token can be used. - Scope string `json:"scope"` - Verifier string `json:"verifier"` -} - -// RequestUserAccessTokenJSONBody defines parameters for RequestUserAccessToken. -type RequestUserAccessTokenJSONBody struct { - // RedirectUri The URL to which the user-agent will be redirected after the authorization request. - // This is the URL of the calling application. - // The OAuth2 flow will finish at the /callback URL of the node and the node will redirect the user to this redirect_uri. - RedirectUri string `json:"redirect_uri"` - - // Scope The scope that will be the service for which this access token can be used. - Scope string `json:"scope"` - - // UserId The ID of the user for which this access token is requested. - UserId string `json:"user_id"` - - // Verifier The DID of the verifier, the relying party for which this access token is requested. - Verifier string `json:"verifier"` -} - -// HandleAuthorizeResponseFormdataRequestBody defines body for HandleAuthorizeResponse for application/x-www-form-urlencoded ContentType. -type HandleAuthorizeResponseFormdataRequestBody HandleAuthorizeResponseFormdataBody - -// HandleTokenRequestFormdataRequestBody defines body for HandleTokenRequest for application/x-www-form-urlencoded ContentType. -type HandleTokenRequestFormdataRequestBody HandleTokenRequestFormdataBody - // IntrospectAccessTokenFormdataRequestBody defines body for IntrospectAccessToken for application/x-www-form-urlencoded ContentType. type IntrospectAccessTokenFormdataRequestBody = TokenIntrospectionRequest @@ -253,6 +247,12 @@ type RequestServiceAccessTokenJSONRequestBody RequestServiceAccessTokenJSONBody // RequestUserAccessTokenJSONRequestBody defines body for RequestUserAccessToken for application/json ContentType. type RequestUserAccessTokenJSONRequestBody RequestUserAccessTokenJSONBody +// HandleAuthorizeResponseFormdataRequestBody defines body for HandleAuthorizeResponse for application/x-www-form-urlencoded ContentType. +type HandleAuthorizeResponseFormdataRequestBody HandleAuthorizeResponseFormdataBody + +// HandleTokenRequestFormdataRequestBody defines body for HandleTokenRequest for application/x-www-form-urlencoded ContentType. +type HandleTokenRequestFormdataRequestBody HandleTokenRequestFormdataBody + // RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error @@ -329,34 +329,9 @@ type ClientInterface interface { // OAuthAuthorizationServerMetadata request OAuthAuthorizationServerMetadata(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) - // HandleAuthorizeRequest request - HandleAuthorizeRequest(ctx context.Context, id string, params *HandleAuthorizeRequestParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Callback request - Callback(ctx context.Context, id string, params *CallbackParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetWebDID request GetWebDID(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) - // OAuthClientMetadata request - OAuthClientMetadata(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PresentationDefinition request - PresentationDefinition(ctx context.Context, id string, params *PresentationDefinitionParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleAuthorizeResponseWithBody request with any body - HandleAuthorizeResponseWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleAuthorizeResponseWithFormdataBody(ctx context.Context, id string, body HandleAuthorizeResponseFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // StatusList request - StatusList(ctx context.Context, id string, page int, reqEditors ...RequestEditorFn) (*http.Response, error) - - // HandleTokenRequestWithBody request with any body - HandleTokenRequestWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - HandleTokenRequestWithFormdataBody(ctx context.Context, id string, body HandleTokenRequestFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // IntrospectAccessTokenWithBody request with any body IntrospectAccessTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -374,6 +349,31 @@ type ClientInterface interface { RequestUserAccessTokenWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) RequestUserAccessToken(ctx context.Context, did string, body RequestUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // HandleAuthorizeRequest request + HandleAuthorizeRequest(ctx context.Context, did string, params *HandleAuthorizeRequestParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // Callback request + Callback(ctx context.Context, did string, params *CallbackParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // OAuthClientMetadata request + OAuthClientMetadata(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PresentationDefinition request + PresentationDefinition(ctx context.Context, did string, params *PresentationDefinitionParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // HandleAuthorizeResponseWithBody request with any body + HandleAuthorizeResponseWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + HandleAuthorizeResponseWithFormdataBody(ctx context.Context, did string, body HandleAuthorizeResponseFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // HandleTokenRequestWithBody request with any body + HandleTokenRequestWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + HandleTokenRequestWithFormdataBody(ctx context.Context, did string, body HandleTokenRequestFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // StatusList request + StatusList(ctx context.Context, did string, page int, reqEditors ...RequestEditorFn) (*http.Response, error) } func (c *Client) OAuthAuthorizationServerMetadata(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -388,8 +388,8 @@ func (c *Client) OAuthAuthorizationServerMetadata(ctx context.Context, id string return c.Client.Do(req) } -func (c *Client) HandleAuthorizeRequest(ctx context.Context, id string, params *HandleAuthorizeRequestParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleAuthorizeRequestRequest(c.Server, id, params) +func (c *Client) GetWebDID(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetWebDIDRequest(c.Server, id) if err != nil { return nil, err } @@ -400,8 +400,8 @@ func (c *Client) HandleAuthorizeRequest(ctx context.Context, id string, params * return c.Client.Do(req) } -func (c *Client) Callback(ctx context.Context, id string, params *CallbackParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCallbackRequest(c.Server, id, params) +func (c *Client) IntrospectAccessTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewIntrospectAccessTokenRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -412,8 +412,8 @@ func (c *Client) Callback(ctx context.Context, id string, params *CallbackParams return c.Client.Do(req) } -func (c *Client) GetWebDID(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetWebDIDRequest(c.Server, id) +func (c *Client) IntrospectAccessTokenWithFormdataBody(ctx context.Context, body IntrospectAccessTokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewIntrospectAccessTokenRequestWithFormdataBody(c.Server, body) if err != nil { return nil, err } @@ -424,8 +424,8 @@ func (c *Client) GetWebDID(ctx context.Context, id string, reqEditors ...Request return c.Client.Do(req) } -func (c *Client) OAuthClientMetadata(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewOAuthClientMetadataRequest(c.Server, id) +func (c *Client) RetrieveAccessToken(ctx context.Context, sessionID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRetrieveAccessTokenRequest(c.Server, sessionID) if err != nil { return nil, err } @@ -436,8 +436,8 @@ func (c *Client) OAuthClientMetadata(ctx context.Context, id string, reqEditors return c.Client.Do(req) } -func (c *Client) PresentationDefinition(ctx context.Context, id string, params *PresentationDefinitionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPresentationDefinitionRequest(c.Server, id, params) +func (c *Client) RequestServiceAccessTokenWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestServiceAccessTokenRequestWithBody(c.Server, did, contentType, body) if err != nil { return nil, err } @@ -448,8 +448,8 @@ func (c *Client) PresentationDefinition(ctx context.Context, id string, params * return c.Client.Do(req) } -func (c *Client) HandleAuthorizeResponseWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleAuthorizeResponseRequestWithBody(c.Server, id, contentType, body) +func (c *Client) RequestServiceAccessToken(ctx context.Context, did string, body RequestServiceAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestServiceAccessTokenRequest(c.Server, did, body) if err != nil { return nil, err } @@ -460,8 +460,8 @@ func (c *Client) HandleAuthorizeResponseWithBody(ctx context.Context, id string, return c.Client.Do(req) } -func (c *Client) HandleAuthorizeResponseWithFormdataBody(ctx context.Context, id string, body HandleAuthorizeResponseFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleAuthorizeResponseRequestWithFormdataBody(c.Server, id, body) +func (c *Client) RequestUserAccessTokenWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestUserAccessTokenRequestWithBody(c.Server, did, contentType, body) if err != nil { return nil, err } @@ -472,8 +472,8 @@ func (c *Client) HandleAuthorizeResponseWithFormdataBody(ctx context.Context, id return c.Client.Do(req) } -func (c *Client) StatusList(ctx context.Context, id string, page int, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewStatusListRequest(c.Server, id, page) +func (c *Client) RequestUserAccessToken(ctx context.Context, did string, body RequestUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestUserAccessTokenRequest(c.Server, did, body) if err != nil { return nil, err } @@ -484,8 +484,8 @@ func (c *Client) StatusList(ctx context.Context, id string, page int, reqEditors return c.Client.Do(req) } -func (c *Client) HandleTokenRequestWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleTokenRequestRequestWithBody(c.Server, id, contentType, body) +func (c *Client) HandleAuthorizeRequest(ctx context.Context, did string, params *HandleAuthorizeRequestParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHandleAuthorizeRequestRequest(c.Server, did, params) if err != nil { return nil, err } @@ -496,8 +496,8 @@ func (c *Client) HandleTokenRequestWithBody(ctx context.Context, id string, cont return c.Client.Do(req) } -func (c *Client) HandleTokenRequestWithFormdataBody(ctx context.Context, id string, body HandleTokenRequestFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHandleTokenRequestRequestWithFormdataBody(c.Server, id, body) +func (c *Client) Callback(ctx context.Context, did string, params *CallbackParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCallbackRequest(c.Server, did, params) if err != nil { return nil, err } @@ -508,8 +508,8 @@ func (c *Client) HandleTokenRequestWithFormdataBody(ctx context.Context, id stri return c.Client.Do(req) } -func (c *Client) IntrospectAccessTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewIntrospectAccessTokenRequestWithBody(c.Server, contentType, body) +func (c *Client) OAuthClientMetadata(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewOAuthClientMetadataRequest(c.Server, did) if err != nil { return nil, err } @@ -520,8 +520,8 @@ func (c *Client) IntrospectAccessTokenWithBody(ctx context.Context, contentType return c.Client.Do(req) } -func (c *Client) IntrospectAccessTokenWithFormdataBody(ctx context.Context, body IntrospectAccessTokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewIntrospectAccessTokenRequestWithFormdataBody(c.Server, body) +func (c *Client) PresentationDefinition(ctx context.Context, did string, params *PresentationDefinitionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPresentationDefinitionRequest(c.Server, did, params) if err != nil { return nil, err } @@ -532,8 +532,8 @@ func (c *Client) IntrospectAccessTokenWithFormdataBody(ctx context.Context, body return c.Client.Do(req) } -func (c *Client) RetrieveAccessToken(ctx context.Context, sessionID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRetrieveAccessTokenRequest(c.Server, sessionID) +func (c *Client) HandleAuthorizeResponseWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHandleAuthorizeResponseRequestWithBody(c.Server, did, contentType, body) if err != nil { return nil, err } @@ -544,8 +544,8 @@ func (c *Client) RetrieveAccessToken(ctx context.Context, sessionID string, reqE return c.Client.Do(req) } -func (c *Client) RequestServiceAccessTokenWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestServiceAccessTokenRequestWithBody(c.Server, did, contentType, body) +func (c *Client) HandleAuthorizeResponseWithFormdataBody(ctx context.Context, did string, body HandleAuthorizeResponseFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHandleAuthorizeResponseRequestWithFormdataBody(c.Server, did, body) if err != nil { return nil, err } @@ -556,8 +556,8 @@ func (c *Client) RequestServiceAccessTokenWithBody(ctx context.Context, did stri return c.Client.Do(req) } -func (c *Client) RequestServiceAccessToken(ctx context.Context, did string, body RequestServiceAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestServiceAccessTokenRequest(c.Server, did, body) +func (c *Client) HandleTokenRequestWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHandleTokenRequestRequestWithBody(c.Server, did, contentType, body) if err != nil { return nil, err } @@ -568,8 +568,8 @@ func (c *Client) RequestServiceAccessToken(ctx context.Context, did string, body return c.Client.Do(req) } -func (c *Client) RequestUserAccessTokenWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestUserAccessTokenRequestWithBody(c.Server, did, contentType, body) +func (c *Client) HandleTokenRequestWithFormdataBody(ctx context.Context, did string, body HandleTokenRequestFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHandleTokenRequestRequestWithFormdataBody(c.Server, did, body) if err != nil { return nil, err } @@ -580,8 +580,8 @@ func (c *Client) RequestUserAccessTokenWithBody(ctx context.Context, did string, return c.Client.Do(req) } -func (c *Client) RequestUserAccessToken(ctx context.Context, did string, body RequestUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestUserAccessTokenRequest(c.Server, did, body) +func (c *Client) StatusList(ctx context.Context, did string, page int, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewStatusListRequest(c.Server, did, page) if err != nil { return nil, err } @@ -626,8 +626,8 @@ func NewOAuthAuthorizationServerMetadataRequest(server string, id string) (*http return req, nil } -// NewHandleAuthorizeRequestRequest generates requests for HandleAuthorizeRequest -func NewHandleAuthorizeRequestRequest(server string, id string, params *HandleAuthorizeRequestParams) (*http.Request, error) { +// NewGetWebDIDRequest generates requests for GetWebDID +func NewGetWebDIDRequest(server string, id string) (*http.Request, error) { var err error var pathParam0 string @@ -642,7 +642,7 @@ func NewHandleAuthorizeRequestRequest(server string, id string, params *HandleAu return nil, err } - operationPath := fmt.Sprintf("/iam/%s/authorize", pathParam0) + operationPath := fmt.Sprintf("/iam/%s/did.json", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -652,28 +652,6 @@ func NewHandleAuthorizeRequestRequest(server string, id string, params *HandleAu return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if params.Params != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "params", runtime.ParamLocationQuery, *params.Params); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -682,23 +660,27 @@ func NewHandleAuthorizeRequestRequest(server string, id string, params *HandleAu return req, nil } -// NewCallbackRequest generates requests for Callback -func NewCallbackRequest(server string, id string, params *CallbackParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) +// NewIntrospectAccessTokenRequestWithFormdataBody calls the generic IntrospectAccessToken builder with application/x-www-form-urlencoded body +func NewIntrospectAccessTokenRequestWithFormdataBody(server string, body IntrospectAccessTokenFormdataRequestBody) (*http.Request, error) { + var bodyReader io.Reader + bodyStr, err := runtime.MarshalForm(body, nil) if err != nil { return nil, err } + bodyReader = strings.NewReader(bodyStr.Encode()) + return NewIntrospectAccessTokenRequestWithBody(server, "application/x-www-form-urlencoded", bodyReader) +} + +// NewIntrospectAccessTokenRequestWithBody generates requests for IntrospectAccessToken with any type of body +func NewIntrospectAccessTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/iam/%s/callback", pathParam0) + operationPath := fmt.Sprintf("/internal/auth/v2/accesstoken/introspect") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -708,91 +690,23 @@ func NewCallbackRequest(server string, id string, params *CallbackParams) (*http return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if params.Code != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "code", runtime.ParamLocationQuery, *params.Code); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.State != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "state", runtime.ParamLocationQuery, *params.State); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Error != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "error", runtime.ParamLocationQuery, *params.Error); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ErrorDescription != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "error_description", runtime.ParamLocationQuery, *params.ErrorDescription); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewGetWebDIDRequest generates requests for GetWebDID -func NewGetWebDIDRequest(server string, id string) (*http.Request, error) { +// NewRetrieveAccessTokenRequest generates requests for RetrieveAccessToken +func NewRetrieveAccessTokenRequest(server string, sessionID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sessionID", runtime.ParamLocationPath, sessionID) if err != nil { return nil, err } @@ -802,7 +716,7 @@ func NewGetWebDIDRequest(server string, id string) (*http.Request, error) { return nil, err } - operationPath := fmt.Sprintf("/iam/%s/did.json", pathParam0) + operationPath := fmt.Sprintf("/internal/auth/v2/accesstoken/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -820,57 +734,31 @@ func NewGetWebDIDRequest(server string, id string) (*http.Request, error) { return req, nil } -// NewOAuthClientMetadataRequest generates requests for OAuthClientMetadata -func NewOAuthClientMetadataRequest(server string, id string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/iam/%s/oauth-client", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) +// NewRequestServiceAccessTokenRequest calls the generic RequestServiceAccessToken builder with application/json body +func NewRequestServiceAccessTokenRequest(server string, did string, body RequestServiceAccessTokenJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } - - return req, nil + bodyReader = bytes.NewReader(buf) + return NewRequestServiceAccessTokenRequestWithBody(server, did, "application/json", bodyReader) } -// NewPresentationDefinitionRequest generates requests for PresentationDefinition -func NewPresentationDefinitionRequest(server string, id string, params *PresentationDefinitionParams) (*http.Request, error) { +// NewRequestServiceAccessTokenRequestWithBody generates requests for RequestServiceAccessToken with any type of body +func NewRequestServiceAccessTokenRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) - if err != nil { - return nil, err - } + pathParam0 = did serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/iam/%s/presentation_definition", pathParam0) + operationPath := fmt.Sprintf("/internal/auth/v2/%s/request-service-access-token", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -880,60 +768,41 @@ func NewPresentationDefinitionRequest(server string, id string, params *Presenta return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "scope", runtime.ParamLocationQuery, params.Scope); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewHandleAuthorizeResponseRequestWithFormdataBody calls the generic HandleAuthorizeResponse builder with application/x-www-form-urlencoded body -func NewHandleAuthorizeResponseRequestWithFormdataBody(server string, id string, body HandleAuthorizeResponseFormdataRequestBody) (*http.Request, error) { +// NewRequestUserAccessTokenRequest calls the generic RequestUserAccessToken builder with application/json body +func NewRequestUserAccessTokenRequest(server string, did string, body RequestUserAccessTokenJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader - bodyStr, err := runtime.MarshalForm(body, nil) + buf, err := json.Marshal(body) if err != nil { return nil, err } - bodyReader = strings.NewReader(bodyStr.Encode()) - return NewHandleAuthorizeResponseRequestWithBody(server, id, "application/x-www-form-urlencoded", bodyReader) + bodyReader = bytes.NewReader(buf) + return NewRequestUserAccessTokenRequestWithBody(server, did, "application/json", bodyReader) } -// NewHandleAuthorizeResponseRequestWithBody generates requests for HandleAuthorizeResponse with any type of body -func NewHandleAuthorizeResponseRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { +// NewRequestUserAccessTokenRequestWithBody generates requests for RequestUserAccessToken with any type of body +func NewRequestUserAccessTokenRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) - if err != nil { - return nil, err - } + pathParam0 = did serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/iam/%s/response", pathParam0) + operationPath := fmt.Sprintf("/internal/auth/v2/%s/request-user-access-token", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -953,30 +822,20 @@ func NewHandleAuthorizeResponseRequestWithBody(server string, id string, content return req, nil } -// NewStatusListRequest generates requests for StatusList -func NewStatusListRequest(server string, id string, page int) (*http.Request, error) { +// NewHandleAuthorizeRequestRequest generates requests for HandleAuthorizeRequest +func NewHandleAuthorizeRequestRequest(server string, did string, params *HandleAuthorizeRequestParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "page", runtime.ParamLocationPath, page) - if err != nil { - return nil, err - } + pathParam0 = did serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/iam/%s/statuslist/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/oauth2/%s/authorize", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -986,6 +845,28 @@ func NewStatusListRequest(server string, id string, page int) (*http.Request, er return nil, err } + if params != nil { + queryValues := queryURL.Query() + + if params.Params != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "params", runtime.ParamLocationQuery, *params.Params); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -994,34 +875,20 @@ func NewStatusListRequest(server string, id string, page int) (*http.Request, er return req, nil } -// NewHandleTokenRequestRequestWithFormdataBody calls the generic HandleTokenRequest builder with application/x-www-form-urlencoded body -func NewHandleTokenRequestRequestWithFormdataBody(server string, id string, body HandleTokenRequestFormdataRequestBody) (*http.Request, error) { - var bodyReader io.Reader - bodyStr, err := runtime.MarshalForm(body, nil) - if err != nil { - return nil, err - } - bodyReader = strings.NewReader(bodyStr.Encode()) - return NewHandleTokenRequestRequestWithBody(server, id, "application/x-www-form-urlencoded", bodyReader) -} - -// NewHandleTokenRequestRequestWithBody generates requests for HandleTokenRequest with any type of body -func NewHandleTokenRequestRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { +// NewCallbackRequest generates requests for Callback +func NewCallbackRequest(server string, did string, params *CallbackParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) - if err != nil { - return nil, err - } + pathParam0 = did serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/iam/%s/token", pathParam0) + operationPath := fmt.Sprintf("/oauth2/%s/callback", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1031,37 +898,98 @@ func NewHandleTokenRequestRequestWithBody(server string, id string, contentType return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } + if params != nil { + queryValues := queryURL.Query() - req.Header.Add("Content-Type", contentType) + if params.Code != nil { - return req, nil -} + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "code", runtime.ParamLocationQuery, *params.Code); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } -// NewIntrospectAccessTokenRequestWithFormdataBody calls the generic IntrospectAccessToken builder with application/x-www-form-urlencoded body -func NewIntrospectAccessTokenRequestWithFormdataBody(server string, body IntrospectAccessTokenFormdataRequestBody) (*http.Request, error) { - var bodyReader io.Reader - bodyStr, err := runtime.MarshalForm(body, nil) + } + + if params.State != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "state", runtime.ParamLocationQuery, *params.State); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Error != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "error", runtime.ParamLocationQuery, *params.Error); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ErrorDescription != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "error_description", runtime.ParamLocationQuery, *params.ErrorDescription); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - bodyReader = strings.NewReader(bodyStr.Encode()) - return NewIntrospectAccessTokenRequestWithBody(server, "application/x-www-form-urlencoded", bodyReader) + + return req, nil } -// NewIntrospectAccessTokenRequestWithBody generates requests for IntrospectAccessToken with any type of body -func NewIntrospectAccessTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewOAuthClientMetadataRequest generates requests for OAuthClientMetadata +func NewOAuthClientMetadataRequest(server string, did string) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0 = did + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/internal/auth/v2/accesstoken/introspect") + operationPath := fmt.Sprintf("/oauth2/%s/oauth-client", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1071,33 +999,28 @@ func NewIntrospectAccessTokenRequestWithBody(server string, contentType string, return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewRetrieveAccessTokenRequest generates requests for RetrieveAccessToken -func NewRetrieveAccessTokenRequest(server string, sessionID string) (*http.Request, error) { +// NewPresentationDefinitionRequest generates requests for PresentationDefinition +func NewPresentationDefinitionRequest(server string, did string, params *PresentationDefinitionParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sessionID", runtime.ParamLocationPath, sessionID) - if err != nil { - return nil, err - } + pathParam0 = did serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/internal/auth/v2/accesstoken/%s", pathParam0) + operationPath := fmt.Sprintf("/oauth2/%s/presentation_definition", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1107,6 +1030,24 @@ func NewRetrieveAccessTokenRequest(server string, sessionID string) (*http.Reque return nil, err } + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "scope", runtime.ParamLocationQuery, params.Scope); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -1115,19 +1056,19 @@ func NewRetrieveAccessTokenRequest(server string, sessionID string) (*http.Reque return req, nil } -// NewRequestServiceAccessTokenRequest calls the generic RequestServiceAccessToken builder with application/json body -func NewRequestServiceAccessTokenRequest(server string, did string, body RequestServiceAccessTokenJSONRequestBody) (*http.Request, error) { +// NewHandleAuthorizeResponseRequestWithFormdataBody calls the generic HandleAuthorizeResponse builder with application/x-www-form-urlencoded body +func NewHandleAuthorizeResponseRequestWithFormdataBody(server string, did string, body HandleAuthorizeResponseFormdataRequestBody) (*http.Request, error) { var bodyReader io.Reader - buf, err := json.Marshal(body) + bodyStr, err := runtime.MarshalForm(body, nil) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewRequestServiceAccessTokenRequestWithBody(server, did, "application/json", bodyReader) + bodyReader = strings.NewReader(bodyStr.Encode()) + return NewHandleAuthorizeResponseRequestWithBody(server, did, "application/x-www-form-urlencoded", bodyReader) } -// NewRequestServiceAccessTokenRequestWithBody generates requests for RequestServiceAccessToken with any type of body -func NewRequestServiceAccessTokenRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error) { +// NewHandleAuthorizeResponseRequestWithBody generates requests for HandleAuthorizeResponse with any type of body +func NewHandleAuthorizeResponseRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -1139,7 +1080,7 @@ func NewRequestServiceAccessTokenRequestWithBody(server string, did string, cont return nil, err } - operationPath := fmt.Sprintf("/internal/auth/v2/%s/request-service-access-token", pathParam0) + operationPath := fmt.Sprintf("/oauth2/%s/response", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1159,19 +1100,19 @@ func NewRequestServiceAccessTokenRequestWithBody(server string, did string, cont return req, nil } -// NewRequestUserAccessTokenRequest calls the generic RequestUserAccessToken builder with application/json body -func NewRequestUserAccessTokenRequest(server string, did string, body RequestUserAccessTokenJSONRequestBody) (*http.Request, error) { +// NewHandleTokenRequestRequestWithFormdataBody calls the generic HandleTokenRequest builder with application/x-www-form-urlencoded body +func NewHandleTokenRequestRequestWithFormdataBody(server string, did string, body HandleTokenRequestFormdataRequestBody) (*http.Request, error) { var bodyReader io.Reader - buf, err := json.Marshal(body) + bodyStr, err := runtime.MarshalForm(body, nil) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewRequestUserAccessTokenRequestWithBody(server, did, "application/json", bodyReader) + bodyReader = strings.NewReader(bodyStr.Encode()) + return NewHandleTokenRequestRequestWithBody(server, did, "application/x-www-form-urlencoded", bodyReader) } -// NewRequestUserAccessTokenRequestWithBody generates requests for RequestUserAccessToken with any type of body -func NewRequestUserAccessTokenRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error) { +// NewHandleTokenRequestRequestWithBody generates requests for HandleTokenRequest with any type of body +func NewHandleTokenRequestRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -1183,7 +1124,7 @@ func NewRequestUserAccessTokenRequestWithBody(server string, did string, content return nil, err } - operationPath := fmt.Sprintf("/internal/auth/v2/%s/request-user-access-token", pathParam0) + operationPath := fmt.Sprintf("/oauth2/%s/token", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1203,6 +1144,44 @@ func NewRequestUserAccessTokenRequestWithBody(server string, did string, content return req, nil } +// NewStatusListRequest generates requests for StatusList +func NewStatusListRequest(server string, did string, page int) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0 = did + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "page", runtime.ParamLocationPath, page) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/statuslist/%s/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { for _, r := range c.RequestEditors { if err := r(ctx, req); err != nil { @@ -1249,34 +1228,9 @@ type ClientWithResponsesInterface interface { // OAuthAuthorizationServerMetadataWithResponse request OAuthAuthorizationServerMetadataWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*OAuthAuthorizationServerMetadataResponse, error) - // HandleAuthorizeRequestWithResponse request - HandleAuthorizeRequestWithResponse(ctx context.Context, id string, params *HandleAuthorizeRequestParams, reqEditors ...RequestEditorFn) (*HandleAuthorizeRequestResponse, error) - - // CallbackWithResponse request - CallbackWithResponse(ctx context.Context, id string, params *CallbackParams, reqEditors ...RequestEditorFn) (*CallbackResponse, error) - // GetWebDIDWithResponse request GetWebDIDWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetWebDIDResponse, error) - // OAuthClientMetadataWithResponse request - OAuthClientMetadataWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*OAuthClientMetadataResponse, error) - - // PresentationDefinitionWithResponse request - PresentationDefinitionWithResponse(ctx context.Context, id string, params *PresentationDefinitionParams, reqEditors ...RequestEditorFn) (*PresentationDefinitionResponse, error) - - // HandleAuthorizeResponseWithBodyWithResponse request with any body - HandleAuthorizeResponseWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleAuthorizeResponseResponse, error) - - HandleAuthorizeResponseWithFormdataBodyWithResponse(ctx context.Context, id string, body HandleAuthorizeResponseFormdataRequestBody, reqEditors ...RequestEditorFn) (*HandleAuthorizeResponseResponse, error) - - // StatusListWithResponse request - StatusListWithResponse(ctx context.Context, id string, page int, reqEditors ...RequestEditorFn) (*StatusListResponse, error) - - // HandleTokenRequestWithBodyWithResponse request with any body - HandleTokenRequestWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleTokenRequestResponse, error) - - HandleTokenRequestWithFormdataBodyWithResponse(ctx context.Context, id string, body HandleTokenRequestFormdataRequestBody, reqEditors ...RequestEditorFn) (*HandleTokenRequestResponse, error) - // IntrospectAccessTokenWithBodyWithResponse request with any body IntrospectAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IntrospectAccessTokenResponse, error) @@ -1294,6 +1248,31 @@ type ClientWithResponsesInterface interface { RequestUserAccessTokenWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestUserAccessTokenResponse, error) RequestUserAccessTokenWithResponse(ctx context.Context, did string, body RequestUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestUserAccessTokenResponse, error) + + // HandleAuthorizeRequestWithResponse request + HandleAuthorizeRequestWithResponse(ctx context.Context, did string, params *HandleAuthorizeRequestParams, reqEditors ...RequestEditorFn) (*HandleAuthorizeRequestResponse, error) + + // CallbackWithResponse request + CallbackWithResponse(ctx context.Context, did string, params *CallbackParams, reqEditors ...RequestEditorFn) (*CallbackResponse, error) + + // OAuthClientMetadataWithResponse request + OAuthClientMetadataWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*OAuthClientMetadataResponse, error) + + // PresentationDefinitionWithResponse request + PresentationDefinitionWithResponse(ctx context.Context, did string, params *PresentationDefinitionParams, reqEditors ...RequestEditorFn) (*PresentationDefinitionResponse, error) + + // HandleAuthorizeResponseWithBodyWithResponse request with any body + HandleAuthorizeResponseWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleAuthorizeResponseResponse, error) + + HandleAuthorizeResponseWithFormdataBodyWithResponse(ctx context.Context, did string, body HandleAuthorizeResponseFormdataRequestBody, reqEditors ...RequestEditorFn) (*HandleAuthorizeResponseResponse, error) + + // HandleTokenRequestWithBodyWithResponse request with any body + HandleTokenRequestWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleTokenRequestResponse, error) + + HandleTokenRequestWithFormdataBodyWithResponse(ctx context.Context, did string, body HandleTokenRequestFormdataRequestBody, reqEditors ...RequestEditorFn) (*HandleTokenRequestResponse, error) + + // StatusListWithResponse request + StatusListWithResponse(ctx context.Context, did string, page int, reqEditors ...RequestEditorFn) (*StatusListResponse, error) } type OAuthAuthorizationServerMetadataResponse struct { @@ -1328,13 +1307,14 @@ func (r OAuthAuthorizationServerMetadataResponse) StatusCode() int { return 0 } -type HandleAuthorizeRequestResponse struct { +type GetWebDIDResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *DIDDocument } // Status returns HTTPResponse.Status -func (r HandleAuthorizeRequestResponse) Status() string { +func (r GetWebDIDResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1342,30 +1322,21 @@ func (r HandleAuthorizeRequestResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r HandleAuthorizeRequestResponse) StatusCode() int { +func (r GetWebDIDResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CallbackResponse struct { - Body []byte - HTTPResponse *http.Response - ApplicationproblemJSONDefault *struct { - // Detail A human-readable explanation specific to this occurrence of the problem. - Detail string `json:"detail"` - - // Status HTTP statuscode - Status float32 `json:"status"` - - // Title A short, human-readable summary of the problem type. - Title string `json:"title"` - } +type IntrospectAccessTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *TokenIntrospectionResponse } // Status returns HTTPResponse.Status -func (r CallbackResponse) Status() string { +func (r IntrospectAccessTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1373,21 +1344,31 @@ func (r CallbackResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CallbackResponse) StatusCode() int { +func (r IntrospectAccessTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetWebDIDResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DIDDocument +type RetrieveAccessTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *TokenResponse + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } } // Status returns HTTPResponse.Status -func (r GetWebDIDResponse) Status() string { +func (r RetrieveAccessTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1395,17 +1376,17 @@ func (r GetWebDIDResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetWebDIDResponse) StatusCode() int { +func (r RetrieveAccessTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type OAuthClientMetadataResponse struct { +type RequestServiceAccessTokenResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *OAuthClientMetadata + JSON200 *TokenResponse ApplicationproblemJSONDefault *struct { // Detail A human-readable explanation specific to this occurrence of the problem. Detail string `json:"detail"` @@ -1419,7 +1400,7 @@ type OAuthClientMetadataResponse struct { } // Status returns HTTPResponse.Status -func (r OAuthClientMetadataResponse) Status() string { +func (r RequestServiceAccessTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1427,17 +1408,17 @@ func (r OAuthClientMetadataResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r OAuthClientMetadataResponse) StatusCode() int { +func (r RequestServiceAccessTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PresentationDefinitionResponse struct { +type RequestUserAccessTokenResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *PresentationDefinition + JSON200 *RedirectResponseWithID ApplicationproblemJSONDefault *struct { // Detail A human-readable explanation specific to this occurrence of the problem. Detail string `json:"detail"` @@ -1451,7 +1432,7 @@ type PresentationDefinitionResponse struct { } // Status returns HTTPResponse.Status -func (r PresentationDefinitionResponse) Status() string { +func (r RequestUserAccessTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1459,21 +1440,20 @@ func (r PresentationDefinitionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PresentationDefinitionResponse) StatusCode() int { +func (r RequestUserAccessTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type HandleAuthorizeResponseResponse struct { +type HandleAuthorizeRequestResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *RedirectResponse } // Status returns HTTPResponse.Status -func (r HandleAuthorizeResponseResponse) Status() string { +func (r HandleAuthorizeRequestResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1481,17 +1461,16 @@ func (r HandleAuthorizeResponseResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r HandleAuthorizeResponseResponse) StatusCode() int { +func (r HandleAuthorizeRequestResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type StatusListResponse struct { +type CallbackResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *VerifiableCredential ApplicationproblemJSONDefault *struct { // Detail A human-readable explanation specific to this occurrence of the problem. Detail string `json:"detail"` @@ -1505,7 +1484,7 @@ type StatusListResponse struct { } // Status returns HTTPResponse.Status -func (r StatusListResponse) Status() string { +func (r CallbackResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1513,17 +1492,17 @@ func (r StatusListResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r StatusListResponse) StatusCode() int { +func (r CallbackResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type HandleTokenRequestResponse struct { +type OAuthClientMetadataResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *TokenResponse + JSON200 *OAuthClientMetadata ApplicationproblemJSONDefault *struct { // Detail A human-readable explanation specific to this occurrence of the problem. Detail string `json:"detail"` @@ -1537,7 +1516,7 @@ type HandleTokenRequestResponse struct { } // Status returns HTTPResponse.Status -func (r HandleTokenRequestResponse) Status() string { +func (r OAuthClientMetadataResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1545,21 +1524,31 @@ func (r HandleTokenRequestResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r HandleTokenRequestResponse) StatusCode() int { +func (r OAuthClientMetadataResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type IntrospectAccessTokenResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *TokenIntrospectionResponse +type PresentationDefinitionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PresentationDefinition + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } } // Status returns HTTPResponse.Status -func (r IntrospectAccessTokenResponse) Status() string { +func (r PresentationDefinitionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1567,31 +1556,21 @@ func (r IntrospectAccessTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r IntrospectAccessTokenResponse) StatusCode() int { +func (r PresentationDefinitionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type RetrieveAccessTokenResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *TokenResponse - ApplicationproblemJSONDefault *struct { - // Detail A human-readable explanation specific to this occurrence of the problem. - Detail string `json:"detail"` - - // Status HTTP statuscode - Status float32 `json:"status"` - - // Title A short, human-readable summary of the problem type. - Title string `json:"title"` - } +type HandleAuthorizeResponseResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *RedirectResponse } // Status returns HTTPResponse.Status -func (r RetrieveAccessTokenResponse) Status() string { +func (r HandleAuthorizeResponseResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1599,14 +1578,14 @@ func (r RetrieveAccessTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r RetrieveAccessTokenResponse) StatusCode() int { +func (r HandleAuthorizeResponseResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type RequestServiceAccessTokenResponse struct { +type HandleTokenRequestResponse struct { Body []byte HTTPResponse *http.Response JSON200 *TokenResponse @@ -1623,7 +1602,7 @@ type RequestServiceAccessTokenResponse struct { } // Status returns HTTPResponse.Status -func (r RequestServiceAccessTokenResponse) Status() string { +func (r HandleTokenRequestResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1631,17 +1610,17 @@ func (r RequestServiceAccessTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r RequestServiceAccessTokenResponse) StatusCode() int { +func (r HandleTokenRequestResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type RequestUserAccessTokenResponse struct { +type StatusListResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *RedirectResponseWithID + JSON200 *VerifiableCredential ApplicationproblemJSONDefault *struct { // Detail A human-readable explanation specific to this occurrence of the problem. Detail string `json:"detail"` @@ -1655,7 +1634,7 @@ type RequestUserAccessTokenResponse struct { } // Status returns HTTPResponse.Status -func (r RequestUserAccessTokenResponse) Status() string { +func (r StatusListResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1663,7 +1642,7 @@ func (r RequestUserAccessTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r RequestUserAccessTokenResponse) StatusCode() int { +func (r StatusListResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -1679,152 +1658,152 @@ func (c *ClientWithResponses) OAuthAuthorizationServerMetadataWithResponse(ctx c return ParseOAuthAuthorizationServerMetadataResponse(rsp) } -// HandleAuthorizeRequestWithResponse request returning *HandleAuthorizeRequestResponse -func (c *ClientWithResponses) HandleAuthorizeRequestWithResponse(ctx context.Context, id string, params *HandleAuthorizeRequestParams, reqEditors ...RequestEditorFn) (*HandleAuthorizeRequestResponse, error) { - rsp, err := c.HandleAuthorizeRequest(ctx, id, params, reqEditors...) +// GetWebDIDWithResponse request returning *GetWebDIDResponse +func (c *ClientWithResponses) GetWebDIDWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetWebDIDResponse, error) { + rsp, err := c.GetWebDID(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseHandleAuthorizeRequestResponse(rsp) + return ParseGetWebDIDResponse(rsp) } -// CallbackWithResponse request returning *CallbackResponse -func (c *ClientWithResponses) CallbackWithResponse(ctx context.Context, id string, params *CallbackParams, reqEditors ...RequestEditorFn) (*CallbackResponse, error) { - rsp, err := c.Callback(ctx, id, params, reqEditors...) +// IntrospectAccessTokenWithBodyWithResponse request with arbitrary body returning *IntrospectAccessTokenResponse +func (c *ClientWithResponses) IntrospectAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IntrospectAccessTokenResponse, error) { + rsp, err := c.IntrospectAccessTokenWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCallbackResponse(rsp) + return ParseIntrospectAccessTokenResponse(rsp) } -// GetWebDIDWithResponse request returning *GetWebDIDResponse -func (c *ClientWithResponses) GetWebDIDWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetWebDIDResponse, error) { - rsp, err := c.GetWebDID(ctx, id, reqEditors...) +func (c *ClientWithResponses) IntrospectAccessTokenWithFormdataBodyWithResponse(ctx context.Context, body IntrospectAccessTokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*IntrospectAccessTokenResponse, error) { + rsp, err := c.IntrospectAccessTokenWithFormdataBody(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseGetWebDIDResponse(rsp) + return ParseIntrospectAccessTokenResponse(rsp) } -// OAuthClientMetadataWithResponse request returning *OAuthClientMetadataResponse -func (c *ClientWithResponses) OAuthClientMetadataWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*OAuthClientMetadataResponse, error) { - rsp, err := c.OAuthClientMetadata(ctx, id, reqEditors...) +// RetrieveAccessTokenWithResponse request returning *RetrieveAccessTokenResponse +func (c *ClientWithResponses) RetrieveAccessTokenWithResponse(ctx context.Context, sessionID string, reqEditors ...RequestEditorFn) (*RetrieveAccessTokenResponse, error) { + rsp, err := c.RetrieveAccessToken(ctx, sessionID, reqEditors...) if err != nil { return nil, err } - return ParseOAuthClientMetadataResponse(rsp) + return ParseRetrieveAccessTokenResponse(rsp) } -// PresentationDefinitionWithResponse request returning *PresentationDefinitionResponse -func (c *ClientWithResponses) PresentationDefinitionWithResponse(ctx context.Context, id string, params *PresentationDefinitionParams, reqEditors ...RequestEditorFn) (*PresentationDefinitionResponse, error) { - rsp, err := c.PresentationDefinition(ctx, id, params, reqEditors...) +// RequestServiceAccessTokenWithBodyWithResponse request with arbitrary body returning *RequestServiceAccessTokenResponse +func (c *ClientWithResponses) RequestServiceAccessTokenWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestServiceAccessTokenResponse, error) { + rsp, err := c.RequestServiceAccessTokenWithBody(ctx, did, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParsePresentationDefinitionResponse(rsp) + return ParseRequestServiceAccessTokenResponse(rsp) } -// HandleAuthorizeResponseWithBodyWithResponse request with arbitrary body returning *HandleAuthorizeResponseResponse -func (c *ClientWithResponses) HandleAuthorizeResponseWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleAuthorizeResponseResponse, error) { - rsp, err := c.HandleAuthorizeResponseWithBody(ctx, id, contentType, body, reqEditors...) +func (c *ClientWithResponses) RequestServiceAccessTokenWithResponse(ctx context.Context, did string, body RequestServiceAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestServiceAccessTokenResponse, error) { + rsp, err := c.RequestServiceAccessToken(ctx, did, body, reqEditors...) if err != nil { return nil, err } - return ParseHandleAuthorizeResponseResponse(rsp) + return ParseRequestServiceAccessTokenResponse(rsp) } -func (c *ClientWithResponses) HandleAuthorizeResponseWithFormdataBodyWithResponse(ctx context.Context, id string, body HandleAuthorizeResponseFormdataRequestBody, reqEditors ...RequestEditorFn) (*HandleAuthorizeResponseResponse, error) { - rsp, err := c.HandleAuthorizeResponseWithFormdataBody(ctx, id, body, reqEditors...) +// RequestUserAccessTokenWithBodyWithResponse request with arbitrary body returning *RequestUserAccessTokenResponse +func (c *ClientWithResponses) RequestUserAccessTokenWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestUserAccessTokenResponse, error) { + rsp, err := c.RequestUserAccessTokenWithBody(ctx, did, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseHandleAuthorizeResponseResponse(rsp) + return ParseRequestUserAccessTokenResponse(rsp) } -// StatusListWithResponse request returning *StatusListResponse -func (c *ClientWithResponses) StatusListWithResponse(ctx context.Context, id string, page int, reqEditors ...RequestEditorFn) (*StatusListResponse, error) { - rsp, err := c.StatusList(ctx, id, page, reqEditors...) +func (c *ClientWithResponses) RequestUserAccessTokenWithResponse(ctx context.Context, did string, body RequestUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestUserAccessTokenResponse, error) { + rsp, err := c.RequestUserAccessToken(ctx, did, body, reqEditors...) if err != nil { return nil, err } - return ParseStatusListResponse(rsp) + return ParseRequestUserAccessTokenResponse(rsp) } -// HandleTokenRequestWithBodyWithResponse request with arbitrary body returning *HandleTokenRequestResponse -func (c *ClientWithResponses) HandleTokenRequestWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleTokenRequestResponse, error) { - rsp, err := c.HandleTokenRequestWithBody(ctx, id, contentType, body, reqEditors...) +// HandleAuthorizeRequestWithResponse request returning *HandleAuthorizeRequestResponse +func (c *ClientWithResponses) HandleAuthorizeRequestWithResponse(ctx context.Context, did string, params *HandleAuthorizeRequestParams, reqEditors ...RequestEditorFn) (*HandleAuthorizeRequestResponse, error) { + rsp, err := c.HandleAuthorizeRequest(ctx, did, params, reqEditors...) if err != nil { return nil, err } - return ParseHandleTokenRequestResponse(rsp) + return ParseHandleAuthorizeRequestResponse(rsp) } -func (c *ClientWithResponses) HandleTokenRequestWithFormdataBodyWithResponse(ctx context.Context, id string, body HandleTokenRequestFormdataRequestBody, reqEditors ...RequestEditorFn) (*HandleTokenRequestResponse, error) { - rsp, err := c.HandleTokenRequestWithFormdataBody(ctx, id, body, reqEditors...) +// CallbackWithResponse request returning *CallbackResponse +func (c *ClientWithResponses) CallbackWithResponse(ctx context.Context, did string, params *CallbackParams, reqEditors ...RequestEditorFn) (*CallbackResponse, error) { + rsp, err := c.Callback(ctx, did, params, reqEditors...) if err != nil { return nil, err } - return ParseHandleTokenRequestResponse(rsp) + return ParseCallbackResponse(rsp) } -// IntrospectAccessTokenWithBodyWithResponse request with arbitrary body returning *IntrospectAccessTokenResponse -func (c *ClientWithResponses) IntrospectAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IntrospectAccessTokenResponse, error) { - rsp, err := c.IntrospectAccessTokenWithBody(ctx, contentType, body, reqEditors...) +// OAuthClientMetadataWithResponse request returning *OAuthClientMetadataResponse +func (c *ClientWithResponses) OAuthClientMetadataWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*OAuthClientMetadataResponse, error) { + rsp, err := c.OAuthClientMetadata(ctx, did, reqEditors...) if err != nil { return nil, err } - return ParseIntrospectAccessTokenResponse(rsp) + return ParseOAuthClientMetadataResponse(rsp) } -func (c *ClientWithResponses) IntrospectAccessTokenWithFormdataBodyWithResponse(ctx context.Context, body IntrospectAccessTokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*IntrospectAccessTokenResponse, error) { - rsp, err := c.IntrospectAccessTokenWithFormdataBody(ctx, body, reqEditors...) +// PresentationDefinitionWithResponse request returning *PresentationDefinitionResponse +func (c *ClientWithResponses) PresentationDefinitionWithResponse(ctx context.Context, did string, params *PresentationDefinitionParams, reqEditors ...RequestEditorFn) (*PresentationDefinitionResponse, error) { + rsp, err := c.PresentationDefinition(ctx, did, params, reqEditors...) if err != nil { return nil, err } - return ParseIntrospectAccessTokenResponse(rsp) + return ParsePresentationDefinitionResponse(rsp) } -// RetrieveAccessTokenWithResponse request returning *RetrieveAccessTokenResponse -func (c *ClientWithResponses) RetrieveAccessTokenWithResponse(ctx context.Context, sessionID string, reqEditors ...RequestEditorFn) (*RetrieveAccessTokenResponse, error) { - rsp, err := c.RetrieveAccessToken(ctx, sessionID, reqEditors...) +// HandleAuthorizeResponseWithBodyWithResponse request with arbitrary body returning *HandleAuthorizeResponseResponse +func (c *ClientWithResponses) HandleAuthorizeResponseWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleAuthorizeResponseResponse, error) { + rsp, err := c.HandleAuthorizeResponseWithBody(ctx, did, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseRetrieveAccessTokenResponse(rsp) + return ParseHandleAuthorizeResponseResponse(rsp) } -// RequestServiceAccessTokenWithBodyWithResponse request with arbitrary body returning *RequestServiceAccessTokenResponse -func (c *ClientWithResponses) RequestServiceAccessTokenWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestServiceAccessTokenResponse, error) { - rsp, err := c.RequestServiceAccessTokenWithBody(ctx, did, contentType, body, reqEditors...) +func (c *ClientWithResponses) HandleAuthorizeResponseWithFormdataBodyWithResponse(ctx context.Context, did string, body HandleAuthorizeResponseFormdataRequestBody, reqEditors ...RequestEditorFn) (*HandleAuthorizeResponseResponse, error) { + rsp, err := c.HandleAuthorizeResponseWithFormdataBody(ctx, did, body, reqEditors...) if err != nil { return nil, err } - return ParseRequestServiceAccessTokenResponse(rsp) + return ParseHandleAuthorizeResponseResponse(rsp) } -func (c *ClientWithResponses) RequestServiceAccessTokenWithResponse(ctx context.Context, did string, body RequestServiceAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestServiceAccessTokenResponse, error) { - rsp, err := c.RequestServiceAccessToken(ctx, did, body, reqEditors...) +// HandleTokenRequestWithBodyWithResponse request with arbitrary body returning *HandleTokenRequestResponse +func (c *ClientWithResponses) HandleTokenRequestWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleTokenRequestResponse, error) { + rsp, err := c.HandleTokenRequestWithBody(ctx, did, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseRequestServiceAccessTokenResponse(rsp) + return ParseHandleTokenRequestResponse(rsp) } -// RequestUserAccessTokenWithBodyWithResponse request with arbitrary body returning *RequestUserAccessTokenResponse -func (c *ClientWithResponses) RequestUserAccessTokenWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestUserAccessTokenResponse, error) { - rsp, err := c.RequestUserAccessTokenWithBody(ctx, did, contentType, body, reqEditors...) +func (c *ClientWithResponses) HandleTokenRequestWithFormdataBodyWithResponse(ctx context.Context, did string, body HandleTokenRequestFormdataRequestBody, reqEditors ...RequestEditorFn) (*HandleTokenRequestResponse, error) { + rsp, err := c.HandleTokenRequestWithFormdataBody(ctx, did, body, reqEditors...) if err != nil { return nil, err } - return ParseRequestUserAccessTokenResponse(rsp) + return ParseHandleTokenRequestResponse(rsp) } -func (c *ClientWithResponses) RequestUserAccessTokenWithResponse(ctx context.Context, did string, body RequestUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestUserAccessTokenResponse, error) { - rsp, err := c.RequestUserAccessToken(ctx, did, body, reqEditors...) +// StatusListWithResponse request returning *StatusListResponse +func (c *ClientWithResponses) StatusListWithResponse(ctx context.Context, did string, page int, reqEditors ...RequestEditorFn) (*StatusListResponse, error) { + rsp, err := c.StatusList(ctx, did, page, reqEditors...) if err != nil { return nil, err } - return ParseRequestUserAccessTokenResponse(rsp) + return ParseStatusListResponse(rsp) } // ParseOAuthAuthorizationServerMetadataResponse parses an HTTP response from a OAuthAuthorizationServerMetadataWithResponse call @@ -1869,99 +1848,116 @@ func ParseOAuthAuthorizationServerMetadataResponse(rsp *http.Response) (*OAuthAu return response, nil } -// ParseHandleAuthorizeRequestResponse parses an HTTP response from a HandleAuthorizeRequestWithResponse call -func ParseHandleAuthorizeRequestResponse(rsp *http.Response) (*HandleAuthorizeRequestResponse, error) { +// ParseGetWebDIDResponse parses an HTTP response from a GetWebDIDWithResponse call +func ParseGetWebDIDResponse(rsp *http.Response) (*GetWebDIDResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &HandleAuthorizeRequestResponse{ + response := &GetWebDIDResponse{ Body: bodyBytes, HTTPResponse: rsp, } + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DIDDocument + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + return response, nil } -// ParseCallbackResponse parses an HTTP response from a CallbackWithResponse call -func ParseCallbackResponse(rsp *http.Response) (*CallbackResponse, error) { +// ParseIntrospectAccessTokenResponse parses an HTTP response from a IntrospectAccessTokenWithResponse call +func ParseIntrospectAccessTokenResponse(rsp *http.Response) (*IntrospectAccessTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CallbackResponse{ + response := &IntrospectAccessTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest struct { - // Detail A human-readable explanation specific to this occurrence of the problem. - Detail string `json:"detail"` - - // Status HTTP statuscode - Status float32 `json:"status"` - - // Title A short, human-readable summary of the problem type. - Title string `json:"title"` - } + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest TokenIntrospectionResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSONDefault = &dest + response.JSON200 = &dest } return response, nil } -// ParseGetWebDIDResponse parses an HTTP response from a GetWebDIDWithResponse call -func ParseGetWebDIDResponse(rsp *http.Response) (*GetWebDIDResponse, error) { +// ParseRetrieveAccessTokenResponse parses an HTTP response from a RetrieveAccessTokenWithResponse call +func ParseRetrieveAccessTokenResponse(rsp *http.Response) (*RetrieveAccessTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetWebDIDResponse{ + response := &RetrieveAccessTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DIDDocument + var dest TokenResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + } return response, nil } -// ParseOAuthClientMetadataResponse parses an HTTP response from a OAuthClientMetadataWithResponse call -func ParseOAuthClientMetadataResponse(rsp *http.Response) (*OAuthClientMetadataResponse, error) { +// ParseRequestServiceAccessTokenResponse parses an HTTP response from a RequestServiceAccessTokenWithResponse call +func ParseRequestServiceAccessTokenResponse(rsp *http.Response) (*RequestServiceAccessTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &OAuthClientMetadataResponse{ + response := &RequestServiceAccessTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest OAuthClientMetadata + var dest TokenResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -1988,22 +1984,22 @@ func ParseOAuthClientMetadataResponse(rsp *http.Response) (*OAuthClientMetadataR return response, nil } -// ParsePresentationDefinitionResponse parses an HTTP response from a PresentationDefinitionWithResponse call -func ParsePresentationDefinitionResponse(rsp *http.Response) (*PresentationDefinitionResponse, error) { +// ParseRequestUserAccessTokenResponse parses an HTTP response from a RequestUserAccessTokenWithResponse call +func ParseRequestUserAccessTokenResponse(rsp *http.Response) (*RequestUserAccessTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PresentationDefinitionResponse{ + response := &RequestUserAccessTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PresentationDefinition + var dest RedirectResponseWithID if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2030,53 +2026,36 @@ func ParsePresentationDefinitionResponse(rsp *http.Response) (*PresentationDefin return response, nil } -// ParseHandleAuthorizeResponseResponse parses an HTTP response from a HandleAuthorizeResponseWithResponse call -func ParseHandleAuthorizeResponseResponse(rsp *http.Response) (*HandleAuthorizeResponseResponse, error) { +// ParseHandleAuthorizeRequestResponse parses an HTTP response from a HandleAuthorizeRequestWithResponse call +func ParseHandleAuthorizeRequestResponse(rsp *http.Response) (*HandleAuthorizeRequestResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &HandleAuthorizeResponseResponse{ + response := &HandleAuthorizeRequestResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest RedirectResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - return response, nil } -// ParseStatusListResponse parses an HTTP response from a StatusListWithResponse call -func ParseStatusListResponse(rsp *http.Response) (*StatusListResponse, error) { +// ParseCallbackResponse parses an HTTP response from a CallbackWithResponse call +func ParseCallbackResponse(rsp *http.Response) (*CallbackResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &StatusListResponse{ + response := &CallbackResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest VerifiableCredential - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest struct { // Detail A human-readable explanation specific to this occurrence of the problem. @@ -2098,22 +2077,22 @@ func ParseStatusListResponse(rsp *http.Response) (*StatusListResponse, error) { return response, nil } -// ParseHandleTokenRequestResponse parses an HTTP response from a HandleTokenRequestWithResponse call -func ParseHandleTokenRequestResponse(rsp *http.Response) (*HandleTokenRequestResponse, error) { +// ParseOAuthClientMetadataResponse parses an HTTP response from a OAuthClientMetadataWithResponse call +func ParseOAuthClientMetadataResponse(rsp *http.Response) (*OAuthClientMetadataResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &HandleTokenRequestResponse{ + response := &OAuthClientMetadataResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TokenResponse + var dest OAuthClientMetadata if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2140,83 +2119,83 @@ func ParseHandleTokenRequestResponse(rsp *http.Response) (*HandleTokenRequestRes return response, nil } -// ParseIntrospectAccessTokenResponse parses an HTTP response from a IntrospectAccessTokenWithResponse call -func ParseIntrospectAccessTokenResponse(rsp *http.Response) (*IntrospectAccessTokenResponse, error) { +// ParsePresentationDefinitionResponse parses an HTTP response from a PresentationDefinitionWithResponse call +func ParsePresentationDefinitionResponse(rsp *http.Response) (*PresentationDefinitionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &IntrospectAccessTokenResponse{ + response := &PresentationDefinitionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TokenIntrospectionResponse + var dest PresentationDefinition if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + } return response, nil } -// ParseRetrieveAccessTokenResponse parses an HTTP response from a RetrieveAccessTokenWithResponse call -func ParseRetrieveAccessTokenResponse(rsp *http.Response) (*RetrieveAccessTokenResponse, error) { +// ParseHandleAuthorizeResponseResponse parses an HTTP response from a HandleAuthorizeResponseWithResponse call +func ParseHandleAuthorizeResponseResponse(rsp *http.Response) (*HandleAuthorizeResponseResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &RetrieveAccessTokenResponse{ + response := &HandleAuthorizeResponseResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TokenResponse + var dest RedirectResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest struct { - // Detail A human-readable explanation specific to this occurrence of the problem. - Detail string `json:"detail"` - - // Status HTTP statuscode - Status float32 `json:"status"` - - // Title A short, human-readable summary of the problem type. - Title string `json:"title"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSONDefault = &dest - } return response, nil } -// ParseRequestServiceAccessTokenResponse parses an HTTP response from a RequestServiceAccessTokenWithResponse call -func ParseRequestServiceAccessTokenResponse(rsp *http.Response) (*RequestServiceAccessTokenResponse, error) { +// ParseHandleTokenRequestResponse parses an HTTP response from a HandleTokenRequestWithResponse call +func ParseHandleTokenRequestResponse(rsp *http.Response) (*HandleTokenRequestResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &RequestServiceAccessTokenResponse{ + response := &HandleTokenRequestResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2250,22 +2229,22 @@ func ParseRequestServiceAccessTokenResponse(rsp *http.Response) (*RequestService return response, nil } -// ParseRequestUserAccessTokenResponse parses an HTTP response from a RequestUserAccessTokenWithResponse call -func ParseRequestUserAccessTokenResponse(rsp *http.Response) (*RequestUserAccessTokenResponse, error) { +// ParseStatusListResponse parses an HTTP response from a StatusListWithResponse call +func ParseStatusListResponse(rsp *http.Response) (*StatusListResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &RequestUserAccessTokenResponse{ + response := &StatusListResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest RedirectResponseWithID + var dest VerifiableCredential if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/nuts/client/vcr.go b/nuts/client/vcr.go index 03dc987e..2e4215a8 100644 --- a/nuts/client/vcr.go +++ b/nuts/client/vcr.go @@ -5,8 +5,6 @@ import ( "encoding/json" "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/vc" - "github.com/nuts-foundation/nuts-node/vcr/credential" - "github.com/nuts-foundation/nuts-node/vcr/holder" "github.com/sirupsen/logrus" "net/http" "time" @@ -14,6 +12,9 @@ import ( "github.com/nuts-foundation/nuts-demo-ehr/nuts/client/vcr" ) +var NutsV1ContextURI = ssi.MustParseURI("https://nuts.nl/credentials/v1") +var VerifiableCredentialLDContextV1 = ssi.MustParseURI("https://www.w3.org/2018/credentials/v1") + type VCRClient interface { CreateVC(ctx context.Context, typeName, issuer string, credentialSubject map[string]interface{}, expirationDate *time.Time, publishPublic bool) error FindCredentials(ctx context.Context, credential vcr.SearchVCQuery, untrusted bool) ([]vc.VerifiableCredential, error) @@ -105,7 +106,7 @@ func (c HTTPClient) ResolveCredential(ctx context.Context, credentialID string) func GetNutsCredentialTemplate(credentialType ssi.URI) vcr.SearchVCQuery { return vcr.SearchVCQuery{ - Context: []ssi.URI{holder.VerifiableCredentialLDContextV1, credential.NutsV1ContextURI}, + Context: []ssi.URI{VerifiableCredentialLDContextV1, NutsV1ContextURI}, Type: []ssi.URI{vc.VerifiableCredentialTypeV1URI(), credentialType}, } } diff --git a/nuts/client/vdr.go b/nuts/client/vdr.go new file mode 100644 index 00000000..dda62694 --- /dev/null +++ b/nuts/client/vdr.go @@ -0,0 +1,44 @@ +package client + +import ( + "context" + "fmt" + "github.com/nuts-foundation/nuts-demo-ehr/nuts/client/vdr_v2" + "net/http" +) + +func (c HTTPClient) ResolveServiceEndpoint(ctx context.Context, did string, serviceType string, endpointType string) (interface{}, error) { + ep := vdr_v2.FilterServicesParamsEndpointType(endpointType) + response, err := c.vdr().FilterServices(ctx, did, &vdr_v2.FilterServicesParams{EndpointType: &ep, Type: &serviceType}) + if err != nil { + return "", err + } + if err = testResponseCode(http.StatusOK, response); err != nil { + return "", err + } + services, err := vdr_v2.ParseFilterServicesResponse(response) + if err != nil { + return "", err + } + if len(*services.JSON200) != 1 { + return "", fmt.Errorf("expected exactly one service (DID=%s, type=%s), got %d", did, serviceType, len(*services.JSON200)) + } + return (*services.JSON200)[0].ServiceEndpoint, nil +} + +func (c HTTPClient) vdr() vdr_v2.ClientInterface { + var response vdr_v2.ClientInterface + var err error + + if c.Authorizer != nil { + requestEditorFn := vdr_v2.RequestEditorFn(c.Authorizer.RequestEditorFn()) + response, err = vdr_v2.NewClientWithResponses(c.getNodeURL(), vdr_v2.WithRequestEditorFn(requestEditorFn)) + } else { + response, err = vdr_v2.NewClientWithResponses(c.getNodeURL()) + } + + if err != nil { + panic(err) + } + return response +} diff --git a/nuts/client/vdr_v2/generated.go b/nuts/client/vdr_v2/generated.go new file mode 100644 index 00000000..fd258a42 --- /dev/null +++ b/nuts/client/vdr_v2/generated.go @@ -0,0 +1,1660 @@ +// Package vdr_v2 provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT. +package vdr_v2 + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + externalRef0 "github.com/nuts-foundation/nuts-demo-ehr/nuts/client/common" + "github.com/oapi-codegen/runtime" +) + +const ( + JwtBearerAuthScopes = "jwtBearerAuth.Scopes" +) + +// Defines values for FilterServicesParamsEndpointType. +const ( + Array FilterServicesParamsEndpointType = "array" + Object FilterServicesParamsEndpointType = "object" + String FilterServicesParamsEndpointType = "string" +) + +// CreateDIDOptions defines model for CreateDIDOptions. +type CreateDIDOptions struct { + // Id The ID of the DID document. If not given, a random UUID is generated. + Id *string `json:"id,omitempty"` +} + +// DIDDocument A DID document according to the W3C spec following the Nuts Method rules as defined in [Nuts RFC006] +type DIDDocument = externalRef0.DIDDocument + +// DIDDocumentMetadata The DID document metadata. +type DIDDocumentMetadata = externalRef0.DIDDocumentMetadata + +// DIDResolutionResult defines model for DIDResolutionResult. +type DIDResolutionResult struct { + // Document A DID document according to the W3C spec following the Nuts Method rules as defined in [Nuts RFC006] + Document DIDDocument `json:"document"` + + // DocumentMetadata The DID document metadata. + DocumentMetadata DIDDocumentMetadata `json:"documentMetadata"` +} + +// Service A service supported by a DID subject. +type Service = externalRef0.Service + +// VerificationMethod A public key in JWK form. +type VerificationMethod = externalRef0.VerificationMethod + +// FilterServicesParams defines parameters for FilterServices. +type FilterServicesParams struct { + // Type Type of the service to filter for. If specified, only services with the given service type are returned. + Type *string `form:"type,omitempty" json:"type,omitempty"` + + // EndpointType The data type of the service endpoint to filter for. If specified, only services with the given endpoint type are returned. + // Endpoint types as mapped as follows: + // + // - string: serviceEndpoint contains a JSON string + // - array: serviceEndpoint contains a JSON array + // - object: serviceEndpoint contains a JSON object (key-value map) + // + // If not specified, services are not filtered on their endpoint data type. + EndpointType *FilterServicesParamsEndpointType `form:"endpointType,omitempty" json:"endpointType,omitempty"` +} + +// FilterServicesParamsEndpointType defines parameters for FilterServices. +type FilterServicesParamsEndpointType string + +// CreateDIDJSONRequestBody defines body for CreateDID for application/json ContentType. +type CreateDIDJSONRequestBody = CreateDIDOptions + +// CreateServiceJSONRequestBody defines body for CreateService for application/json ContentType. +type CreateServiceJSONRequestBody = Service + +// UpdateServiceJSONRequestBody defines body for UpdateService for application/json ContentType. +type UpdateServiceJSONRequestBody = Service + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // ListDIDs request + ListDIDs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateDIDWithBody request with any body + CreateDIDWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateDID(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteDID request + DeleteDID(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ResolveDID request + ResolveDID(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // FilterServices request + FilterServices(ctx context.Context, did string, params *FilterServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateServiceWithBody request with any body + CreateServiceWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateService(ctx context.Context, did string, body CreateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteService request + DeleteService(ctx context.Context, did string, serviceId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateServiceWithBody request with any body + UpdateServiceWithBody(ctx context.Context, did string, serviceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateService(ctx context.Context, did string, serviceId string, body UpdateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // AddVerificationMethod request + AddVerificationMethod(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteVerificationMethod request + DeleteVerificationMethod(ctx context.Context, did string, id string, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) ListDIDs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListDIDsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateDIDWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDIDRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateDID(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDIDRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteDID(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteDIDRequest(c.Server, did) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ResolveDID(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewResolveDIDRequest(c.Server, did) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) FilterServices(ctx context.Context, did string, params *FilterServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewFilterServicesRequest(c.Server, did, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateServiceWithBody(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateServiceRequestWithBody(c.Server, did, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateService(ctx context.Context, did string, body CreateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateServiceRequest(c.Server, did, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteService(ctx context.Context, did string, serviceId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteServiceRequest(c.Server, did, serviceId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateServiceWithBody(ctx context.Context, did string, serviceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateServiceRequestWithBody(c.Server, did, serviceId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateService(ctx context.Context, did string, serviceId string, body UpdateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateServiceRequest(c.Server, did, serviceId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) AddVerificationMethod(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAddVerificationMethodRequest(c.Server, did) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteVerificationMethod(ctx context.Context, did string, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteVerificationMethodRequest(c.Server, did, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewListDIDsRequest generates requests for ListDIDs +func NewListDIDsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateDIDRequest calls the generic CreateDID builder with application/json body +func NewCreateDIDRequest(server string, body CreateDIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateDIDRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateDIDRequestWithBody generates requests for CreateDID with any type of body +func NewCreateDIDRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteDIDRequest generates requests for DeleteDID +func NewDeleteDIDRequest(server string, did string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0 = did + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewResolveDIDRequest generates requests for ResolveDID +func NewResolveDIDRequest(server string, did string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0 = did + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewFilterServicesRequest generates requests for FilterServices +func NewFilterServicesRequest(server string, did string, params *FilterServicesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0 = did + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did/%s/service", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Type != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "type", runtime.ParamLocationQuery, *params.Type); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.EndpointType != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "endpointType", runtime.ParamLocationQuery, *params.EndpointType); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateServiceRequest calls the generic CreateService builder with application/json body +func NewCreateServiceRequest(server string, did string, body CreateServiceJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateServiceRequestWithBody(server, did, "application/json", bodyReader) +} + +// NewCreateServiceRequestWithBody generates requests for CreateService with any type of body +func NewCreateServiceRequestWithBody(server string, did string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0 = did + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did/%s/service", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteServiceRequest generates requests for DeleteService +func NewDeleteServiceRequest(server string, did string, serviceId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0 = did + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "serviceId", runtime.ParamLocationPath, serviceId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did/%s/service/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateServiceRequest calls the generic UpdateService builder with application/json body +func NewUpdateServiceRequest(server string, did string, serviceId string, body UpdateServiceJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateServiceRequestWithBody(server, did, serviceId, "application/json", bodyReader) +} + +// NewUpdateServiceRequestWithBody generates requests for UpdateService with any type of body +func NewUpdateServiceRequestWithBody(server string, did string, serviceId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0 = did + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "serviceId", runtime.ParamLocationPath, serviceId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did/%s/service/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewAddVerificationMethodRequest generates requests for AddVerificationMethod +func NewAddVerificationMethodRequest(server string, did string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0 = did + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did/%s/verificationmethod", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteVerificationMethodRequest generates requests for DeleteVerificationMethod +func NewDeleteVerificationMethodRequest(server string, did string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0 = did + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/internal/vdr/v2/did/%s/verificationmethod/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // ListDIDsWithResponse request + ListDIDsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDIDsResponse, error) + + // CreateDIDWithBodyWithResponse request with any body + CreateDIDWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error) + + CreateDIDWithResponse(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error) + + // DeleteDIDWithResponse request + DeleteDIDWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*DeleteDIDResponse, error) + + // ResolveDIDWithResponse request + ResolveDIDWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*ResolveDIDResponse, error) + + // FilterServicesWithResponse request + FilterServicesWithResponse(ctx context.Context, did string, params *FilterServicesParams, reqEditors ...RequestEditorFn) (*FilterServicesResponse, error) + + // CreateServiceWithBodyWithResponse request with any body + CreateServiceWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) + + CreateServiceWithResponse(ctx context.Context, did string, body CreateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) + + // DeleteServiceWithResponse request + DeleteServiceWithResponse(ctx context.Context, did string, serviceId string, reqEditors ...RequestEditorFn) (*DeleteServiceResponse, error) + + // UpdateServiceWithBodyWithResponse request with any body + UpdateServiceWithBodyWithResponse(ctx context.Context, did string, serviceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateServiceResponse, error) + + UpdateServiceWithResponse(ctx context.Context, did string, serviceId string, body UpdateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateServiceResponse, error) + + // AddVerificationMethodWithResponse request + AddVerificationMethodWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*AddVerificationMethodResponse, error) + + // DeleteVerificationMethodWithResponse request + DeleteVerificationMethodWithResponse(ctx context.Context, did string, id string, reqEditors ...RequestEditorFn) (*DeleteVerificationMethodResponse, error) +} + +type ListDIDsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]string + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r ListDIDsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListDIDsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateDIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DIDDocument + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r CreateDIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateDIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteDIDResponse struct { + Body []byte + HTTPResponse *http.Response + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r DeleteDIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteDIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ResolveDIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DIDResolutionResult + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r ResolveDIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ResolveDIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type FilterServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]Service + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r FilterServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r FilterServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateServiceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Service + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r CreateServiceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateServiceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteServiceResponse struct { + Body []byte + HTTPResponse *http.Response + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r DeleteServiceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteServiceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateServiceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Service + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r UpdateServiceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateServiceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AddVerificationMethodResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *VerificationMethod + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r AddVerificationMethodResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AddVerificationMethodResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteVerificationMethodResponse struct { + Body []byte + HTTPResponse *http.Response + ApplicationproblemJSONDefault *struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } +} + +// Status returns HTTPResponse.Status +func (r DeleteVerificationMethodResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteVerificationMethodResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ListDIDsWithResponse request returning *ListDIDsResponse +func (c *ClientWithResponses) ListDIDsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDIDsResponse, error) { + rsp, err := c.ListDIDs(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListDIDsResponse(rsp) +} + +// CreateDIDWithBodyWithResponse request with arbitrary body returning *CreateDIDResponse +func (c *ClientWithResponses) CreateDIDWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error) { + rsp, err := c.CreateDIDWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateDIDResponse(rsp) +} + +func (c *ClientWithResponses) CreateDIDWithResponse(ctx context.Context, body CreateDIDJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDIDResponse, error) { + rsp, err := c.CreateDID(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateDIDResponse(rsp) +} + +// DeleteDIDWithResponse request returning *DeleteDIDResponse +func (c *ClientWithResponses) DeleteDIDWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*DeleteDIDResponse, error) { + rsp, err := c.DeleteDID(ctx, did, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteDIDResponse(rsp) +} + +// ResolveDIDWithResponse request returning *ResolveDIDResponse +func (c *ClientWithResponses) ResolveDIDWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*ResolveDIDResponse, error) { + rsp, err := c.ResolveDID(ctx, did, reqEditors...) + if err != nil { + return nil, err + } + return ParseResolveDIDResponse(rsp) +} + +// FilterServicesWithResponse request returning *FilterServicesResponse +func (c *ClientWithResponses) FilterServicesWithResponse(ctx context.Context, did string, params *FilterServicesParams, reqEditors ...RequestEditorFn) (*FilterServicesResponse, error) { + rsp, err := c.FilterServices(ctx, did, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseFilterServicesResponse(rsp) +} + +// CreateServiceWithBodyWithResponse request with arbitrary body returning *CreateServiceResponse +func (c *ClientWithResponses) CreateServiceWithBodyWithResponse(ctx context.Context, did string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) { + rsp, err := c.CreateServiceWithBody(ctx, did, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateServiceResponse(rsp) +} + +func (c *ClientWithResponses) CreateServiceWithResponse(ctx context.Context, did string, body CreateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) { + rsp, err := c.CreateService(ctx, did, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateServiceResponse(rsp) +} + +// DeleteServiceWithResponse request returning *DeleteServiceResponse +func (c *ClientWithResponses) DeleteServiceWithResponse(ctx context.Context, did string, serviceId string, reqEditors ...RequestEditorFn) (*DeleteServiceResponse, error) { + rsp, err := c.DeleteService(ctx, did, serviceId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteServiceResponse(rsp) +} + +// UpdateServiceWithBodyWithResponse request with arbitrary body returning *UpdateServiceResponse +func (c *ClientWithResponses) UpdateServiceWithBodyWithResponse(ctx context.Context, did string, serviceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateServiceResponse, error) { + rsp, err := c.UpdateServiceWithBody(ctx, did, serviceId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateServiceResponse(rsp) +} + +func (c *ClientWithResponses) UpdateServiceWithResponse(ctx context.Context, did string, serviceId string, body UpdateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateServiceResponse, error) { + rsp, err := c.UpdateService(ctx, did, serviceId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateServiceResponse(rsp) +} + +// AddVerificationMethodWithResponse request returning *AddVerificationMethodResponse +func (c *ClientWithResponses) AddVerificationMethodWithResponse(ctx context.Context, did string, reqEditors ...RequestEditorFn) (*AddVerificationMethodResponse, error) { + rsp, err := c.AddVerificationMethod(ctx, did, reqEditors...) + if err != nil { + return nil, err + } + return ParseAddVerificationMethodResponse(rsp) +} + +// DeleteVerificationMethodWithResponse request returning *DeleteVerificationMethodResponse +func (c *ClientWithResponses) DeleteVerificationMethodWithResponse(ctx context.Context, did string, id string, reqEditors ...RequestEditorFn) (*DeleteVerificationMethodResponse, error) { + rsp, err := c.DeleteVerificationMethod(ctx, did, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteVerificationMethodResponse(rsp) +} + +// ParseListDIDsResponse parses an HTTP response from a ListDIDsWithResponse call +func ParseListDIDsResponse(rsp *http.Response) (*ListDIDsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListDIDsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} + +// ParseCreateDIDResponse parses an HTTP response from a CreateDIDWithResponse call +func ParseCreateDIDResponse(rsp *http.Response) (*CreateDIDResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateDIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DIDDocument + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteDIDResponse parses an HTTP response from a DeleteDIDWithResponse call +func ParseDeleteDIDResponse(rsp *http.Response) (*DeleteDIDResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteDIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} + +// ParseResolveDIDResponse parses an HTTP response from a ResolveDIDWithResponse call +func ParseResolveDIDResponse(rsp *http.Response) (*ResolveDIDResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ResolveDIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DIDResolutionResult + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} + +// ParseFilterServicesResponse parses an HTTP response from a FilterServicesWithResponse call +func ParseFilterServicesResponse(rsp *http.Response) (*FilterServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &FilterServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Service + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} + +// ParseCreateServiceResponse parses an HTTP response from a CreateServiceWithResponse call +func ParseCreateServiceResponse(rsp *http.Response) (*CreateServiceResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateServiceResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Service + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteServiceResponse parses an HTTP response from a DeleteServiceWithResponse call +func ParseDeleteServiceResponse(rsp *http.Response) (*DeleteServiceResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteServiceResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} + +// ParseUpdateServiceResponse parses an HTTP response from a UpdateServiceWithResponse call +func ParseUpdateServiceResponse(rsp *http.Response) (*UpdateServiceResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateServiceResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Service + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} + +// ParseAddVerificationMethodResponse parses an HTTP response from a AddVerificationMethodWithResponse call +func ParseAddVerificationMethodResponse(rsp *http.Response) (*AddVerificationMethodResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &AddVerificationMethodResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest VerificationMethod + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteVerificationMethodResponse parses an HTTP response from a DeleteVerificationMethodWithResponse call +func ParseDeleteVerificationMethodResponse(rsp *http.Response) (*DeleteVerificationMethodResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteVerificationMethodResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest struct { + // Detail A human-readable explanation specific to this occurrence of the problem. + Detail string `json:"detail"` + + // Status HTTP statuscode + Status float32 `json:"status"` + + // Title A short, human-readable summary of the problem type. + Title string `json:"title"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSONDefault = &dest + + } + + return response, nil +} diff --git a/nuts/registry/organizations.go b/nuts/registry/organizations.go index 983c74e8..6173f4b6 100644 --- a/nuts/registry/organizations.go +++ b/nuts/registry/organizations.go @@ -8,8 +8,6 @@ import ( "sync" "time" - "github.com/nuts-foundation/nuts-node/vcr/credential" - "github.com/nuts-foundation/nuts-demo-ehr/nuts/client" ) @@ -45,51 +43,31 @@ func (r remoteOrganizationRegistry) Get(ctx context.Context, organizationDID str return cached, nil } - query := client.GetNutsCredentialTemplate(*credential.NutsOrganizationCredentialTypeURI) - query.CredentialSubject = []interface{}{ - map[string]string{ - "id": organizationDID, - }, - } - credentials, err := r.client.FindCredentials(ctx, query, false) + searchResults, err := r.client.SearchDiscoveryService(ctx, map[string]string{ + "credentialSubject.id": organizationDID, + }, nil, nil) if err != nil { return nil, err } - if len(credentials) == 0 { - return nil, errors.New("organization not found") - } - // filter on credentialType. With JSONLD, the NutsOrganizationCredential only adds context but does not "select" anything. - // This will break when multiple types of credentials can be used! - j := 0 - for _, cred := range credentials { - found := false - for _, t := range cred.Type { - if t.String() == "NutsOrganizationCredential" { - found = true - } - } - if found { - credentials[j] = cred - j++ + + // find a search result that yields organization_name and organization_city + var results []nuts.NutsOrganization + for _, searchResult := range searchResults { + if searchResult.Details.Name == "" { + continue } + results = append(results, searchResult.NutsOrganization) } - credentials = credentials[:j] - if len(credentials) > 1 { + if len(results) > 1 { // TODO: Get latest issued VC, or maybe all of them? return nil, errors.New("multiple organizations found (not supported yet)") } - var results []nuts.NutsOrganization - err = credentials[0].UnmarshalCredentialSubject(&results) - if err != nil { - return nil, fmt.Errorf("unable to unmarshal NutsOrganizationCredential subject: %w", err) - } - if len(results) != 1 { - return nil, errors.New("expected exactly 1 subject in NutsOrganizationCredential") + if len(results) == 0 { + return nil, fmt.Errorf("organization not found on any Discovery Service: %s", organizationDID) } - result := results[0] - r.toCache(result) - return &result, nil + r.toCache(results[0]) + return &results[0], nil } func (r remoteOrganizationRegistry) GetCompoundServiceEndpoint(ctx context.Context, organizationDID, serviceType string, field string) (string, error) { diff --git a/nuts/registry/verifiable_credential.go b/nuts/registry/verifiable_credential.go index 64f5f974..de566669 100644 --- a/nuts/registry/verifiable_credential.go +++ b/nuts/registry/verifiable_credential.go @@ -4,12 +4,10 @@ import ( "context" "encoding/json" "fmt" - ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/vc" nutsClient "github.com/nuts-foundation/nuts-demo-ehr/nuts/client" - "github.com/nuts-foundation/nuts-node/vcr/credential" ) type VCRSearchParams struct { @@ -20,9 +18,37 @@ type VCRSearchParams struct { ResourcePath string } +var NutsAuthorizationCredentialTypeURI = ssi.MustParseURI("NutsAuthorizationCredential") + +// NutsAuthorizationCredentialSubject defines the CredentialSubject struct for the NutsAuthorizationCredential +type NutsAuthorizationCredentialSubject struct { + // ID contains the DID of the subject + ID string `json:"id"` + // PurposeOfUse refers to the Bolt access policy + PurposeOfUse string `json:"purposeOfUse"` + // Resources contains additional individual resources that can be accessed. + Resources []Resource `json:"resources,omitempty"` + // Subject contains a URN referring to the subject of care (not the credential subject) + Subject *string `json:"subject,omitempty"` +} + +// Resource defines a single accessbile resource +type Resource struct { + // Path defines the path of the resource relative to the service base URL. + // Which service acts as base URL is described by the Bolt. + Path string `json:"path"` + // Operations define which operations are allowed on the resource. + Operations []string `json:"operations"` + // UserContext defines if a user login contract is required for the resource. + UserContext bool `json:"userContext"` + // AssuranceLevel defines the assurance level required for the resource (low, substantial, high). + // Should be set if userContext = true, defaults to low + AssuranceLevel *string `json:"assuranceLevel"` +} + type VerifiableCredentialRegistry interface { // CreateAuthorizationCredential creates a NutsAuthorizationCredential on the nuts node - CreateAuthorizationCredential(ctx context.Context, issuer string, subject *credential.NutsAuthorizationCredentialSubject) error + CreateAuthorizationCredential(ctx context.Context, issuer string, subject *NutsAuthorizationCredentialSubject) error // RevokeAuthorizationCredential revokes a credential based on the resourcePath contained in the credential RevokeAuthorizationCredential(ctx context.Context, purposeOfUse, subjectID, resourcePath string) error // ResolveVerifiableCredential from the nuts node. It also returns untrusted credentials @@ -41,7 +67,7 @@ func NewVerifiableCredentialRegistry(client nutsClient.VCRClient) VerifiableCred } } -func (registry *httpVerifiableCredentialRegistry) CreateAuthorizationCredential(ctx context.Context, issuer string, subject *credential.NutsAuthorizationCredentialSubject) error { +func (registry *httpVerifiableCredentialRegistry) CreateAuthorizationCredential(ctx context.Context, issuer string, subject *NutsAuthorizationCredentialSubject) error { subjectMap := map[string]interface{}{} data, err := json.Marshal(subject) @@ -53,11 +79,11 @@ func (registry *httpVerifiableCredentialRegistry) CreateAuthorizationCredential( return fmt.Errorf("invalid subject: %w", err) } - return registry.nutsClient.CreateVC(ctx, credential.NutsAuthorizationCredentialType, issuer, subjectMap, nil, false) + return registry.nutsClient.CreateVC(ctx, NutsAuthorizationCredentialTypeURI.String(), issuer, subjectMap, nil, false) } func (registry *httpVerifiableCredentialRegistry) FindAuthorizationCredentials(ctx context.Context, params *VCRSearchParams) ([]vc.VerifiableCredential, error) { - query := nutsClient.GetNutsCredentialTemplate(*credential.NutsAuthorizationCredentialTypeURI) + query := nutsClient.GetNutsCredentialTemplate(NutsAuthorizationCredentialTypeURI) credentialSubject := make(map[string]interface{}, 0) query.CredentialSubject = credentialSubject @@ -83,7 +109,7 @@ func (registry *httpVerifiableCredentialRegistry) FindAuthorizationCredentials(c func (registry *httpVerifiableCredentialRegistry) RevokeAuthorizationCredential(ctx context.Context, purposeOfUse, subjectID, resourcePath string) error { // may be extended by issuanceDate for even faster results. - query := nutsClient.GetNutsCredentialTemplate(*credential.NutsAuthorizationCredentialTypeURI) + query := nutsClient.GetNutsCredentialTemplate(NutsAuthorizationCredentialTypeURI) query.CredentialSubject = map[string]interface{}{ "id": subjectID, "purposeOfUse": purposeOfUse, diff --git a/web/src/ehr/episode/Edit.vue b/web/src/ehr/episode/Edit.vue index b1bc7e07..1c141f7c 100644 --- a/web/src/ehr/episode/Edit.vue +++ b/web/src/ehr/episode/Edit.vue @@ -58,7 +58,7 @@ - + @@ -126,8 +126,8 @@ export default { .catch(error => this.$status.error(error)) }, searchOrganizations(query) { - this.$api.searchOrganizations({query: query, discoveryServiceType: 'zorginzage-demo', didServiceType: "zorginzage-demo"}) - .then((result) => this.organizations = result.data) + this.$api.searchOrganizations(null, {query: {"credentialSubject.organization.name": query + '*'}, excludeOwn: true}) + .then((result) => this.organizations = Object.values(result.data)) .catch(error => this.$status.error(error)) }, }, diff --git a/web/src/ehr/patient/FHIRObservations.vue b/web/src/ehr/patient/FHIRObservations.vue new file mode 100644 index 00000000..3464318f --- /dev/null +++ b/web/src/ehr/patient/FHIRObservations.vue @@ -0,0 +1,29 @@ + + diff --git a/web/src/ehr/patient/Patients.vue b/web/src/ehr/patient/Patients.vue index fa2e2bf2..fad30463 100644 --- a/web/src/ehr/patient/Patients.vue +++ b/web/src/ehr/patient/Patients.vue @@ -17,16 +17,26 @@

Patients

- +
+ + +
diff --git a/web/src/ehr/patient/ViewRemotePatient.vue b/web/src/ehr/patient/ViewRemotePatient.vue new file mode 100644 index 00000000..65b97e09 --- /dev/null +++ b/web/src/ehr/patient/ViewRemotePatient.vue @@ -0,0 +1,88 @@ + + diff --git a/web/src/ehr/transfer/EditTransfer.vue b/web/src/ehr/transfer/EditTransfer.vue index 5e9bbab1..db89941f 100644 --- a/web/src/ehr/transfer/EditTransfer.vue +++ b/web/src/ehr/transfer/EditTransfer.vue @@ -50,11 +50,15 @@ @@ -154,12 +158,15 @@ export default { this.requestedOrganization = null }, searchOrganizations(query) { - this.$api.searchOrganizations({query: query, discoveryServiceType: "eoverdracht_dev3", didServiceType: "eOverdracht-receiver"}) - .then((result) => { - // Only show organizations that we aren't already negotiating with - this.organizations = result.data.filter(i => this.negotiations.filter(n => i.did === n.organizationDID).length === 0) - }) - .catch(error => this.$status.error(error)) + this.$api.searchOrganizations(null, { + query: {'credentialSubject.organization.name': query + '*'}, + discoveryServiceType: "eoverdracht_dev3", + didServiceType: "eOverdracht-receiver", + excludeOwn: true + }).then((result) => { + // Only show organizations that we aren't already negotiating with + this.organizations = result.data.filter(i => this.negotiations.filter(n => i.did === n.organizationDID).length === 0) + }).catch(error => this.$status.error(error)) }, assignOrganization() { this.state = 'assigning'; diff --git a/web/src/index.js b/web/src/index.js index 91380eb5..71d656c5 100644 --- a/web/src/index.js +++ b/web/src/index.js @@ -21,6 +21,7 @@ import NewEpisode from './ehr/episode/New.vue' import EditEpisode from './ehr/episode/Edit.vue' import NewPatient from './ehr/patient/NewPatient.vue' import EditPatient from "./ehr/patient/EditPatient.vue" +import ViewRemotePatient from "./ehr/patient/ViewRemotePatient.vue" import NewDossier from "./ehr/patient/dossier/New.vue" import NewTransfer from "./ehr/transfer/NewTransfer.vue" import EditTransfer from "./ehr/transfer/EditTransfer.vue" @@ -88,6 +89,11 @@ const routes = [ name: 'ehr.patients.new', component: NewPatient }, + { + path: 'patients/remote', + name: 'ehr.patients.remote', + component: ViewRemotePatient + }, { path: 'elevate', name: 'ehr.elevate', diff --git a/web/src/plugins/openapi-runtime.json b/web/src/plugins/openapi-runtime.json index 65e5165c..7507e159 100644 --- a/web/src/plugins/openapi-runtime.json +++ b/web/src/plugins/openapi-runtime.json @@ -380,26 +380,41 @@ "responses": {} } }, - "/private/network/organizations": { - "get": { + "/private/network/discovery": { + "post": { "operationId": "searchOrganizations", - "parameters": [ - { - "name": "query", - "in": "query", - "required": true - }, - { - "name": "didServiceType", - "in": "query", - "required": false - }, - { - "name": "discoveryServiceType", - "in": "query", - "required": true + "requestBody": { + "required": true, + "content": { + "application/json": {} } - ], + }, + "responses": {} + } + }, + "/private/network/patient": { + "parameters": [ + { + "name": "patientSSN", + "in": "query", + "description": "The patient's SSN", + "required": true + }, + { + "name": "remotePartyDID", + "in": "query", + "description": "The DID of the remote party.", + "required": true + }, + { + "name": "scope", + "in": "query", + "description": "The OAuth2 scope to request.", + "required": true + } + ], + "get": { + "operationId": "getRemotePatient", "responses": {} } }, @@ -484,6 +499,32 @@ "responses": {} } }, + "/internal/acl/{tenantDID}/{authorizedDID}": { + "parameters": [ + { + "name": "tenantDID", + "in": "path", + "description": "The DID of the tenant who owns the resources", + "required": true, + "content": { + "plain/text": {} + } + }, + { + "name": "authorizedDID", + "in": "path", + "description": "The DID of the authorized party", + "required": true, + "content": { + "plain/text": {} + } + } + ], + "get": { + "operationId": "getACL", + "responses": {} + } + }, "/internal/customer/{customerID}/task/{taskID}": { "parameters": [ { @@ -508,7 +549,7 @@ "components": {}, "servers": [ { - "url": "/web" + "url": "./web" } ] }
OrganizationOrganizations this episode is shared with
- - - - + :class="{'btn-loading': state === 'assigning'}">Assign {{ + '.'.repeat(waitCount) + ' '.repeat(3 - waitCount) + }} + + + + +