Skip to content

Commit 29e64f0

Browse files
authored
fix: fix enumeration for authentication response (#118)
* fix: fix enumeration for authentication response * chore: build * chore: rebuild
1 parent 7bb54fb commit 29e64f0

13 files changed

+87
-51
lines changed

docs/thirdparty-openapi3-snippets.yaml

+39-24
Original file line numberDiff line numberDiff line change
@@ -3027,7 +3027,7 @@ paths:
30273027
- "FIDO" - A FIDO public/private keypair
30283028
- "GENERIC" - A Generic public/private keypair
30293029
status:
3030-
title: CredentialStatus
3030+
title: CredentialStatusPending
30313031
type: string
30323032
enum: &ref_115
30333033
- PENDING
@@ -3454,7 +3454,7 @@ paths:
34543454
type: object
34553455
properties:
34563456
status:
3457-
title: CredentialStatus
3457+
title: CredentialStatusVerified
34583458
type: string
34593459
enum: &ref_128
34603460
- VERIFIED
@@ -6639,14 +6639,14 @@ paths:
66396639
application/json:
66406640
schema:
66416641
oneOf:
6642-
- title: ThirdpartyRequestsAuthorizationsIDPutResponseGeneric
6642+
- title: ThirdpartyRequestsAuthorizationsIDPutResponseRejected
66436643
type: object
66446644
description: >-
66456645
The object sent in the PUT
66466646
/thirdpartyRequests/authorizations/{ID} callback.
66476647
properties: &ref_147
66486648
responseType:
6649-
title: AuthorizationResponseType
6649+
title: AuthorizationResponseTypeRejected
66506650
description: |
66516651
The customer rejected the terms of the transfer.
66526652
type: string
@@ -7426,7 +7426,7 @@ paths:
74267426
information regarding a previously created or requested authorization.
74277427
The *{ID}*
74287428
7429-
in the URI should contain the verification request ID
7429+
in the URI should contain the verification request ID
74307430
parameters:
74317431
- name: Accept
74327432
in: header
@@ -7476,18 +7476,17 @@ paths:
74767476
- sampled
74777477
operationId: PutThirdpartyRequestsVerificationsById
74787478
summary: PutThirdpartyRequestsVerificationsById
7479-
description: >
7479+
description: >-
74807480
The HTTP request `PUT /thirdpartyRequests/verifications/{ID}` is used by
7481-
the Auth-Service to inform
7482-
7483-
the DFSP of a successful result in validating the verification of a
7484-
Thirdparty Transaction Request.
7481+
the Auth-Service to inform the DFSP of a successful result in validating
7482+
the verification of a Thirdparty Transaction Request.
74857483
7484+
If the validation fails, the auth-service will send back `PUT
7485+
/thirdpartyRequests/verifications/{ID}` with `authenticationResponse:
7486+
'REJECTED'`.
74867487
7487-
If the validation fails, The Auth-Service MUST use `PUT
7488-
/thirdpartyRequests/verifications/{ID}/error`
7489-
7490-
instead.
7488+
In unplanned error cases the Auth-Service MUST use `PUT
7489+
/thirdpartyRequests/verifications/{ID}/error`.
74917490
parameters:
74927491
- name: Content-Length
74937492
in: header
@@ -7511,13 +7510,21 @@ paths:
75117510
description: >-
75127511
The object sent in the PUT
75137512
/thirdpartyRequests/verifications/{ID} request.
7514-
properties: &ref_157
7513+
properties: &ref_158
75157514
authenticationResponse:
7515+
title: AuthenticationResponse
75167516
type: string
7517-
enum:
7517+
enum: &ref_157
75187518
- VERIFIED
7519-
description: The verification passed
7520-
required: &ref_158
7519+
- REJECTED
7520+
description: >-
7521+
Below are the allowed values for the enumeration
7522+
AuthenticationResponse.
7523+
7524+
- VERIFIED - The challenge was correctly signed.
7525+
7526+
- REJECTED - The challenge was not correctly signed.
7527+
required: &ref_159
75217528
- authenticationResponse
75227529
example:
75237530
authenticationResponse: VERIFIED
@@ -8490,7 +8497,7 @@ components:
84908497
- "FIDO" - A FIDO public/private keypair
84918498
- "GENERIC" - A Generic public/private keypair
84928499
CredentialStatusPending:
8493-
title: CredentialStatus
8500+
title: CredentialStatusPending
84948501
type: string
84958502
enum: *ref_115
84968503
description: |
@@ -8618,7 +8625,7 @@ components:
86188625
required: *ref_127
86198626
additionalProperties: false
86208627
CredentialStatusVerified:
8621-
title: CredentialStatus
8628+
title: CredentialStatusVerified
86228629
type: string
86238630
enum: *ref_128
86248631
description: |
@@ -8708,13 +8715,13 @@ components:
87088715
required: *ref_145
87098716
additionalProperties: false
87108717
AuthorizationResponseTypeRejected:
8711-
title: AuthorizationResponseType
8718+
title: AuthorizationResponseTypeRejected
87128719
description: |
87138720
The customer rejected the terms of the transfer.
87148721
type: string
87158722
enum: *ref_146
87168723
ThirdpartyRequestsAuthorizationsIDPutResponseRejected:
8717-
title: ThirdpartyRequestsAuthorizationsIDPutResponseGeneric
8724+
title: ThirdpartyRequestsAuthorizationsIDPutResponseRejected
87188725
type: object
87198726
description: >-
87208727
The object sent in the PUT /thirdpartyRequests/authorizations/{ID}
@@ -8780,14 +8787,22 @@ components:
87808787
description: The object sent in the POST /thirdpartyRequests/verifications request.
87818788
properties: *ref_155
87828789
required: *ref_156
8790+
AuthenticationResponse:
8791+
title: AuthenticationResponse
8792+
type: string
8793+
enum: *ref_157
8794+
description: |-
8795+
Below are the allowed values for the enumeration AuthenticationResponse.
8796+
- VERIFIED - The challenge was correctly signed.
8797+
- REJECTED - The challenge was not correctly signed.
87838798
ThirdpartyRequestsVerificationsIDPutResponse:
87848799
title: ThirdpartyRequestsVerificationsIDPutResponse
87858800
type: object
87868801
description: >-
87878802
The object sent in the PUT /thirdpartyRequests/verifications/{ID}
87888803
request.
8789-
properties: *ref_157
8790-
required: *ref_158
8804+
properties: *ref_158
8805+
required: *ref_159
87918806
parameters:
87928807
ID:
87938808
name: ID

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"description": "Mojaloop API specification reusable snippets",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
7+
"engines": {
8+
"node": ">=12.0.0"
9+
},
710
"scripts": {
811
"audit:resolve": "SHELL=sh resolve-audit --production",
912
"audit:check": "SHELL=sh check-audit --production",

src/thirdparty/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export namespace Schemas {
99
export type AccountsIDPutResponse = components['schemas']['AccountsIDPutResponse']
1010
export type Amount = components['schemas']['Amount']
1111
export type AmountType = components['schemas']['AmountType']
12+
export type AuthenticationResponse = components['schemas']['AuthenticationResponse']
1213
export type AuthenticationType = components['schemas']['AuthenticationType']
1314
export type AuthorizationChannelType = components['schemas']['AuthorizationChannelType']
1415
export type AuthorizationResponseType = components['schemas']['AuthorizationResponseType']

src/thirdparty/openapi.ts

+17-9
Original file line numberDiff line numberDiff line change
@@ -19144,11 +19144,9 @@ export interface operations {
1914419144
};
1914519145
};
1914619146
/**
19147-
* The HTTP request `PUT /thirdpartyRequests/verifications/{ID}` is used by the Auth-Service to inform
19148-
* the DFSP of a successful result in validating the verification of a Thirdparty Transaction Request.
19149-
*
19150-
* If the validation fails, The Auth-Service MUST use `PUT /thirdpartyRequests/verifications/{ID}/error`
19151-
* instead.
19147+
* The HTTP request `PUT /thirdpartyRequests/verifications/{ID}` is used by the Auth-Service to inform the DFSP of a successful result in validating the verification of a Thirdparty Transaction Request.
19148+
* If the validation fails, the auth-service will send back `PUT /thirdpartyRequests/verifications/{ID}` with `authenticationResponse: 'REJECTED'`.
19149+
* In unplanned error cases the Auth-Service MUST use `PUT /thirdpartyRequests/verifications/{ID}/error`.
1915219150
*/
1915319151
PutThirdpartyRequestsVerificationsById: {
1915419152
parameters: {
@@ -19164,9 +19162,11 @@ export interface operations {
1916419162
requestBody: {
1916519163
"application/json": {
1916619164
/**
19167-
* The verification passed
19165+
* Below are the allowed values for the enumeration AuthenticationResponse.
19166+
* - VERIFIED - The challenge was correctly signed.
19167+
* - REJECTED - The challenge was not correctly signed.
1916819168
*/
19169-
authenticationResponse: "VERIFIED";
19169+
authenticationResponse: "VERIFIED" | "REJECTED";
1917019170
};
1917119171
};
1917219172
responses: {
@@ -26889,14 +26889,22 @@ export interface components {
2688926889
*/
2689026890
genericSignedPayload: string;
2689126891
};
26892+
/**
26893+
* Below are the allowed values for the enumeration AuthenticationResponse.
26894+
* - VERIFIED - The challenge was correctly signed.
26895+
* - REJECTED - The challenge was not correctly signed.
26896+
*/
26897+
AuthenticationResponse: "VERIFIED" | "REJECTED";
2689226898
/**
2689326899
* The object sent in the PUT /thirdpartyRequests/verifications/{ID} request.
2689426900
*/
2689526901
ThirdpartyRequestsVerificationsIDPutResponse: {
2689626902
/**
26897-
* The verification passed
26903+
* Below are the allowed values for the enumeration AuthenticationResponse.
26904+
* - VERIFIED - The challenge was correctly signed.
26905+
* - REJECTED - The challenge was not correctly signed.
2689826906
*/
26899-
authenticationResponse: "VERIFIED";
26907+
authenticationResponse: "VERIFIED" | "REJECTED";
2690026908
};
2690126909
};
2690226910
responses: {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
title: AuthenticationResponse
2+
type: string
3+
enum:
4+
- VERIFIED
5+
- REJECTED
6+
description: |-
7+
Below are the allowed values for the enumeration AuthenticationResponse.
8+
- VERIFIED - The challenge was correctly signed.
9+
- REJECTED - The challenge was not correctly signed.

thirdparty/openapi3/components/schemas/AuthorizationResponseTypeRejected.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: AuthorizationResponseType
1+
title: AuthorizationResponseTypeRejected
22
description: |
33
The customer rejected the terms of the transfer.
44
type: string

thirdparty/openapi3/components/schemas/CredentialStatusPending.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: CredentialStatus
1+
title: CredentialStatusPending
22
type: string
33
enum:
44
- PENDING

thirdparty/openapi3/components/schemas/CredentialStatusVerified.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: CredentialStatus
1+
title: CredentialStatusVerified
22
type: string
33
enum:
44
- VERIFIED

thirdparty/openapi3/components/schemas/SignedCredential.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ properties:
1212
$ref: ./CredentialType.yaml
1313
# The challenge has signed but not yet verified.
1414
status:
15-
$ref: ./CredentialStatusPending.yaml
15+
$ref: ./CredentialStatusPending.yaml
1616
genericPayload:
1717
$ref: ./GenericCredential.yaml
1818
fidoPayload:
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
title: ThirdpartyRequestsAuthorizationsIDPutResponseGeneric
1+
title: ThirdpartyRequestsAuthorizationsIDPutResponseRejected
22
type: object
33
description: 'The object sent in the PUT /thirdpartyRequests/authorizations/{ID} callback.'
44
properties:
5-
responseType:
6-
$ref: ./AuthorizationResponseTypeRejected.yaml
5+
responseType:
6+
$ref: ./AuthorizationResponseTypeRejected.yaml
77
required:
88
- responseType

thirdparty/openapi3/components/schemas/ThirdpartyRequestsVerificationsIDPutResponse.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ type: object
33
description: The object sent in the PUT /thirdpartyRequests/verifications/{ID} request.
44
properties:
55
authenticationResponse:
6-
type: string
7-
enum:
8-
- VERIFIED
9-
description: 'The verification passed'
6+
$ref: ./AuthenticationResponse.yaml
107
required:
118
- authenticationResponse
12-

thirdparty/openapi3/components/schemas/index.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ Amount:
99
AmountType:
1010
$ref: ./AmountType.yaml
1111
AuthenticationInfo:
12-
$ref: ./AuthenticationInfo.yaml
12+
$ref: ./AuthenticationInfo.yaml
13+
AuthenticationResponse:
14+
$ref: ./AuthenticationResponse.yaml
1315
AuthenticationType:
1416
$ref: ./AuthenticationType.yaml
1517
AuthenticationValue:
16-
$ref: ./AuthenticationValue.yaml
18+
$ref: ./AuthenticationValue.yaml
1719
AuthorizationChannelType:
1820
$ref: ./AuthorizationChannelType.yaml
1921
AuthorizationResponseType:

thirdparty/openapi3/paths/thirdpartyRequests_verifications_ID.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ get:
2020
description: |
2121
The HTTP request `/thirdpartyRequests/verifications/{ID}` is used to get
2222
information regarding a previously created or requested authorization. The *{ID}*
23-
in the URI should contain the verification request ID
23+
in the URI should contain the verification request ID
2424
parameters:
2525
#Headers
2626
- $ref: ../components/parameters/Accept.yaml
@@ -49,12 +49,14 @@ put:
4949
- sampled
5050
operationId: PutThirdpartyRequestsVerificationsById
5151
summary: PutThirdpartyRequestsVerificationsById
52-
description: |
52+
description: >-
5353
The HTTP request `PUT /thirdpartyRequests/verifications/{ID}` is used by the Auth-Service to inform
5454
the DFSP of a successful result in validating the verification of a Thirdparty Transaction Request.
5555
56-
If the validation fails, The Auth-Service MUST use `PUT /thirdpartyRequests/verifications/{ID}/error`
57-
instead.
56+
If the validation fails, the auth-service will send back `PUT /thirdpartyRequests/verifications/{ID}`
57+
with `authenticationResponse: 'REJECTED'`.
58+
59+
In unplanned error cases the Auth-Service MUST use `PUT /thirdpartyRequests/verifications/{ID}/error`.
5860
parameters:
5961
- $ref: ../components/parameters/Content-Length.yaml
6062
requestBody:

0 commit comments

Comments
 (0)