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

feat: add req in account linking so DFSP can store consent details #112

Merged
merged 10 commits into from
Aug 23, 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
1,220 changes: 1,220 additions & 0 deletions audit-resolve.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ services:
- "27017:27017"

pisp-simulator:
image: mojaloop/mojaloop-simulator:v11.3.0.8-pisp

image: mojaloop/mojaloop-simulator:v11.3.0.9-pisp
networks:
- mojaloop-net
container_name: pisp-simulator
Expand Down
69 changes: 69 additions & 0 deletions docker/dfsp_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,5 +367,74 @@
}
}
}
},
{
"ruleId": 12,
"description": "DFSP responds to /store/consent request successfully",
"conditions": {
"all": [
{
"fact": "body",
"operator": "equal",
"value": "dfspa.username.1234",
"path": "scopes[0].accountId"
},
{
"fact": "path",
"operator": "equal",
"value": "/store/consent"
},
{
"fact": "method",
"operator": "equal",
"value": "POST"
}
]
},
"event": {
"type": "FIXED_CALLBACK",
"params": {
"statusCode": 200,
"body": {}
}
}
},
{
"ruleId": 13,
"description": "DFSP responds to /store/consent request with a HTTP error failure",
"conditions": {
"all": [
{
"fact": "body",
"operator": "equal",
"value": "dfspa.username.12345",
"path": "scopes[0].accountId"
},
{
"fact": "path",
"operator": "equal",
"value": "/store/consent"
},
{
"fact": "method",
"operator": "equal",
"value": "POST"
}
]
},
"event": {
"type": "FIXED_CALLBACK",
"params": {
"statusCode": 500,
"errorData": {
"res": {
"body": {
"statusCode": "500",
"message": "Internal Server Error"
}
}
}
}
}
}
]
59 changes: 45 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/handlers/inbound/consents/{ID}.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { PISPLinkingPhase } from '~/models/outbound/pispLinking.interface'
import { thirdparty as tpAPI } from '@mojaloop/api-snippets'
import { DFSPLinkingPhase } from '~/models/inbound/dfspLinking.interface'
import { DFSPLinkingModel } from '~/models/inbound/dfspLinking.model'
import { Enum } from '@mojaloop/central-services-shared';
import { Enum } from '@mojaloop/central-services-shared'

/**
* Handles an inbound `PATCH /consents/{ID}` request
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/inbound/participants/{ID}.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { Message } from '~/shared/pub-sub'
import { thirdparty as tpAPI } from '@mojaloop/api-snippets'
import { DFSPLinkingPhase } from '~/models/inbound/dfspLinking.interface'
import { DFSPLinkingModel } from '~/models/inbound/dfspLinking.model'
import { Enum } from '@mojaloop/central-services-shared';
import { Enum } from '@mojaloop/central-services-shared'

/**
* Handles an inbound `PUT /participants/{ID}` request
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/inbound/participants/{ID}/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { thirdparty as tpAPI } from '@mojaloop/api-snippets'
import { DFSPLinkingPhase } from '~/models/inbound/dfspLinking.interface'
import { DFSPLinkingModel } from '~/models/inbound/dfspLinking.model'
import { Enum } from '@mojaloop/central-services-shared';
import { Enum } from '@mojaloop/central-services-shared'

/**
* Handles an inbound `PUT /participants/{ID}/error` request
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/inbound/participants/{Type}/{ID}.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import { Request, ResponseObject } from '@hapi/hapi'
import { StateResponseToolkit } from '~/server/plugins/state'
import { Enum } from '@mojaloop/central-services-shared';
import { Enum } from '@mojaloop/central-services-shared'

/**
* Handles an inbound `PUT /participants/{Type}/{ID}` request
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/outbound/linking/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
} from '~/models/outbound/pispPrelinking.interface'
import config from '~/shared/config'
import inspect from '~/shared/inspect'
import { Enum } from '@mojaloop/central-services-shared';
import { Enum } from '@mojaloop/central-services-shared'

/**
* Handles outbound GET /linking/providers request
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/outbound/linking/request-consent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
} from '~/models/outbound/pispLinking.interface'
import * as OutboundAPI from '~/interface/outbound/api_interfaces'
import config from '~/shared/config'
import { Enum } from '@mojaloop/central-services-shared';
import { Enum } from '@mojaloop/central-services-shared'

/**
* Handles outbound POST /linking/request-consent request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import config from '~/shared/config'
import inspect from '~/shared/inspect'
import * as OutboundAPI from '~/interface/outbound/api_interfaces'
import { Enum } from '@mojaloop/central-services-shared';
import { Enum } from '@mojaloop/central-services-shared'


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
import config from '~/shared/config'
import inspect from '~/shared/inspect'
import * as OutboundAPI from '~/interface/outbound/api_interfaces'
import { Enum } from '@mojaloop/central-services-shared';
import { Enum } from '@mojaloop/central-services-shared'


/**
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/outbound/linking/{fspId}/{userId}.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import { StateResponseToolkit } from '~/server/plugins/state'
import { Request, ResponseObject } from '@hapi/hapi'
import { Enum } from '@mojaloop/central-services-shared';
import { Enum } from '@mojaloop/central-services-shared'
import {
PISPDiscoveryData,
PISPDiscoveryModelConfig,
Expand Down
9 changes: 9 additions & 0 deletions src/models/inbound/dfspLinking.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export interface BackendGetScopesResponse {
scopes: tpAPI.Schemas.Scope[]
}

export interface BackendStoreValidatedConsentRequest {
lewisdaly marked this conversation as resolved.
Show resolved Hide resolved
scopes: tpAPI.Schemas.Scope[]
consentId: string
registrationChallenge: string
credential: tpAPI.Schemas.VerifiedCredential
}

export interface DFSPLinkingStateMachine extends ControlledStateMachine {
validateRequest: Method
onValidateRequest: Method
Expand All @@ -94,6 +101,8 @@ export interface DFSPLinkingStateMachine extends ControlledStateMachine {
onGrantConsent: Method
validateWithAuthService: Method
onValidateWithAuthService: Method
storeValidatedConsentWithDFSP: Method
onStoreValidatedConsentWithDFSP: Method
finalizeThirdpartyLinkWithALS: Method
onFinalizeThirdpartyLinkWithALS: Method
notifyVerificationToPISP: Method
Expand Down
Loading