From 0ebc1d8ac291f6d7615c55df6807fdef4ee93e98 Mon Sep 17 00:00:00 2001 From: dwertent Date: Thu, 15 Aug 2024 11:01:33 -0400 Subject: [PATCH] wip: renaming the api function Signed-off-by: dwertent --- internal/apiserver/route_get_identity_by_id.go | 8 ++++---- internal/apiserver/routes.go | 2 +- internal/coremsgs/en_api_translations.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/apiserver/route_get_identity_by_id.go b/internal/apiserver/route_get_identity_by_id.go index 1ce7b2e45..d5c3fe9ae 100644 --- a/internal/apiserver/route_get_identity_by_id.go +++ b/internal/apiserver/route_get_identity_by_id.go @@ -27,9 +27,9 @@ import ( "github.com/hyperledger/firefly/pkg/core" ) -var getIdentityByID = &ffapi.Route{ - Name: "getIdentityByID", - Path: "identities/{id:.+}", +var getIdentityByIDOrDID = &ffapi.Route{ + Name: "getIdentityByIDOrDID", + Path: "identities/{id:.+}", // Allow any character in the ID (including slashes), othrwise the DID will be split into multiple path segments Method: http.MethodGet, PathParams: []*ffapi.PathParam{ {Name: "id", Example: "id", Description: coremsgs.APIParamsIdentityIDs}, @@ -37,7 +37,7 @@ var getIdentityByID = &ffapi.Route{ QueryParams: []*ffapi.QueryParam{ {Name: "fetchverifiers", Example: "true", Description: coremsgs.APIParamsFetchVerifiers, IsBool: true}, }, - Description: coremsgs.APIEndpointsGetIdentityByID, + Description: coremsgs.APIEndpointsGetIdentityByIDOrDID, JSONInputValue: nil, JSONOutputValue: func() interface{} { return &core.Identity{} }, JSONOutputCodes: []int{http.StatusOK}, diff --git a/internal/apiserver/routes.go b/internal/apiserver/routes.go index fc04d120a..98eda5eee 100644 --- a/internal/apiserver/routes.go +++ b/internal/apiserver/routes.go @@ -86,7 +86,7 @@ var routes = append( getGroupByHash, getGroups, getIdentities, - getIdentityByID, + getIdentityByIDOrDID, getIdentityDID, getIdentityVerifiers, getMsgByID, diff --git a/internal/coremsgs/en_api_translations.go b/internal/coremsgs/en_api_translations.go index 3684f6005..255a4012b 100644 --- a/internal/coremsgs/en_api_translations.go +++ b/internal/coremsgs/en_api_translations.go @@ -108,7 +108,7 @@ var ( APIEndpointsGetGroupByHash = ffm("api.endpoints.getGroupByHash", "Gets a group by its ID (hash)") APIEndpointsGetGroups = ffm("api.endpoints.getGroups", "Gets a list of groups") APIEndpointsGetIdentities = ffm("api.endpoints.getIdentities", "Gets a list of all identities that have been registered in the namespace") - APIEndpointsGetIdentityByID = ffm("api.endpoints.getIdentityByID", "Gets an identity by its ID (UUID/DID)") + APIEndpointsGetIdentityByIDOrDID = ffm("api.endpoints.getIdentityByIDOrDID", "Gets an identity by its ID or DID") APIEndpointsGetIdentityDID = ffm("api.endpoints.getIdentityDID", "Gets the DID for an identity based on its ID") APIEndpointsGetIdentityVerifiers = ffm("api.endpoints.getIdentityVerifiers", "Gets the verifiers for an identity") APIEndpointsGetMsgByID = ffm("api.endpoints.getMsgByID", "Gets a message by its ID")