Skip to content

Commit

Permalink
feat: removed result endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
marnixdessing committed Oct 16, 2022
1 parent fe1992b commit 2d5f542
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 281 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json

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

1 change: 0 additions & 1 deletion .gitattributes

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

1 change: 0 additions & 1 deletion .gitignore

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

1 change: 0 additions & 1 deletion .projen/files.json

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

21 changes: 0 additions & 21 deletions .projen/tasks.json

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

2 changes: 0 additions & 2 deletions package.json

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

26 changes: 0 additions & 26 deletions src/ApiStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AuthFunction } from './app/auth/auth-function';
import { IssueFunction } from './app/issue/issue-function';
import { LoginFunction } from './app/login/login-function';
import { LogoutFunction } from './app/logout/logout-function';
import { ResultFunction } from './app/result/result-function';
import { DynamoDbReadOnlyPolicy } from './iam/dynamodb-readonly-policy';
import { SessionsTable } from './SessionsTable';
import { Statics } from './statics';
Expand Down Expand Up @@ -126,25 +125,6 @@ export class ApiStack extends Stack {
secretIrmaApiSecretKey.grantRead(issueFunction.lambda);
secretIrmaApiKey.grantRead(issueFunction.lambda);

const resultFunction = new ApiFunction(this, 'irma-issue-result-function', {
description: 'Result endpoint voor de IRMA issue-applicatie.',
table: this.sessionsTable,
tablePermissions: 'ReadWrite',
applicationUrlBase: baseUrl,
readOnlyRole,
environment: {
IRMA_API_HOST: irmaApiHost,
IRMA_API_DEMO: irmaApiDemo,
IRMA_API_ACCESS_KEY_ID_ARN: secretIrmaApiAccessKeyId.secretArn,
IRMA_API_SECRET_KEY_ARN: secretIrmaApiSecretKey.secretArn,
IRMA_API_KEY_ARN: secretIrmaApiKey.secretArn,
},
}, ResultFunction);
secretIrmaApiAccessKeyId.grantRead(resultFunction.lambda);
secretIrmaApiSecretKey.grantRead(resultFunction.lambda);
secretIrmaApiKey.grantRead(resultFunction.lambda);


this.api.addRoutes({
integration: new HttpLambdaIntegration('irma-issue-login', loginFunction.lambda),
path: '/login',
Expand All @@ -163,12 +143,6 @@ export class ApiStack extends Stack {
methods: [apigatewayv2.HttpMethod.GET],
});

this.api.addRoutes({ // Endpoint for relaying signed request to IRMA issue server (secured with AWS credentials)
integration: new HttpLambdaIntegration('irma-issue-result', resultFunction.lambda),
path: '/result',
methods: [apigatewayv2.HttpMethod.GET],
});

this.api.addRoutes({ // Also availabel at / due to CloudFront defaultRootObject
integration: new HttpLambdaIntegration('irma-issue-issue', issueFunction.lambda),
path: '/issue',
Expand Down
2 changes: 1 addition & 1 deletion src/CloudfrontStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class CloudfrontStack extends Stack {
*
* @returns string csp header values
*/
cspHeaderValue() { // TODO make environment dependent (gw-test.nijmegen.nl vs prod)
cspHeaderValue() { // TODO make environment dependent (gw-test.nijmegen.nl vs prod)
const cspValues = 'default-src \'self\';\
frame-ancestors \'self\';\
frame-src \'self\';\
Expand Down
2 changes: 1 addition & 1 deletion src/DNSStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class DNSStack extends Stack {
let dsValue = '';
switch (this.branch) {
case 'acceptance':
dsValue = '52561 13 2 EBD9ED03EC245E70D458F7B300606FB1DBB3C6D185E19EDB835FBC47B396530A'; // TODO manually removed so add again when deploying DNSSEC stack to accp again
dsValue = '52561 13 2 EBD9ED03EC245E70D458F7B300606FB1DBB3C6D185E19EDB835FBC47B396530A';
break;
case 'production':
dsValue = '60066 13 2 932CD585B029E674E17C4C33DFE7DE2C84353ACD8C109760FD17A6CDBD0CF3FA'; // TODO fix in prod
Expand Down
10 changes: 0 additions & 10 deletions src/app/code/IrmaApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,6 @@ export class IrmaApi {
// Get persoonsgegevens
const gegevens = brpData.Persoon.Persoonsgegevens;

// Calculate age attributes
// const birthDateStr: string = gegevens.Geboortedatum;
// const birthDate = parse(birthDateStr, 'dd-MM-yyyy', new Date());
// const age = differenceInYears(birthDate, new Date());
// const over12 = age >= 12 ? 'yes' : 'no';
// const over16 = age >= 16 ? 'yes' : 'no';
// const over18 = age >= 18 ? 'yes' : 'no';
// const over21 = age >= 21 ? 'yes' : 'no';
// const over65 = age >= 65 ? 'yes' : 'no';

// Return the issue request
return {
type: 'issuing',
Expand Down
10 changes: 5 additions & 5 deletions src/app/issue/homeRequestHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ async function handleLoggedinRequest(session: Session, brpClient: ApiClient, irm
let brpFailed = naam == 'Onbekende gebruiker';
let irmaFailed = false;
let irmaSession = {
irmaSessionPtrU: undefined,
irmaSessionPtrU: undefined,
irmaSessionPtrQr: undefined,
irmaSessionToken: undefined,
}
if(!brpFailed){
irmaSessionToken: undefined,
};
if (!brpFailed) {
// Start IRMA session
const irmaResponse = await irmaApi.startSession(brpData);
if(!irmaResponse || irmaResponse.error){
if (!irmaResponse || irmaResponse.error) {
irmaFailed = true;
} else {
irmaSession.irmaSessionPtrQr = irmaResponse.sessionPtr.irmaqr;
Expand Down
35 changes: 0 additions & 35 deletions src/app/result/handleRequest.ts

This file was deleted.

26 changes: 0 additions & 26 deletions src/app/result/result-function.ts

This file was deleted.

36 changes: 0 additions & 36 deletions src/app/result/result.lambda.ts

This file was deleted.

6 changes: 1 addition & 5 deletions src/app/static-resources/static/scripts/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ const irmaClient = irma.newWeb({
sessionPtr: r => { return { "u": sessionPtrU, "irmaqr": sessionPtrQr } },
sessionToken: r => { return sessionToken },
},
result: false
//{
// url: (o, {ptr, token}) => `${sessionResultEndpoint}?token=${token}`,
// parseResponse: r => r.json()
//}
result: false,
},
state: {
serverSentEvents: false,
Expand Down
Loading

0 comments on commit 2d5f542

Please sign in to comment.