From 57fa0839c79da66e3f3a2ac766faf1ee88596731 Mon Sep 17 00:00:00 2001 From: LavishSainik <85817762+LavishSainik@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:23:40 +0530 Subject: [PATCH 1/2] MOSIP-41693 - Create credential_request_generator.yaml Added credential_request_generator.yaml Signed-off-by: LavishSainik <85817762+LavishSainik@users.noreply.github.com> --- api-docs/credential_request_generator.yaml | 484 +++++++++++++++++++++ 1 file changed, 484 insertions(+) create mode 100644 api-docs/credential_request_generator.yaml diff --git a/api-docs/credential_request_generator.yaml b/api-docs/credential_request_generator.yaml new file mode 100644 index 000000000..33ee83481 --- /dev/null +++ b/api-docs/credential_request_generator.yaml @@ -0,0 +1,484 @@ +openapi: 3.0.1 +info: + title: Credential Request Generator + description: Credential Request Generator + license: + name: Mosip + url: https://docs.mosip.io/platform/license + version: '1.0' +servers: + - url: https://api-internal.collab.mosip.net/v1/credentialrequest/ + description: For Swagger +tags: + - name: Credential Request Generator + description: Credential Request Generator +paths: + /v2/requestgenerator/{rid}: + post: + tags: + - Credential Request Generator + summary: Create the credential issuance request + description: Create the credential issuance request + operationId: credentialIssueByRid + parameters: + - name: rid + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestWrapperCredentialIssueRequestDto' + required: true + responses: + '200': + description: Created request id successfully + content: + application/json: + schema: + type: object + '201': + description: Created + '400': + description: Unable to get request id + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + /scheduleWebsubSubscription: + get: + tags: + - Credential Request Generator + operationId: handleSubscribeEvent + responses: + '200': + description: Request authenticated successfully + content: + '*/*': + schema: + type: string + /scheduleRetrySubscription: + get: + tags: + - Credential Request Generator + operationId: handleReSubscribeEvent + responses: + '200': + description: Request authenticated successfully + content: + '*/*': + schema: + type: string + /retrigger/{requestId}: + put: + tags: + - Credential Request Generator + summary: retrigger the credential issuance request + description: retrigger the credential issuance request + operationId: reprocessCredentialRequest + parameters: + - name: requestId + in: path + required: true + schema: + type: string + responses: + '200': + description: retrigger the the request successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CredentialIssueResponseDto' + '201': + description: Created + '400': + description: Unable to retrigger the request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + '500': + description: Internal Server Error + /requestgenerator: + post: + tags: + - Credential Request Generator + summary: Create the credential issuance request + description: Create the credential issuance request + operationId: credentialIssue + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestWrapperCredentialIssueRequest' + required: true + responses: + '200': + description: Created request id successfully + content: + application/json: + schema: + type: object + '201': + description: Created + '400': + description: Unable to get request id + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + /getRequestIds: + get: + tags: + - Credential Request Generator + summary: get credential issuance request ids + description: get credential issuance request ids + operationId: getRequestIds + parameters: + - name: statusCode + in: query + required: false + schema: + type: string + default: FAILED + - name: effectivedtimes + in: query + required: false + schema: + type: string + - name: pageNumber + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: pageSize + in: query + required: false + schema: + type: integer + format: int32 + default: 1 + - name: orderBy + in: query + required: false + schema: + type: string + default: upd_dtimes + - name: direction + in: query + required: false + schema: + type: string + default: DESC + responses: + '200': + description: get credential issuance request ids successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CredentialRequestIdsDto' + '201': + description: Created + '400': + description: Unable to get credential issuance request ids + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + '500': + description: Internal Server Error + /get/{requestId}: + get: + tags: + - Credential Request Generator + summary: get credential issuance request status + description: get credential issuance request status + operationId: getCredentialRequestStatus + parameters: + - name: requestId + in: path + required: true + schema: + type: string + responses: + '200': + description: get the credential issuance status of request successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CredentialIssueResponseDto' + '400': + description: Unable to get the status of credential issuance request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + '500': + description: Internal Server Error + /cancel/{requestId}: + get: + tags: + - Credential Request Generator + summary: cancel the credential issuance request + description: cancel the credential issuance request + operationId: cancelCredentialRequest + parameters: + - name: requestId + in: path + required: true + schema: + type: string + responses: + '200': + description: cancel the request successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CredentialIssueResponseDto' + '400': + description: Unable to cancel the request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + '500': + description: Internal Server Error + /callback/notifyStatus: + post: + tags: + - Credential Request Generator + summary: callback + description: callback + operationId: handleSubscribeEvent_1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialStatusEvent' + required: true + responses: + '200': + description: Request authenticated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseWrapperObject' + '201': + description: Created + '400': + description: Unable to request callback + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + '500': + description: Internal Server Error +components: + schemas: + CredentialIssueRequestDto: + type: object + properties: + id: + type: string + credentialType: + type: string + issuer: + type: string + recepiant: + type: string + user: + type: string + encrypt: + type: boolean + encryptionKey: + type: string + sharableAttributes: + type: array + items: + type: string + additionalData: + type: object + additionalProperties: + type: object + requestId: + type: string + RequestWrapperCredentialIssueRequestDto: + required: + - request + type: object + properties: + id: + type: string + version: + type: string + requesttime: + type: string + format: date-time + metadata: + type: object + request: + $ref: '#/components/schemas/CredentialIssueRequestDto' + CredentialIssueResponse: + type: object + properties: + requestId: + type: string + id: + type: string + CredentialIssueResponseDto: + type: object + properties: + id: + type: string + version: + type: string + responsetime: + type: string + response: + $ref: '#/components/schemas/CredentialIssueResponse' + errors: + type: array + items: + $ref: '#/components/schemas/ErrorDTO' + ErrorDTO: + type: object + properties: + errorCode: + type: string + message: + type: string + CredentialIssueRequest: + type: object + properties: + id: + type: string + credentialType: + type: string + issuer: + type: string + recepiant: + type: string + user: + type: string + encrypt: + type: boolean + encryptionKey: + type: string + sharableAttributes: + type: array + items: + type: string + additionalData: + type: object + additionalProperties: + type: object + RequestWrapperCredentialIssueRequest: + required: + - request + type: object + properties: + id: + type: string + version: + type: string + requesttime: + type: string + format: date-time + metadata: + type: object + request: + $ref: '#/components/schemas/CredentialIssueRequest' + CredentialRequestIdsDto: + type: object + properties: + requestId: + type: string + credentialType: + type: string + partner: + type: string + statusCode: + type: string + statusComment: + type: string + createDateTime: + type: string + updateDateTime: + type: string + CredentialStatusEvent: + type: object + properties: + publisher: + type: string + topic: + type: string + publishedOn: + type: string + event: + $ref: '#/components/schemas/Event' + Event: + type: object + properties: + id: + type: string + requestId: + type: string + timestamp: + type: string + status: + type: string + url: + type: string + ResponseWrapperObject: + required: + - response + type: object + properties: + id: + type: string + version: + type: string + responsetime: + type: string + format: date-time + metadata: + type: object + response: + type: object + errors: + type: array + items: + $ref: '#/components/schemas/ServiceError' + ServiceError: + type: object + properties: + errorCode: + type: string + message: + type: string From d3737e1ea0d8d376a07951138899de2d16f1f9ae Mon Sep 17 00:00:00 2001 From: LavishSainik <85817762+LavishSainik@users.noreply.github.com> Date: Thu, 5 Jun 2025 12:08:22 +0530 Subject: [PATCH 2/2] Update credential_request_generator.yaml Added the descriptions of the parameters and schemas' fields Signed-off-by: LavishSainik <85817762+LavishSainik@users.noreply.github.com> --- api-docs/credential_request_generator.yaml | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/api-docs/credential_request_generator.yaml b/api-docs/credential_request_generator.yaml index 33ee83481..88672edf9 100644 --- a/api-docs/credential_request_generator.yaml +++ b/api-docs/credential_request_generator.yaml @@ -24,6 +24,7 @@ paths: - name: rid in: path required: true + description: Registration ID used to generate credentials schema: type: string requestBody: @@ -84,6 +85,7 @@ paths: - name: requestId in: path required: true + description: Registration ID used to generate credentials schema: type: string responses: @@ -148,17 +150,20 @@ paths: - name: statusCode in: query required: false + description: An HTTP status code schema: type: string default: FAILED - name: effectivedtimes in: query required: false + description: Effective date-time (ISO 8601) from which the credential is valid. schema: type: string - name: pageNumber in: query required: false + description: Page number for paginated results, starting from 0. schema: type: integer format: int32 @@ -166,6 +171,7 @@ paths: - name: pageSize in: query required: false + description: Number of records to return per page. schema: type: integer format: int32 @@ -173,12 +179,14 @@ paths: - name: orderBy in: query required: false + description: Field name to sort the results by (default is 'upd_dtimes'). schema: type: string default: upd_dtimes - name: direction in: query required: false + description: Sort direction for results; use 'ASC' or 'DESC' (default is 'DESC'). schema: type: string default: DESC @@ -214,6 +222,7 @@ paths: - name: requestId in: path required: true + description: Unique identifier of the credential request. schema: type: string responses: @@ -246,6 +255,7 @@ paths: - name: requestId in: path required: true + description: Unique identifier of the credential request. schema: type: string responses: @@ -306,28 +316,39 @@ components: properties: id: type: string + description: Unique identifier for the credential issue request. credentialType: type: string + description: Type of the credential to be issued. issuer: type: string + description: Entity issuing the credential. recepiant: type: string + description: Entity receiving the credential. user: type: string + description: User for whom the credential is issued. encrypt: type: boolean + description: Indicates if the credential should be encrypted. encryptionKey: type: string + description: Encryption key used to encrypt the credential. sharableAttributes: type: array items: type: string + description: List of credential attributes that can be shared. additionalData: type: object additionalProperties: type: object + description: Any extra data to include with the request. requestId: type: string + description: Unique ID for tracking the credential request. + RequestWrapperCredentialIssueRequestDto: required: - request @@ -335,69 +356,95 @@ components: properties: id: type: string + description: Unique identifier of the wrapper request. version: type: string + description: API version used for the request. requesttime: type: string format: date-time + description: Timestamp of when the request was made. metadata: type: object + description: Additional metadata related to the request. request: $ref: '#/components/schemas/CredentialIssueRequestDto' + CredentialIssueResponse: type: object properties: requestId: type: string + description: ID of the request corresponding to this response. id: type: string + description: Identifier for the issued credential. + CredentialIssueResponseDto: type: object properties: id: type: string + description: Unique ID of the response. version: type: string + description: API version of the response. responsetime: type: string + description: Timestamp when the response was generated. response: $ref: '#/components/schemas/CredentialIssueResponse' errors: type: array items: $ref: '#/components/schemas/ErrorDTO' + description: List of errors, if any occurred during processing. + ErrorDTO: type: object properties: errorCode: type: string + description: Code representing the error type. message: type: string + description: Human-readable message describing the error. + CredentialIssueRequest: type: object properties: id: type: string + description: Unique identifier for the credential issue request. credentialType: type: string + description: Type of the credential to be issued. issuer: type: string + description: Entity issuing the credential. recepiant: type: string + description: Entity receiving the credential. user: type: string + description: User for whom the credential is issued. encrypt: type: boolean + description: Indicates if the credential should be encrypted. encryptionKey: type: string + description: Encryption key used to encrypt the credential. sharableAttributes: type: array items: type: string + description: List of credential attributes that can be shared. additionalData: type: object additionalProperties: type: object + description: Any extra data to include with the request. + RequestWrapperCredentialIssueRequest: required: - request @@ -405,56 +452,79 @@ components: properties: id: type: string + description: Unique ID of the request wrapper. version: type: string + description: API version being used. requesttime: type: string format: date-time + description: Time when the request was initiated. metadata: type: object + description: Optional metadata for the request. request: $ref: '#/components/schemas/CredentialIssueRequest' + CredentialRequestIdsDto: type: object properties: requestId: type: string + description: Unique identifier of the credential request. credentialType: type: string + description: Type of credential requested. partner: type: string + description: Partner system initiating the request. statusCode: type: string + description: Status code representing the current state. statusComment: type: string + description: Additional comments or notes about the status. createDateTime: type: string + description: Timestamp when the credential request was created. updateDateTime: type: string + description: Timestamp when the credential request was last updated. + CredentialStatusEvent: type: object properties: publisher: type: string + description: System or service that published the event. topic: type: string + description: Event topic/category. publishedOn: type: string + description: Timestamp when the event was published. event: $ref: '#/components/schemas/Event' + Event: type: object properties: id: type: string + description: Unique ID of the event. requestId: type: string + description: Credential request ID associated with the event. timestamp: type: string + description: Time when the event occurred. status: type: string + description: Status value associated with the event. url: type: string + description: URL related to the event or resource. + ResponseWrapperObject: required: - response @@ -462,23 +532,32 @@ components: properties: id: type: string + description: Unique identifier of the response wrapper. version: type: string + description: Version of the response structure. responsetime: type: string format: date-time + description: Time when the response was generated. metadata: type: object + description: Additional response metadata. response: type: object + description: Actual response object or data. errors: type: array items: $ref: '#/components/schemas/ServiceError' + description: List of errors associated with the response. + ServiceError: type: object properties: errorCode: type: string + description: Code representing the specific error. message: type: string + description: Description of the error for the client.