Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update POST /consentRequests and PUT /consentRequests/{ID} #83

Merged
merged 3 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
698 changes: 280 additions & 418 deletions docs/thirdparty-openapi3-snippets.yaml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/thirdparty/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export namespace Schemas {
export type ConsentRequestsIDPatchRequest = components['schemas']['ConsentRequestsIDPatchRequest']
export type AuthorizationsIDPutResponse = components['schemas']['AuthorizationsIDPutResponse']
export type ConsentRequestsIDPutResponseOTP = components['schemas']['ConsentRequestsIDPutResponseOTP']
export type ConsentRequestsIDPutResponseOTPAuth = components['schemas']['ConsentRequestsIDPutResponseOTPAuth']
export type ConsentRequestsIDPutResponseWeb = components['schemas']['ConsentRequestsIDPutResponseWeb']
export type ConsentRequestsIDPutResponseWebAuth = components['schemas']['ConsentRequestsIDPutResponseWebAuth']
export type ConsentRequestsPostRequest = components['schemas']['ConsentRequestsPostRequest']
export type ConsentScopeType = components['schemas']['ConsentScopeType']
export type ConsentsIDGenerateChallengePostRequest = components['schemas']['ConsentsIDGenerateChallengePostRequest']
Expand Down
160 changes: 16 additions & 144 deletions src/thirdparty/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6639,11 +6639,11 @@ export interface operations {
/**
* Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘).
*/
id: string;
consentRequestId: string;
/**
* The id of the PISP who will initiate transactions on a user's behalf.
* ID used to associate request with GET /accounts request.
*/
initiatorId: string;
userId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
Expand Down Expand Up @@ -6982,33 +6982,9 @@ export interface operations {
"application/json":
| {
/**
* The id of the PISP who will initiate transactions on a user's behalf.
*/
initiatorId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
* be Bank Account Number or anything that may expose a User's private bank
* account information.
*/
accountId: string;
actions: ("accounts.getBalance" | "accounts.transfer")[];
}[];
authChannels: "WEB"[];
/**
* The callback uri that the user will be redirected to after completing the WEB auth channel.
*/
callbackUri: string;
/**
* The callback uri that the pisp app redirects to for user to complete their login.
*/
authUri: string;
}
| {
/**
* The id of the PISP who will initiate transactions on a user's behalf.
* Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘).
*/
initiatorId: string;
consentRequestId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
Expand All @@ -7027,36 +7003,12 @@ export interface operations {
* The callback uri that the pisp app redirects to for user to complete their login.
*/
authUri: string;
/**
* The Auth token from the OTP or redirect to pisp app.
*/
authToken: string;
}
| {
/**
* The id of the PISP who will initiate transactions on a user's behalf.
*/
initiatorId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
* be Bank Account Number or anything that may expose a User's private bank
* account information.
*/
accountId: string;
actions: ("accounts.getBalance" | "accounts.transfer")[];
}[];
authChannels: "OTP"[];
/**
* The callback uri that the user will be redirected to after completing the WEB auth channel.
*/
callbackUri: string;
}
| {
/**
* The id of the PISP who will initiate transactions on a user's behalf.
* Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘).
*/
initiatorId: string;
consentRequestId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
Expand All @@ -7071,10 +7023,6 @@ export interface operations {
* The callback uri that the user will be redirected to after completing the WEB auth channel.
*/
callbackUri: string;
/**
* The Auth token from the OTP or redirect to pisp app.
*/
authToken: string;
};
};
responses: {
Expand Down Expand Up @@ -7393,12 +7341,7 @@ export interface operations {
*/
PatchConsentRequest: {
requestBody: {
"application/json": {
/**
* The API data type OtpValue is a JSON String of 3 to 10 characters, consisting of digits only. Negative numbers are not allowed. One or more leading zeros are allowed.
*/
authToken: string;
};
"application/json": { authToken: string };
};
responses: {
/**
Expand Down Expand Up @@ -23819,11 +23762,11 @@ export interface components {
/**
* Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘).
*/
id: string;
consentRequestId: string;
/**
* The id of the PISP who will initiate transactions on a user's behalf.
* ID used to associate request with GET /accounts request.
*/
initiatorId: string;
userId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
Expand Down Expand Up @@ -23853,40 +23796,9 @@ export interface components {
*/
ConsentRequestsIDPutResponseWeb: {
/**
* The id of the PISP who will initiate transactions on a user's behalf.
*/
initiatorId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
* be Bank Account Number or anything that may expose a User's private bank
* account information.
*/
accountId: string;
actions: ("accounts.getBalance" | "accounts.transfer")[];
}[];
authChannels: "WEB"[];
/**
* The callback uri that the user will be redirected to after completing the WEB auth channel.
*/
callbackUri: string;
/**
* The callback uri that the pisp app redirects to for user to complete their login.
*/
authUri: string;
};
/**
* The object sent in a `PUT /consentRequests/{ID}` request.
*
* Schema used in the authentication phase of the account linking flow,
* the user is expected to prove their identity to the DFSP by passing a OTP
* or secret to the PISP.
*/
ConsentRequestsIDPutResponseWebAuth: {
/**
* The id of the PISP who will initiate transactions on a user's behalf.
* Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘).
*/
initiatorId: string;
consentRequestId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
Expand All @@ -23905,10 +23817,6 @@ export interface components {
* The callback uri that the pisp app redirects to for user to complete their login.
*/
authUri: string;
/**
* The Auth token from the OTP or redirect to pisp app.
*/
authToken: string;
};
/**
* The OTP auth channel being used for PUT consentRequest/{ID} request.
Expand All @@ -23921,36 +23829,9 @@ export interface components {
*/
ConsentRequestsIDPutResponseOTP: {
/**
* The id of the PISP who will initiate transactions on a user's behalf.
*/
initiatorId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
* be Bank Account Number or anything that may expose a User's private bank
* account information.
*/
accountId: string;
actions: ("accounts.getBalance" | "accounts.transfer")[];
}[];
authChannels: "OTP"[];
/**
* The callback uri that the user will be redirected to after completing the WEB auth channel.
*/
callbackUri: string;
};
/**
* The object sent in a `PUT /consentRequests/{ID}` request.
*
* Schema used in the authentication phase of the account linking flow,
* the user is expected to prove their identity to the DFSP by passing a OTP
* or secret to the PISP.
*/
ConsentRequestsIDPutResponseOTPAuth: {
/**
* The id of the PISP who will initiate transactions on a user's behalf.
* Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘).
*/
initiatorId: string;
consentRequestId: string;
scopes: {
/**
* A long-lived unique account identifier provided by the DFSP. This MUST NOT
Expand All @@ -23965,20 +23846,11 @@ export interface components {
* The callback uri that the user will be redirected to after completing the WEB auth channel.
*/
callbackUri: string;
/**
* The Auth token from the OTP or redirect to pisp app.
*/
authToken: string;
};
/**
* The object sent in a `PATCH /consentRequests/{ID}` request.
*/
ConsentRequestsIDPatchRequest: {
/**
* The API data type OtpValue is a JSON String of 3 to 10 characters, consisting of digits only. Negative numbers are not allowed. One or more leading zeros are allowed.
*/
authToken: string;
};
ConsentRequestsIDPatchRequest: { authToken: string };
/**
* The object sent in a `POST /consents` request.
*/
Expand Down
31 changes: 4 additions & 27 deletions tests/dto/thirdparty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,28 +200,17 @@ describe('thirdparty', () => {

test('ConsentRequestsIDPutResponseOTP', () => {
const consentRequestsIDPutResponseOTP: Schemas.ConsentRequestsIDPutResponseOTP = {
initiatorId: 'pisp-id',
consentRequestId: 'pisp-id',
scopes: [scope],
authChannels: [consentRequestChannelTypeOTP],
callbackUri: 'https://fspiId/callback'
}
expect(consentRequestsIDPutResponseOTP).toBeDefined()
})

test('ConsentRequestsIDPutResponseOTPAuth', () => {
const consentRequestsIDPutResponseOTPAuth: Schemas.ConsentRequestsIDPutResponseOTPAuth = {
initiatorId: 'pisp-id',
scopes: [scope],
authChannels: [consentRequestChannelTypeOTP],
callbackUri: 'https://fspiId/callback',
authToken: 'abcdefghijklmnopqrstuvxyz'
}
expect(consentRequestsIDPutResponseOTPAuth).toBeDefined()
})

test('ConsentRequestsIDPutResponseWeb', () => {
const consentRequestsIDPutResponseWeb: Schemas.ConsentRequestsIDPutResponseWeb = {
initiatorId: 'pisp-id',
consentRequestId: 'pisp-id',
scopes: [scope],
authChannels: [consentRequestChannelTypeWeb],
callbackUri: 'https://fspiId/callback',
Expand All @@ -230,22 +219,10 @@ describe('thirdparty', () => {
expect(consentRequestsIDPutResponseWeb).toBeDefined()
})

test('ConsentRequestsIDPutResponseWebAuth', () => {
const consentRequestsIDPutResponseWebAuth: Schemas.ConsentRequestsIDPutResponseWebAuth = {
initiatorId: 'pisp-id',
scopes: [scope],
authChannels: [consentRequestChannelTypeWeb],
callbackUri: 'https://fspiId/callback',
authUri: 'https://fspId/auth',
authToken: 'abcdefghijklmnopqrstuvxyz'
}
expect(consentRequestsIDPutResponseWebAuth).toBeDefined()
})

test('ConsentRequestsPostRequest', () => {
const consentRequestsPostRequest: Schemas.ConsentRequestsPostRequest = {
id: correlationId,
initiatorId: 'pisp-id',
consentRequestId: 'pisp-id',
userId: 'pisp-id-user',
scopes: [scope],
authChannels: [consentRequestChannelType],
callbackUri: 'https://fspiId/callback'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ type: object
description: The object sent in a `PATCH /consentRequests/{ID}` request.
properties:
authToken:
$ref: '../../../../fspiop/v1_1/openapi3/components/schemas/OtpValue.yaml'
type: string
required:
- authToken
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ description: |

Schema used in the request consent phase of the account linking OTP/SMS flow.
properties:
initiatorId:
type: string
description: The id of the PISP who will initiate transactions on a user's behalf.
consentRequestId:
$ref: ./CorrelationId.yaml
scopes:
type: array
items:
Expand All @@ -22,7 +21,7 @@ properties:
The callback uri that the user will be redirected to after completing the
WEB auth channel.
required:
- initiatorId
- consentRequestId
- scopes
- authChannels
- callbackUri
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ description: |
supposed user should be redirected. This URL should be a place where
the user can prove their identity (e.g., by logging in).
properties:
initiatorId:
type: string
description: The id of the PISP who will initiate transactions on a user's behalf.
consentRequestId:
$ref: ./CorrelationId.yaml
scopes:
type: array
items:
Expand All @@ -30,7 +29,7 @@ properties:
The callback uri that the pisp app redirects to for user to complete their
login.
required:
- initiatorId
- consentRequestId
- scopes
- authChannels
- callbackUri
Expand Down
Loading