diff --git a/.env.example b/.env.example index 9abfc7b..53ff666 100644 --- a/.env.example +++ b/.env.example @@ -7,10 +7,10 @@ VITE_OBP_API_HOST=https://apisandbox.openbankproject.com VITE_OBP_API_PORTAL_HOST=https://apisandbox.openbankproject.com #################################################################################### -VITE_OBP_API_VERSION=v5.1.0 +VITE_OBP_API_VERSION=v6.0.0 #The default version of the root page, it has the default value `OBP+VITE_OBP_API_VERSION` #The format must follow standard+Version, e.g., OBPv5.1.0, BGv1, or BGv1.3. -#VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION=OBPv5.1.0 +#VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION=OBPv6.0.0 # API Manager VITE_OBP_API_MANAGER_HOST=https://apimanagersandbox.openbankproject.com diff --git a/Dockerfiles/Dockerfile_frontend b/Dockerfiles/Dockerfile_frontend index cf05d92..b2cdecd 100644 --- a/Dockerfiles/Dockerfile_frontend +++ b/Dockerfiles/Dockerfile_frontend @@ -18,12 +18,12 @@ RUN go build -v -o /usr/src/app/prestart FROM registry.access.redhat.com/ubi9/nginx-120 ENV VITE_OBP_LOGO_URL=https://static.openbankproject.com/images/obp_logo.png \ - VITE_OBP_API_VERSION='v5.1.0' \ + VITE_OBP_API_VERSION='v6.0.0' \ VITE_OBP_LINKS_COLOR='#39455f' \ VITE_OBP_HEADER_LINKS_COLOR='#52b165' \ VITE_OBP_HEADER_LINKS_HOVER_COLOR='#39455f' \ VITE_OBP_HEADER_LINKS_BACKGROUND_COLOR='#eef0f4' \ - VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION=OBPv5.1.0 \ + VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION=OBPv6.0.0 \ VITE_CHATBOT_ENABLED=false \ VITE_SHOW_API_MANAGER_BUTTON=false diff --git a/server/services/OBPConsentsService.ts b/server/services/OBPConsentsService.ts index 8bde8b8..9fb3c72 100644 --- a/server/services/OBPConsentsService.ts +++ b/server/services/OBPConsentsService.ts @@ -79,7 +79,7 @@ export default class OBPConsentsService { // I.e. give permission to Opey to do anything on behalf of the logged in user // Get the Consents API client from the OBP SDK - const client = await this.createUserConsentsClient(session, '/obp/v5.1.0/my/consents/IMPLICIT', 'POST') + const client = await this.createUserConsentsClient(session, `/obp/${process.env.VITE_OBP_API_VERSION}/my/consents/IMPLICIT`, 'POST') if (!client) { throw new Error('Could not create Consents API client') } @@ -150,7 +150,7 @@ export default class OBPConsentsService { } try { - const response = await this._sendOBPRequest(`/obp/v5.1.0/user/current/consents/${consentId}`, 'GET', clientConfig) + const response = await this._sendOBPRequest(`/obp/${process.env.VITE_OBP_API_VERSION}/user/current/consents/${consentId}`, 'GET', clientConfig) session['opeyConfig'] = { authConfig: { @@ -182,7 +182,7 @@ export default class OBPConsentsService { // Get the Consents API client from the OBP SDK // The OBP SDK is messed up here, so we'll need to use Fetch until the SWAGGER WILL ACTUALLY WORK - // const client = await this.createUserConsentsClient(session, '/obp/v5.1.0/my/consents/IMPLICIT', 'POST') + // const client = await this.createUserConsentsClient(session, `/obp/${process.env.VITE_OBP_API_VERSION}/my/consents/IMPLICIT`, 'POST') // if (!client) { // throw new Error('Could not create Consents API client') // } @@ -197,8 +197,8 @@ export default class OBPConsentsService { // We need to change this back to consent infos once OBP shows 'EXPIRED' in the status // Right now we have to check the JWT ourselves - const consentInfosPath = '/obp/v5.1.0/my/consents' - //const consentInfosPath = '/obp/v5.1.0/my/consent-infos' + const consentInfosPath = `/obp/${process.env.VITE_OBP_API_VERSION}/my/consents` + //const consentInfosPath = `/obp/${process.env.VITE_OBP_API_VERSION}/my/consent-infos` let opeyConsentId: string | null = null try { diff --git a/server/test/OBPConsentsService.test.ts b/server/test/OBPConsentsService.test.ts index 5d5c323..c7768d9 100644 --- a/server/test/OBPConsentsService.test.ts +++ b/server/test/OBPConsentsService.test.ts @@ -39,7 +39,7 @@ describe('OBPConsentsService.createUserConsentsClient', () => { mockSession = { clientConfig: { baseUri: 'https://test.openbankproject.com', - version: 'v5.1.0', + version: 'v6.0.0', oauthConfig: { consumerKey: 'jgaawf2fnj4yixqdsfaq4gipt4v1wvgsxgre', consumerSecret: 'asdofasdpfjawpefapwehhpfawheofphawfefh', @@ -91,7 +91,7 @@ describe('OBPConsentsService.createConsent', () => { mockSession = { clientConfig: { baseUri: 'https://test.openbankproject.com', - version: 'v5.1.0', + version: 'v6.0.0', oauthConfig: { consumerKey: 'jgaawf2fnj4yixqdsfaq4gipt4v1wvgsxgre', consumerSecret: 'asdofasdpfjawpefapwehhpfawheofphawfefh', @@ -178,7 +178,7 @@ describe('OBPConsentsService.getExistingOpeyConsentId', () => { mockSession = { clientConfig: { baseUri: 'https://test.openbankproject.com', - version: 'v5.1.0', + version: 'v6.0.0', oauthConfig: { consumerKey: 'jgaawf2fnj4yixqdsfaq4gipt4v1wvgsxgre', consumerSecret: 'asdofasdpfjawpefapwehhpfawheofphawfefh', diff --git a/src/components/AutoLogout.vue b/src/components/AutoLogout.vue index 75a0e4f..0120e5e 100644 --- a/src/components/AutoLogout.vue +++ b/src/components/AutoLogout.vue @@ -37,7 +37,7 @@ async function getOBPSuggestedTimeout() { let timeoutInSeconds: number; // Fetch the suggested timeout from the OBP API - const response = await fetch(`${obpApiHost}/obp/v5.1.0/ui/suggested-session-timeout`); + const response = await fetch(`${obpApiHost}/obp/${import.meta.env.VITE_OBP_API_VERSION}/ui/suggested-session-timeout`); const json = await response.json(); if(json.timeout_in_seconds) { timeoutInSeconds = json.timeout_in_seconds; diff --git a/src/components/Menu.vue b/src/components/Menu.vue index eade15c..e2b8e76 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -52,7 +52,7 @@ const clearCacheStorage = (event: any) => {    - OBPv5.1.0 + App Version: {{ APP_VERSION }}