Skip to content

Commit

Permalink
Rename presentation_id of init transaction response to transaction_id (
Browse files Browse the repository at this point in the history
  • Loading branch information
vafeini authored Sep 9, 2024
1 parent cb93f9f commit 7df015f
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 34 deletions.
18 changes: 9 additions & 9 deletions Wallet.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
}
],
"url": {
"raw": "http://localhost:8080/ui/presentations/{{presentation_id}}?nonce={{nonce}}",
"raw": "http://localhost:8080/ui/presentations/{{transaction_id}}?nonce={{nonce}}",
"protocol": "http",
"host": [
"localhost"
Expand All @@ -149,7 +149,7 @@
"path": [
"ui",
"presentations",
"{{presentation_id}}"
"{{transaction_id}}"
],
"query": [
{
Expand Down Expand Up @@ -213,7 +213,7 @@
"script": {
"exec": [
"var jsonData = JSON.parse(responseBody);\r",
"postman.setEnvironmentVariable(\"presentation_id\", jsonData.presentation_id);\r",
"postman.setEnvironmentVariable(\"transaction_id\", jsonData.transaction_id);\r",
"postman.setEnvironmentVariable(\"request_uri\", jsonData.request_uri);\r",
" let state = \"\";\r",
"if ( jsonData.request_uri ) {\r",
Expand Down Expand Up @@ -293,7 +293,7 @@
"script": {
"exec": [
"var jsonData = JSON.parse(responseBody);\r",
"postman.setEnvironmentVariable(\"presentation_id\", jsonData.presentation_id);\r",
"postman.setEnvironmentVariable(\"transaction_id\", jsonData.transaction_id);\r",
"postman.setEnvironmentVariable(\"request_uri\", jsonData.request_uri);\r",
" let state = \"\";\r",
"if ( jsonData.request_uri ) {\r",
Expand Down Expand Up @@ -487,7 +487,7 @@
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:8080/wallet/request.jwt/{{presentation_id}}",
"raw": "http://localhost:8080/wallet/request.jwt/{{transaction_id}}",
"protocol": "http",
"host": [
"localhost"
Expand All @@ -496,7 +496,7 @@
"path": [
"wallet",
"request.jwt",
"{{presentation_id}}"
"{{transaction_id}}"
]
}
},
Expand All @@ -514,7 +514,7 @@
}
],
"url": {
"raw": "http://localhost:8080/ui/presentations/{{presentation_id}}?nonce={{nonce}}",
"raw": "http://localhost:8080/ui/presentations/{{transaction_id}}?nonce={{nonce}}",
"protocol": "http",
"host": [
"localhost"
Expand All @@ -523,7 +523,7 @@
"path": [
"ui",
"presentations",
"{{presentation_id}}"
"{{transaction_id}}"
],
"query": [
{
Expand Down Expand Up @@ -574,4 +574,4 @@
"value": "s"
}
]
}
}
5 changes: 0 additions & 5 deletions src/app/core/models/RequestResponse.model.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/core/models/presentation-definition-response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type PresentationDefinitionResponse = {
client_id: string,
request_uri: string,
presentation_id: string
transaction_id: string
}
2 changes: 1 addition & 1 deletion src/app/core/services/data.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DataService } from './data.service';

describe('DataService', () => {
const qrData = {
"presentation_id": "AhF1PtlSCxN7sAMMTQPyAiBjgeVNj6vXC-xXtkH8Ai6gJfdDtUPXewN2Kc1p5EKNnQzR2i6FMKvH7qPH_mxnxA",
"transaction_id": "AhF1PtlSCxN7sAMMTQPyAiBjgeVNj6vXC-xXtkH8Ai6gJfdDtUPXewN2Kc1p5EKNnQzR2i6FMKvH7qPH_mxnxA",
"client_id": "Verifier",
"request_uri": "http://localhost:8080/wallet/request.jwt/aR9QaOQsY2Dhqcw4W30IL8O0s-zQlrkVQZbnQ52KS2Al5Po13elkVZJTo3GKcQn8gxFnYnUA18I8YXG7WhSZ_Q"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { PresentationDefinitionResponse } from '../models/presentation-definitio
const mocResponseData: PresentationDefinitionResponse = {
client_id: 'client_id',
request_uri: 'request_uri',
presentation_id: 'presentation_id'
transaction_id: 'transaction_id'
}

describe('OnlineAuthenticationSIOPService', () => {
Expand Down
8 changes: 4 additions & 4 deletions src/app/core/services/presentation-definition.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { HttpService } from '../network/http/http.service';
import { asyncData } from 'src/testing/async-observable-helpers';
import { HttpErrorResponse } from '@angular/common/http';

const presentation_id = 'F8pqt-RNeJ7EMpGc0dpWn7ySUId0cfszb1UezseLFP5dpzAuGL6Il1F26oXy9Be0nzJtq8QBtzA5Qrsuv1ybKQ';
const transaction_id = 'F8pqt-RNeJ7EMpGc0dpWn7ySUId0cfszb1UezseLFP5dpzAuGL6Il1F26oXy9Be0nzJtq8QBtzA5Qrsuv1ybKQ';

const token = 'o2d2ZXJzaW9uYzEuMGlkb2N1bWVudHOBo2dkb2NUeXBleBhldS5ldXJvcGEuZWMuZXVkaXcucGlkLjFsaXNzdWVyU2lnbmVkompuYW1lU3BhY2VzoXgYZXUuZXVyb3BhLmVjLmV1ZGl3LnBpZC4xkNgYWFikaGRpZ2VzdElEE2ZyYW5kb21QSmzzPZyCDv1T17NLxFK'
const CBORData: any = {
Expand Down Expand Up @@ -38,7 +38,7 @@ describe('PresentationDefinitionService', () => {
it('should be illustrated be a polling request and return vp_token data (called once)', (done: DoneFn) => {

httpServiceSpy.get.and.returnValue(asyncData(CBORData));
service.getWalletResponse(presentation_id).subscribe({
service.getWalletResponse(transaction_id).subscribe({
next(value) {
expect(value.vp_token).toEqual(token);
done();
Expand All @@ -53,7 +53,7 @@ describe('PresentationDefinitionService', () => {
it('should be illustrated be a polling request and return ip_token data (called once)', (done: DoneFn) => {

httpServiceSpy.get.and.returnValue(asyncData(CBORData));
service.getWalletResponse(presentation_id).subscribe({
service.getWalletResponse(transaction_id).subscribe({
next(value) {
expect(value.id_token).toBe(token);
done();
Expand All @@ -73,7 +73,7 @@ describe('PresentationDefinitionService', () => {
});
const source = throwError(errorResponse);
httpServiceSpy.get.and.returnValue(source);
service.getWalletResponse(presentation_id).subscribe({
service.getWalletResponse(transaction_id).subscribe({
next() {},
error(err) {
expect(err.message).toContain('400 Bad Request');
Expand Down
8 changes: 4 additions & 4 deletions src/app/core/services/presentation-definition.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ export class PresentationDefinitionService {
private readonly deviceDetectorService: DeviceDetectorService
) { }

getWalletResponseWithCode (presentation_id: string, code: string) : Observable<PresentationsResponse> {
return this.httpService.get(`ui/presentations/${presentation_id}?response_code=${code}`);
getWalletResponseWithCode (transaction_id: string, code: string) : Observable<PresentationsResponse> {
return this.httpService.get(`ui/presentations/${transaction_id}?response_code=${code}`);
}
getWalletResponse (presentation_id: string) : Observable<PresentationsResponse> {
return this.httpService.get(`ui/presentations/${presentation_id}`);
getWalletResponse (transaction_id: string) : Observable<PresentationsResponse> {
return this.httpService.get(`ui/presentations/${transaction_id}`);
}

generateCode (requestCode: string): Observable<PresentationDefinitionResponse> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DataService } from '@app/core/services/data.service';
import { NavigateService } from '@app/core/services/navigate.service';

const qrData = {
"presentation_id": "AhF1PtlSCxN7sAMMTQPyAiBjgeVNj6vXC-xXtkH8Ai6gJfdDtUPXewN2Kc1p5EKNnQzR2i6FMKvH7qPH_mxnxA",
"transaction_id": "AhF1PtlSCxN7sAMMTQPyAiBjgeVNj6vXC-xXtkH8Ai6gJfdDtUPXewN2Kc1p5EKNnQzR2i6FMKvH7qPH_mxnxA",
"client_id": "Verifier",
"request_uri": "http://localhost:8080/wallet/request.jwt/aR9QaOQsY2Dhqcw4W30IL8O0s-zQlrkVQZbnQ52KS2Al5Po13elkVZJTo3GKcQn8gxFnYnUA18I8YXG7WhSZ_Q"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class QrCodeComponent implements OnInit, OnDestroy {

if (this.deviceDetectorService.isDesktop()) {
this.setUpQrCode(this.redirectUrl);
this.pollingRequest(this.presentationDefinition.presentation_id);
this.pollingRequest(this.presentationDefinition.transaction_id);
}
}
}
Expand All @@ -95,15 +95,15 @@ export class QrCodeComponent implements OnInit, OnDestroy {
});
}

pollingRequest (presentation_id: string) {
pollingRequest (transaction_id: string) {
const source = interval(2000);
source
.pipe(
takeUntil(this.stopPlay$),
take(60)
)
.subscribe(() => {
this.presentationDefinitionService.getWalletResponse(presentation_id).
this.presentationDefinitionService.getWalletResponse(transaction_id).
pipe(
takeUntil(this.stopPlay$),
map((data) => data as WalletResponse),
Expand Down Expand Up @@ -137,7 +137,7 @@ export class QrCodeComponent implements OnInit, OnDestroy {
console.error('Failed to copy: ', err);
}
}
private buildQrCode (data: {client_id: string, request_uri: string, presentation_id: string}): string {
private buildQrCode (data: {client_id: string, request_uri: string, transaction_id: string}): string {
let builtURL = `${environment.apiUrl}?client_id=${data.client_id}&request_uri=${encodeURIComponent(data.request_uri)}`;
builtURL = builtURL.replace('https://', this.scheme);
return builtURL;
Expand All @@ -149,7 +149,7 @@ export class QrCodeComponent implements OnInit, OnDestroy {
openLogs () {
this.dialog.open(OpenLogsComponent, {
data: {
transactionId: this.presentationDefinition.presentation_id,
transactionId: this.presentationDefinition.transaction_id,
label: 'Show Logs',
isInspectLogs: false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const WalletRedirectResolver: ResolveFn<{vpToken: KeyValue<string, string
const responseCode: string = route.queryParams['response_code'];
if (stData && responseCode) {
data = JSON.parse( stData );
return services.definition.getWalletResponseWithCode(data.presentation_id, responseCode)
return services.definition.getWalletResponseWithCode(data.transaction_id, responseCode)
.pipe(
switchMap((res: WalletResponse) => {
return forkJoin({
Expand Down
4 changes: 2 additions & 2 deletions src/proxy.conf.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"/ui": {
"target": "https://dev.verifier-backend.eudiw.dev",
"target": "http://localhost:8080",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/wallet": {
"target": "https://dev.verifier.eudiw.dev/home",
"target": "http://localhost:8080",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
Expand Down

0 comments on commit 7df015f

Please sign in to comment.