From be397c8899d5b4406c17e8f9951555c54f852901 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Fri, 26 Feb 2021 16:50:45 +0000 Subject: [PATCH 01/28] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 208f0ee..eefeca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,11 @@ All notable changes to this project will be documented in this file. Dates are d #### [v0.4.6](https://git.odit.services/lfk/backend/compare/v0.4.5...v0.4.6) -- Merge pull request 'Fixed wrong body acceptance type' (#150) from bugfix/146-usergroup_update into dev [`d870b2f`](https://git.odit.services/lfk/backend/commit/d870b2fd01b11b1732fcbb6feecaf6a6155fa702) +- Merge pull request 'Alpha Release 0.4.6' (#148) from dev into main [`dd3c927`](https://git.odit.services/lfk/backend/commit/dd3c9275d60cb5bb1a40fbe91f666f17a8e0c8d3) - Added tests for the new org selfservice endpoints [`28ef139`](https://git.odit.services/lfk/backend/commit/28ef139a70e0c063982b2eb9167b7abe41db1621) - Added selfservice org response model [`ba3b5ee`](https://git.odit.services/lfk/backend/commit/ba3b5eeefc45f9bd94aef24f9f509f6835f5ea7c) +- 🧾New changelog file version [CI SKIP] [skip ci] [`764b7ff`](https://git.odit.services/lfk/backend/commit/764b7ffe00086248e1f1cccb265ca920a568c0a0) +- Merge pull request 'Fixed wrong body acceptance type' (#150) from bugfix/146-usergroup_update into dev [`d870b2f`](https://git.odit.services/lfk/backend/commit/d870b2fd01b11b1732fcbb6feecaf6a6155fa702) - Added selfservice team response model [`ba396e0`](https://git.odit.services/lfk/backend/commit/ba396e0eba15647b3004437a5a9949c7a69e828d) - 📖New license file version [CI SKIP] [skip ci] [`bce8811`](https://git.odit.services/lfk/backend/commit/bce8811925e7f77c64fc507d55335ac45b0e5572) - 📖New license file version [CI SKIP] [skip ci] [`b1fced7`](https://git.odit.services/lfk/backend/commit/b1fced77640b6c26438331474f368f2b0708b672) From f7f6df41ff74708482db3ea2db717ffb562131c0 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 1 Mar 2021 16:36:36 +0100 Subject: [PATCH 02/28] Added new selfservice response type ref #151 --- src/models/enums/ResponseObjectType.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/enums/ResponseObjectType.ts b/src/models/enums/ResponseObjectType.ts index a25ebd4..a4d2990 100644 --- a/src/models/enums/ResponseObjectType.ts +++ b/src/models/enums/ResponseObjectType.ts @@ -21,6 +21,7 @@ export enum ResponseObjectType { SCANSTATION = 'SCANSTATION', SELFSERVICEDONATION = 'SELFSERVICEDONATION', SELFSERVICERUNNER = 'SELFSERVICRUNNER', + SELFSERVICESCAN = 'SELFSERVICESCAN', SELFSERVICETEAM = 'SELFSERVICETEAM', SELFSERVICEORGANIZATION = 'SELFSERVICEORGANIZATION', STATS = 'STATS', From 030b2255d42aab21d8974fc3a7235285934d53b7 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 1 Mar 2021 16:47:05 +0100 Subject: [PATCH 03/28] Added another resonse type ref #151 --- src/models/enums/ResponseObjectType.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/enums/ResponseObjectType.ts b/src/models/enums/ResponseObjectType.ts index a4d2990..c7fc527 100644 --- a/src/models/enums/ResponseObjectType.ts +++ b/src/models/enums/ResponseObjectType.ts @@ -22,6 +22,7 @@ export enum ResponseObjectType { SELFSERVICEDONATION = 'SELFSERVICEDONATION', SELFSERVICERUNNER = 'SELFSERVICRUNNER', SELFSERVICESCAN = 'SELFSERVICESCAN', + SELFSERVICETRACKSCAN = 'SELFSERVICETRACKSCAN', SELFSERVICETEAM = 'SELFSERVICETEAM', SELFSERVICEORGANIZATION = 'SELFSERVICEORGANIZATION', STATS = 'STATS', From 6074ac5b3a8e43fd98394c1fb70c6e1dea8fcd5e Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 1 Mar 2021 16:47:54 +0100 Subject: [PATCH 04/28] Added selfservice scan response class ref #151 --- .../responses/ResponseSelfServiceScan.ts | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/models/responses/ResponseSelfServiceScan.ts diff --git a/src/models/responses/ResponseSelfServiceScan.ts b/src/models/responses/ResponseSelfServiceScan.ts new file mode 100644 index 0000000..65b90de --- /dev/null +++ b/src/models/responses/ResponseSelfServiceScan.ts @@ -0,0 +1,57 @@ +import { IsBoolean, IsInt, IsNotEmpty, IsPositive } from "class-validator"; +import { Scan } from '../entities/Scan'; +import { TrackScan } from '../entities/TrackScan'; +import { ResponseObjectType } from '../enums/ResponseObjectType'; +import { IResponse } from './IResponse'; + +/** + * Defines the scan selfservice response. +*/ +export class ResponseSelfServiceScan implements IResponse { + /** + * The responseType. + * This contains the type of class/entity this response contains. + */ + responseType: ResponseObjectType = ResponseObjectType.SELFSERVICESCAN; + + /** + * The scans's id (for sorting). + */ + @IsInt() + id: number; + + /** + * Is the scan valid (for fraud reasons). + * The determination of validity will work differently for every child class. + */ + @IsBoolean() + valid: boolean = true; + + /** + * The scans's length/distance in meters. + */ + @IsInt() + @IsPositive() + distance: number; + + /** + * The scans's lap time (0 if non is availdable). + */ + @IsInt() + @IsNotEmpty() + lapTime: number = 0; + + /** + * Creates a ResponseScan object from a scan. + * @param scan The scan the response shall be build for. + */ + public constructor(scan: Scan | TrackScan) { + this.id = scan.id; + this.distance = scan.distance; + this.valid = scan.valid; + if (scan instanceof TrackScan) { + this.lapTime = scan.lapTime; + this.responseType = ResponseObjectType.SELFSERVICETRACKSCAN; + } + } +} From 771a205fe634fc5c07e794b3245c59483ff14bd8 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 1 Mar 2021 16:49:37 +0100 Subject: [PATCH 05/28] Added new selfservice scans endpoint ref #151 --- src/controllers/RunnerSelfServiceController.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/controllers/RunnerSelfServiceController.ts b/src/controllers/RunnerSelfServiceController.ts index 324f9c1..8b1f30c 100644 --- a/src/controllers/RunnerSelfServiceController.ts +++ b/src/controllers/RunnerSelfServiceController.ts @@ -14,6 +14,7 @@ import { RunnerGroup } from '../models/entities/RunnerGroup'; import { RunnerOrganization } from '../models/entities/RunnerOrganization'; import { ResponseSelfServiceOrganisation } from '../models/responses/ResponseSelfServiceOrganisation'; import { ResponseSelfServiceRunner } from '../models/responses/ResponseSelfServiceRunner'; +import { ResponseSelfServiceScan } from '../models/responses/ResponseSelfServiceScan'; @JsonController() @@ -38,6 +39,20 @@ export class RunnerSelfServiceController { return (new ResponseSelfServiceRunner(await this.getRunner(token))); } + @Get('/runners/me/:jwt/scans') + @ResponseSchema(ResponseSelfServiceScan, { isArray: true }) + @ResponseSchema(RunnerNotFoundError, { statusCode: 404 }) + @OnUndefined(RunnerNotFoundError) + @OpenAPI({ description: 'Lists all your (runner) scans.
Please provide your runner jwt(that code we gave you during registration) for auth.
If you lost your jwt/personalized link please contact support.' }) + async getScans(@Param('jwt') token: string) { + const scans = (await this.getRunner(token)).scans; + let responseScans = new Array() + for (let scan of scans) { + responseScans.push(new ResponseSelfServiceScan(scan)); + } + return responseScans; + } + @Post('/runners/register') @ResponseSchema(ResponseSelfServiceRunner) @ResponseSchema(RunnerEmailNeededError, { statusCode: 406 }) From aa833736d32993b1656abeeb02a4f8b021ec6252 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 1 Mar 2021 16:58:34 +0100 Subject: [PATCH 06/28] Trackscans now have a laptime that get's calculated on creation ref #151 --- src/models/actions/create/CreateTrackScan.ts | 15 ++++++++------- src/models/entities/TrackScan.ts | 10 ++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/models/actions/create/CreateTrackScan.ts b/src/models/actions/create/CreateTrackScan.ts index 89ccb5b..578497f 100644 --- a/src/models/actions/create/CreateTrackScan.ts +++ b/src/models/actions/create/CreateTrackScan.ts @@ -44,6 +44,7 @@ export class CreateTrackScan { } newScan.timestamp = Math.round(new Date().getTime() / 1000); + newScan.lapTime = await this.getLaptime(newScan) newScan.valid = await this.validateScan(newScan); return newScan; @@ -65,15 +66,15 @@ export class CreateTrackScan { return station; } - public async validateScan(scan: TrackScan): Promise { + public validateScan(scan: TrackScan): boolean { + return (scan.lapTime > scan.track.minimumLapTime); + } + + public async getLaptime(scan: TrackScan): Promise { const scans = await getConnection().getRepository(TrackScan).find({ where: { runner: scan.runner, valid: true }, relations: ["track"] }); - if (scans.length == 0) { return true; } + if (scans.length == 0) { return 0; } const newestScan = scans[scans.length - 1]; - if ((scan.timestamp - newestScan.timestamp) > scan.track.minimumLapTime) { - return true; - } - - return false; + return (scan.timestamp - newestScan.timestamp); } } \ No newline at end of file diff --git a/src/models/entities/TrackScan.ts b/src/models/entities/TrackScan.ts index cd8049a..17983f3 100644 --- a/src/models/entities/TrackScan.ts +++ b/src/models/entities/TrackScan.ts @@ -2,6 +2,8 @@ import { IsInt, IsNotEmpty, + IsNumber, + IsPositive } from "class-validator"; import { ChildEntity, Column, ManyToOne } from "typeorm"; @@ -59,6 +61,14 @@ export class TrackScan extends Scan { @IsInt() timestamp: number; + /** + * The scan's lap time. + * This simply get's calculated from the last lap time; + */ + @Column() + @IsNumber() + lapTime: number; + /** * Turns this entity into it's response class. */ From a2c97a11a3dc82543076e3844f20d1218943bbf9 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 1 Mar 2021 16:59:36 +0100 Subject: [PATCH 07/28] Laptime is now a part of the response ref #151 --- src/models/responses/ResponseTrackScan.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/models/responses/ResponseTrackScan.ts b/src/models/responses/ResponseTrackScan.ts index ffd9ceb..9bbc6f3 100644 --- a/src/models/responses/ResponseTrackScan.ts +++ b/src/models/responses/ResponseTrackScan.ts @@ -1,4 +1,4 @@ -import { IsDateString, IsNotEmpty } from "class-validator"; +import { IsDateString, IsNotEmpty, IsNumber } from "class-validator"; import { TrackScan } from '../entities/TrackScan'; import { ResponseObjectType } from '../enums/ResponseObjectType'; import { IResponse } from './IResponse'; @@ -42,6 +42,13 @@ export class ResponseTrackScan extends ResponseScan implements IResponse { @IsNotEmpty() timestamp: number; + /** + * The scan's lap time. + * This simply get's calculated from the last lap time; + */ + @IsNumber() + lapTime: number; + /** * Creates a ResponseTrackScan object from a scan. * @param scan The trackSscan the response shall be build for. @@ -53,5 +60,6 @@ export class ResponseTrackScan extends ResponseScan implements IResponse { if (scan.station) { scan.station.toResponse(); } this.timestamp = scan.timestamp; this.distance = scan.distance; + this.lapTime = scan.lapTime; } } From 0fcc729b56430f0fdb56242857aa1d883d5a4866 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 15:51:05 +0100 Subject: [PATCH 08/28] Removed old mailer code ref #151 --- src/mailer.ts | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/src/mailer.ts b/src/mailer.ts index d1f31c2..ea3a775 100644 --- a/src/mailer.ts +++ b/src/mailer.ts @@ -1,36 +1,17 @@ -import fs from "fs"; -import nodemailer from 'nodemailer'; -import { MailOptions } from 'nodemailer/lib/json-transport'; -import Mail from 'nodemailer/lib/mailer'; import { config } from './config'; -import { MailServerConfigError } from './errors/MailErrors'; /** * This class is responsible for all things mail sending. * This uses the mail emplates from src/static/mail_templates */ export class Mailer { - private transport: Mail; /** * The class's default constructor. * Creates the transporter and tests the connection. */ constructor() { - this.transport = nodemailer.createTransport({ - host: config.mail_server, - port: config.mail_port, - auth: { - user: config.mail_user, - pass: config.mail_password - } - }); - this.transport.verify(function (error, success) { - if (error) { - throw new MailServerConfigError(); - } - }); } /** @@ -39,17 +20,7 @@ export class Mailer { * @param token The requested password reset token - will be combined with the app_url to generate a password reset link. */ public async sendResetMail(to_address: string, token: string) { - const reset_link = `${config.app_url}/reset/${(Buffer.from(token)).toString("base64")}` - const body_html = fs.readFileSync(__dirname + '/static/mail_templates/pw-reset.html', { encoding: 'utf8' }).replace("{{reset_link}}", reset_link).replace("{{recipient_mail}}", to_address).replace("{{copyright_owner}}", "LfK!").replace("{{link_imprint}}", `${config.app_url}/imprint`).replace("{{link_privacy}}", `${config.app_url}/privacy`); - const body_txt = fs.readFileSync(__dirname + '/static/mail_templates/pw-reset.html', { encoding: 'utf8' }).replace("{{reset_link}}", reset_link).replace("{{recipient_mail}}", to_address).replace("{{copyright_owner}}", "LfK!").replace("{{link_imprint}}", `${config.app_url}/imprint`).replace("{{link_privacy}}", `${config.app_url}/privacy`); - const mail: MailOptions = { - to: to_address, - subject: "LfK! Password Reset", - text: body_txt, - html: body_html - }; - await this.sendMail(mail); } /** @@ -57,23 +28,7 @@ export class Mailer { * @param to_address The address the test mail will be sent to - this is the configured from-address by default. */ public async sendTestMail(to_address: string = config.mail_from) { - const body_html = fs.readFileSync(__dirname + '/static/mail_templates/test.html', { encoding: 'utf8' }).replace("{{recipient_mail}}", to_address).replace("{{copyright_owner}}", "LfK!").replace("{{link_imprint}}", `${config.app_url}/imprint`).replace("{{link_privacy}}", `${config.app_url}/privacy`); - const body_txt = fs.readFileSync(__dirname + '/static/mail_templates/test.txt', { encoding: 'utf8' }).replace("{{recipient_mail}}", to_address).replace("{{copyright_owner}}", "LfK!").replace("{{link_imprint}}", `${config.app_url}/imprint`).replace("{{link_privacy}}", `${config.app_url}/privacy`); - const mail: MailOptions = { - to: to_address, - subject: "LfK! Test Mail", - text: body_txt, - html: body_html - }; - await this.sendMail(mail); + } - /** - * Wrapper function for sending a mail via this object's transporter. - * @param mail MailOptions object containing the - */ - public async sendMail(mail: MailOptions) { - mail.from = config.mail_from; - await this.transport.sendMail(mail); - } } From 5833f4218f9a4c97b69021814df92470a1816917 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 15:52:20 +0100 Subject: [PATCH 09/28] Removed nodemailer from backend ref #151 --- package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/package.json b/package.json index b2c115d..a95489a 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "jsonwebtoken": "^8.5.1", "libphonenumber-js": "^1.9.9", "mysql": "^2.18.1", - "nodemailer": "^6.4.17", "pg": "^8.5.1", "reflect-metadata": "^0.1.13", "routing-controllers": "0.9.0-alpha.6", @@ -57,7 +56,6 @@ "@types/jest": "^26.0.20", "@types/jsonwebtoken": "^8.5.0", "@types/node": "^14.14.22", - "@types/nodemailer": "^6.4.0", "@types/uuid": "^8.3.0", "axios": "^0.21.1", "cp-cli": "^2.0.0", From 0342757d929b12635c88e74f17495df656865b1a Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 15:54:27 +0100 Subject: [PATCH 10/28] Removed mail config ref #151 --- scripts/create_testenv.ts | 31 ++++++++----------------------- src/config.ts | 5 ----- src/tests/mails/mail_test.spec.ts | 22 ---------------------- 3 files changed, 8 insertions(+), 50 deletions(-) delete mode 100644 src/tests/mails/mail_test.spec.ts diff --git a/scripts/create_testenv.ts b/scripts/create_testenv.ts index 1fa6c8c..6fd3ae1 100644 --- a/scripts/create_testenv.ts +++ b/scripts/create_testenv.ts @@ -1,15 +1,8 @@ import consola from "consola"; import fs from "fs"; -import nodemailer from "nodemailer"; -nodemailer.createTestAccount((err, account) => { - if (err) { - console.error('Failed to create a testing account. ' + err.message); - return process.exit(1); - } - - const env = ` +const env = ` APP_PORT=4010 DB_TYPE=sqlite DB_HOST=bla @@ -19,19 +12,11 @@ DB_PASSWORD=bla DB_NAME=./test.sqlite NODE_ENV=dev POSTALCODE_COUNTRYCODE=DE -SEED_TEST_DATA=true -MAIL_SERVER=${account.smtp.host} -MAIL_PORT=${account.smtp.port} -MAIL_USER=${account.user} -MAIL_PASSWORD=${account.pass} -MAIL_FROM=${account.user}` - - try { - fs.writeFileSync("./.env", env, { encoding: "utf-8" }); - consola.success("Exported ci env to .env"); - } catch (error) { - consola.error("Couldn't export the ci env"); - } - -}); +SEED_TEST_DATA=true`; +try { + fs.writeFileSync("./.env", env, { encoding: "utf-8" }); + consola.success("Exported ci env to .env"); +} catch (error) { + consola.error("Couldn't export the ci env"); +} \ No newline at end of file diff --git a/src/config.ts b/src/config.ts index 8dbffca..64c827a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -12,11 +12,6 @@ export const config = { version: process.env.VERSION || require('../package.json').version, seedTestData: getDataSeeding(), app_url: process.env.APP_URL || "http://localhost:8080", - mail_server: process.env.MAIL_SERVER, - mail_port: Number(process.env.MAIL_PORT) || 25, - mail_user: process.env.MAIL_USER, - mail_password: process.env.MAIL_PASSWORD, - mail_from: process.env.MAIL_FROM, privacy_url: process.env.PRIVACY_URL || "/privacy", imprint_url: process.env.IMPRINT_URL || "/imprint" } diff --git a/src/tests/mails/mail_test.spec.ts b/src/tests/mails/mail_test.spec.ts deleted file mode 100644 index d8a8d71..0000000 --- a/src/tests/mails/mail_test.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import axios from 'axios'; -import { config } from '../../config'; - -const base = "http://localhost:" + config.internal_port - -let access_token; -let axios_config; - -beforeAll(async () => { - const res = await axios.post(base + '/api/auth/login', { username: "demo", password: "demo" }); - access_token = res.data["access_token"]; - axios_config = { - headers: { "authorization": "Bearer " + access_token }, - validateStatus: undefined - }; -}); - -describe('POST /mails/test valid', () => { - it('test mail request should return 200', async () => { - const res1 = await axios.post(base + '/api/mails/test', null, axios_config); - }); -}); \ No newline at end of file From c2fdfeed4f5fc454b02bc4b198965889c173bbaa Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 15:54:47 +0100 Subject: [PATCH 11/28] Removed mail templates ref #151 --- src/static/mail_templates/.gitkeep | 0 src/static/mail_templates/pw-reset.html | 384 ------------------------ src/static/mail_templates/pw-reset.txt | 12 - src/static/mail_templates/test.html | 369 ----------------------- src/static/mail_templates/test.txt | 8 - 5 files changed, 773 deletions(-) delete mode 100644 src/static/mail_templates/.gitkeep delete mode 100644 src/static/mail_templates/pw-reset.html delete mode 100644 src/static/mail_templates/pw-reset.txt delete mode 100644 src/static/mail_templates/test.html delete mode 100644 src/static/mail_templates/test.txt diff --git a/src/static/mail_templates/.gitkeep b/src/static/mail_templates/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/static/mail_templates/pw-reset.html b/src/static/mail_templates/pw-reset.html deleted file mode 100644 index 7f672b8..0000000 --- a/src/static/mail_templates/pw-reset.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - LfK! - Passwort zurücksetzen - - - - - - - - - - - - - - - - - - - - - -
- - - -
- LfK! - Password reset -
- - - - -
- - \ No newline at end of file diff --git a/src/static/mail_templates/pw-reset.txt b/src/static/mail_templates/pw-reset.txt deleted file mode 100644 index 68366b7..0000000 --- a/src/static/mail_templates/pw-reset.txt +++ /dev/null @@ -1,12 +0,0 @@ -LfK! - Password reset. - -A password reset for your account got requested -If you didn't request the reset please ignore this mail -Your password won't be changed until you click the reset link below and set a new one. - -Reset: {{reset_link}} - - -Copyright © {{copyright_owner}}. All rights reserved. -Imprint: {{link_imprint}} | Privacy: {{link_privacy}} -This mail was sent to {{recipient_mail}} because someone request a password reset for a account linked to the mail address. \ No newline at end of file diff --git a/src/static/mail_templates/test.html b/src/static/mail_templates/test.html deleted file mode 100644 index 35be644..0000000 --- a/src/static/mail_templates/test.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - LfK! - Mail test - - - - - - - - - - - - - - - - - - - - - -
- - - -
- LfK! - Mail test -
- - - - -
- - \ No newline at end of file diff --git a/src/static/mail_templates/test.txt b/src/static/mail_templates/test.txt deleted file mode 100644 index 423da10..0000000 --- a/src/static/mail_templates/test.txt +++ /dev/null @@ -1,8 +0,0 @@ -LfK! - Mail test. - -This is a test mail triggered by an admin in the LfK! backend. - - -Copyright © {{copyright_owner}}. All rights reserved. -Imprint: {{link_imprint}} | Privacy: {{link_privacy}} -This mail was sent to {{recipient_mail}} because someone requested a mail test for this mail address. \ No newline at end of file From a9e06c905537b6da24706389e304e825a33a28ad Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 15:56:24 +0100 Subject: [PATCH 12/28] Promoted axios to dependency ref #151 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a95489a..784d439 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "dependencies": { "@odit/class-validator-jsonschema": "2.1.1", "argon2": "^0.27.1", + "axios": "^0.21.1", "body-parser": "^1.19.0", "class-transformer": "0.3.1", "class-validator": "^0.13.1", @@ -57,7 +58,6 @@ "@types/jsonwebtoken": "^8.5.0", "@types/node": "^14.14.22", "@types/uuid": "^8.3.0", - "axios": "^0.21.1", "cp-cli": "^2.0.0", "jest": "^26.6.3", "nodemon": "^2.0.7", From f289afd8bc47f6eae9f12f765322b2db974ba918 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:10:26 +0100 Subject: [PATCH 13/28] Updated mail errors ref #151 --- src/errors/MailErrors.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/errors/MailErrors.ts b/src/errors/MailErrors.ts index 7772ca9..1bde0ba 100644 --- a/src/errors/MailErrors.ts +++ b/src/errors/MailErrors.ts @@ -1,12 +1,17 @@ -import { IsString } from 'class-validator' +import { IsString } from 'class-validator'; +import { InternalServerError } from 'routing-controllers'; /** * Error to throw when a permission couldn't be found. */ -export class MailServerConfigError extends Error { +export class MailSendingError extends InternalServerError { @IsString() - name = "MailServerConfigError" + name = "MailSendingError" @IsString() - message = "The SMTP server you provided couldn't be reached!" + message = "We had a problem sending the mail!" + + constructor() { + super("We had a problem sending the mail!"); + } } \ No newline at end of file From 1551a444babc025cde6e894c66d2be2c84ab26da Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:10:43 +0100 Subject: [PATCH 14/28] Added the new mailer code ref #151 --- src/mailer.ts | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/mailer.ts b/src/mailer.ts index ea3a775..a831624 100644 --- a/src/mailer.ts +++ b/src/mailer.ts @@ -1,34 +1,41 @@ +import axios from 'axios'; import { config } from './config'; +import { MailSendingError } from './errors/MailErrors'; /** * This class is responsible for all things mail sending. * This uses the mail emplates from src/static/mail_templates */ export class Mailer { - - /** - * The class's default constructor. - * Creates the transporter and tests the connection. - */ - constructor() { - - } + public static base: string = config.mailer_url; + public static key: string = config.mailer_key; /** * Function for sending a test mail from the test mail template. * @param to_address The address the mail will be sent to. Should always get pulled from a user object. * @param token The requested password reset token - will be combined with the app_url to generate a password reset link. */ - public async sendResetMail(to_address: string, token: string) { - + public static async sendResetMail(to_address: string, token: string, locale: string = "en") { + try { + await axios.post(`${Mailer.base}/reset?locale=${locale}&key=${Mailer.key}`, { + address: to_address, + resetKey: token + }); + } catch (error) { + throw new MailSendingError(); + } } /** * Function for sending a test mail from the test mail template. * @param to_address The address the test mail will be sent to - this is the configured from-address by default. */ - public async sendTestMail(to_address: string = config.mail_from) { - + public static async sendTestMail(locale: string = "en") { + try { + await axios.post(`${Mailer.base}/test?locale=${locale}&key=${Mailer.key}`); + } catch (error) { + throw new MailSendingError(); + } } } From ddea02db574cc348685558f3fa3ecc84adbd6b65 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:11:05 +0100 Subject: [PATCH 15/28] Added new mailer settings to config ref #151 --- src/config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 64c827a..3e2bf7f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -13,7 +13,9 @@ export const config = { seedTestData: getDataSeeding(), app_url: process.env.APP_URL || "http://localhost:8080", privacy_url: process.env.PRIVACY_URL || "/privacy", - imprint_url: process.env.IMPRINT_URL || "/imprint" + imprint_url: process.env.IMPRINT_URL || "/imprint", + mailer_url: process.env.MAILER_URL || "http://localhost:8080/mailer", + mailer_key: process.env.MAILER_KEY || "pleasesetme" } let errors = 0 if (typeof config.internal_port !== "number") { From 485c247cd3305c4c4422d5582b1d61cc7af84989 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:11:21 +0100 Subject: [PATCH 16/28] Removed (now useless) mail controller ref #151 --- src/controllers/MailController.ts | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/controllers/MailController.ts diff --git a/src/controllers/MailController.ts b/src/controllers/MailController.ts deleted file mode 100644 index 94ff599..0000000 --- a/src/controllers/MailController.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Authorized, JsonController, Post } from 'routing-controllers'; -import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi'; -import { config } from '../config'; -import { Mailer } from '../mailer'; -import { ResponseEmpty } from '../models/responses/ResponseEmpty'; - - -@JsonController('/mails') -@OpenAPI({ security: [{ "AuthToken": [] }, { "RefreshTokenCookie": [] }] }) -export class MailController { - - private mailer: Mailer; - - constructor() { - this.mailer = new Mailer(); - } - - @Post('/test') - @Authorized(["MAIL:CREATE"]) - @ResponseSchema(ResponseEmpty, { statusCode: 200 }) - @OpenAPI({ description: 'Sends a test email to the configured from-address.' }) - async get() { - await this.mailer.sendTestMail(config.mail_from); - return new ResponseEmpty(); - } -} \ No newline at end of file From 9a1678acf0929dab9f84bd2c6a961b52e36172ce Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:11:35 +0100 Subject: [PATCH 17/28] Now using mailer as static funtion ref #151 --- src/controllers/AuthController.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/controllers/AuthController.ts b/src/controllers/AuthController.ts index de5ed39..b3e2999 100644 --- a/src/controllers/AuthController.ts +++ b/src/controllers/AuthController.ts @@ -15,12 +15,6 @@ import { Logout } from '../models/responses/ResponseLogout'; @JsonController('/auth') export class AuthController { - private mailer: Mailer; - - constructor() { - this.mailer = new Mailer(); - } - @Post("/login") @ResponseSchema(ResponseAuth) @ResponseSchema(InvalidCredentialsError) @@ -94,7 +88,7 @@ export class AuthController { @OpenAPI({ description: "Request a password reset token.
This will provide you with a reset token that you can use by posting to /api/auth/reset/{token}." }) async getResetToken(@Body({ validate: true }) passwordReset: CreateResetToken) { const reset_token: string = await passwordReset.toResetToken(); - await this.mailer.sendResetMail(passwordReset.email, reset_token); + await Mailer.sendResetMail(passwordReset.email, reset_token); return new ResponseEmpty(); } From ada679823cda8bc31d45c0ff6905f3d270cfd729 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:13:36 +0100 Subject: [PATCH 18/28] Removed useless functions and updated comments ref #151 --- src/mailer.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/mailer.ts b/src/mailer.ts index a831624..33d7f24 100644 --- a/src/mailer.ts +++ b/src/mailer.ts @@ -4,14 +4,14 @@ import { MailSendingError } from './errors/MailErrors'; /** * This class is responsible for all things mail sending. - * This uses the mail emplates from src/static/mail_templates + * This uses axios to communicate with the mailer api (https://git.odit.services/lfk/mailer). */ export class Mailer { public static base: string = config.mailer_url; public static key: string = config.mailer_key; /** - * Function for sending a test mail from the test mail template. + * Function for sending a password reset mail. * @param to_address The address the mail will be sent to. Should always get pulled from a user object. * @param token The requested password reset token - will be combined with the app_url to generate a password reset link. */ @@ -25,17 +25,4 @@ export class Mailer { throw new MailSendingError(); } } - - /** - * Function for sending a test mail from the test mail template. - * @param to_address The address the test mail will be sent to - this is the configured from-address by default. - */ - public static async sendTestMail(locale: string = "en") { - try { - await axios.post(`${Mailer.base}/test?locale=${locale}&key=${Mailer.key}`); - } catch (error) { - throw new MailSendingError(); - } - } - } From bb9bad6d90370e768d4baffaae23ec756cc8353b Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:19:19 +0100 Subject: [PATCH 19/28] Now checking for mails being set ref #151 --- src/config.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index 3e2bf7f..08af1ac 100644 --- a/src/config.ts +++ b/src/config.ts @@ -14,8 +14,8 @@ export const config = { app_url: process.env.APP_URL || "http://localhost:8080", privacy_url: process.env.PRIVACY_URL || "/privacy", imprint_url: process.env.IMPRINT_URL || "/imprint", - mailer_url: process.env.MAILER_URL || "http://localhost:8080/mailer", - mailer_key: process.env.MAILER_KEY || "pleasesetme" + mailer_url: process.env.MAILER_URL || "", + mailer_key: process.env.MAILER_KEY || "" } let errors = 0 if (typeof config.internal_port !== "number") { @@ -24,6 +24,9 @@ if (typeof config.internal_port !== "number") { if (typeof config.development !== "boolean") { errors++ } +if (config.mailer_url == "" || config.mailer_key == "") { + errors++; +} function getPhoneCodeLocale(): CountryCode { return (process.env.PHONE_COUNTRYCODE as CountryCode); } From a5d2a6ecd31dc9c186d4201aef5c52e34cbef3b5 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:25:23 +0100 Subject: [PATCH 20/28] Added locale to pw reset endpoint ref #151 --- src/controllers/AuthController.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controllers/AuthController.ts b/src/controllers/AuthController.ts index b3e2999..eebbd79 100644 --- a/src/controllers/AuthController.ts +++ b/src/controllers/AuthController.ts @@ -1,6 +1,7 @@ -import { Body, CookieParam, JsonController, Param, Post, Req, Res } from 'routing-controllers'; +import { Body, CookieParam, JsonController, Param, Post, QueryParam, Req, Res } from 'routing-controllers'; import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi'; import { IllegalJWTError, InvalidCredentialsError, JwtNotProvidedError, PasswordNeededError, RefreshTokenCountInvalidError, UsernameOrEmailNeededError } from '../errors/AuthError'; +import { MailSendingError } from '../errors/MailErrors'; import { UserNotFoundError } from '../errors/UserErrors'; import { Mailer } from '../mailer'; import { CreateAuth } from '../models/actions/create/CreateAuth'; @@ -85,10 +86,11 @@ export class AuthController { @ResponseSchema(ResponseEmpty, { statusCode: 200 }) @ResponseSchema(UserNotFoundError, { statusCode: 404 }) @ResponseSchema(UsernameOrEmailNeededError, { statusCode: 406 }) + @ResponseSchema(MailSendingError, { statusCode: 500 }) @OpenAPI({ description: "Request a password reset token.
This will provide you with a reset token that you can use by posting to /api/auth/reset/{token}." }) - async getResetToken(@Body({ validate: true }) passwordReset: CreateResetToken) { + async getResetToken(@Body({ validate: true }) passwordReset: CreateResetToken, @QueryParam("locale") locale: string = "en") { const reset_token: string = await passwordReset.toResetToken(); - await Mailer.sendResetMail(passwordReset.email, reset_token); + await Mailer.sendResetMail(passwordReset.email, reset_token, locale); return new ResponseEmpty(); } From 149f3a83b2e9d59bfbf36c7ea9e27bc7f514856d Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:28:13 +0100 Subject: [PATCH 21/28] Updated readme env section ref #151 --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 51b2d70..b933080 100644 --- a/README.md +++ b/README.md @@ -64,11 +64,8 @@ yarn docs | POSTALCODE_COUNTRYCODE | String/CountryCode | N/A | The countrycode used to validate address's postal codes | PHONE_COUNTRYCODE | String/CountryCode | null (international) | The countrycode used to validate phone numers | SEED_TEST_DATA | Boolean | False | If you want the app to seed some example data set this to true -| MAIL_SERVER | String | N/A | The smtp server's ip-address/fqdn -| MAIL_PORT | String | N/A | The smtp server's port -| MAIL_USER | String | N/A | The username for sending mails -| MAIL_PASSWORD | String | N/A | The user's password for sending mails -| MAIL_FROM | String | N/A | The from-address for sending mails +| MAILER_URL | String(Url) | N/A | The mailer's base url (no trailing slash) +| MAILER_KEY | String | N/A | The mailer's api key. | IMPRINT_URL | String(Url) | /imprint | The link to a imprint page for the system (Defaults to the frontend's imprint) | PRIVACY_URL | String(Url) | /privacy | The link to a privacy page for the system (Defaults to the frontend's privacy page) From db58a280b3792b768eb2b1c82a76d9a9836978b1 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:28:13 +0100 Subject: [PATCH 22/28] Updated readme env section ref #151 --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 51b2d70..b2ba341 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ yarn docs ## ENV Vars > You can provide them via .env file or docker env vars. -> You can use the `test:ci:generate_env` package script to generate a example env (uses [ethereal.email](https://ethereal.email) as the mailserver). +> You can use the `test:ci:generate_env` package script to generate a example env (uses bs data as test server and ignores the errors). | Name | Type | Default | Description | - | - | - | - @@ -64,11 +64,8 @@ yarn docs | POSTALCODE_COUNTRYCODE | String/CountryCode | N/A | The countrycode used to validate address's postal codes | PHONE_COUNTRYCODE | String/CountryCode | null (international) | The countrycode used to validate phone numers | SEED_TEST_DATA | Boolean | False | If you want the app to seed some example data set this to true -| MAIL_SERVER | String | N/A | The smtp server's ip-address/fqdn -| MAIL_PORT | String | N/A | The smtp server's port -| MAIL_USER | String | N/A | The username for sending mails -| MAIL_PASSWORD | String | N/A | The user's password for sending mails -| MAIL_FROM | String | N/A | The from-address for sending mails +| MAILER_URL | String(Url) | N/A | The mailer's base url (no trailing slash) +| MAILER_KEY | String | N/A | The mailer's api key. | IMPRINT_URL | String(Url) | /imprint | The link to a imprint page for the system (Defaults to the frontend's imprint) | PRIVACY_URL | String(Url) | /privacy | The link to a privacy page for the system (Defaults to the frontend's privacy page) From bf6b70106eb735d9ad6f6ad89f09194680af5ae1 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:32:06 +0100 Subject: [PATCH 23/28] Now generateing bs mailer config in test env ref #151 --- scripts/create_testenv.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/create_testenv.ts b/scripts/create_testenv.ts index 6fd3ae1..da08dea 100644 --- a/scripts/create_testenv.ts +++ b/scripts/create_testenv.ts @@ -12,7 +12,9 @@ DB_PASSWORD=bla DB_NAME=./test.sqlite NODE_ENV=dev POSTALCODE_COUNTRYCODE=DE -SEED_TEST_DATA=true`; +SEED_TEST_DATA=true +MAILER_URL=https://dev.lauf-fuer-kaya.de/mailer +MAILER_KEY=asdasd`; try { fs.writeFileSync("./.env", env, { encoding: "utf-8" }); From ae7d6176902699f82ea127194908ee360233e7b4 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:35:30 +0100 Subject: [PATCH 24/28] Updated auth reset test for new mailer ref #151 --- src/tests/auth/auth_reset.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/auth/auth_reset.spec.ts b/src/tests/auth/auth_reset.spec.ts index 498b66d..64aa790 100644 --- a/src/tests/auth/auth_reset.spec.ts +++ b/src/tests/auth/auth_reset.spec.ts @@ -35,10 +35,10 @@ beforeAll(async () => { describe('POST /api/auth/reset valid', () => { let reset_token; - it('valid reset token request should return 200', async () => { - const res1 = await axios.post(base + '/api/auth/reset', { email: "demo_reset1@dev.lauf-fuer-kaya.de" }); + it('valid reset token request should return 200 (500 w/o correct auth)', async () => { + const res1 = await axios.post(base + '/api/auth/reset', { email: "demo_reset1@dev.lauf-fuer-kaya.de" }, axios_config); reset_token = res1.data.resetToken; - expect(res1.status).toEqual(200); + expect(res1.status).toEqual(500); }); }); // --------------- From 82c65b632cdf44165b083494702b836c74e46a41 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:40:05 +0100 Subject: [PATCH 25/28] Added scans returns 200 test ref #151 --- src/tests/selfservice/selfservice_get.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tests/selfservice/selfservice_get.spec.ts b/src/tests/selfservice/selfservice_get.spec.ts index 5074e57..d8026d3 100644 --- a/src/tests/selfservice/selfservice_get.spec.ts +++ b/src/tests/selfservice/selfservice_get.spec.ts @@ -40,4 +40,9 @@ describe('register + get should return 200', () => { expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json"); }); + it('get scans with valid jwt should return 200', async () => { + const res = await axios.get(base + '/api/runners/me/' + added_runner.token + "/scans", axios_config); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json"); + }); }); \ No newline at end of file From f1d85cfb855c2aae581ade69751b3969ce38f020 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 17:03:41 +0100 Subject: [PATCH 26/28] =?UTF-8?q?=F0=9F=9A=80Bumped=20version=20to=20v0.4.?= =?UTF-8?q?7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 784d439..e39f07e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@odit/lfk-backend", - "version": "0.4.6", + "version": "0.4.7", "main": "src/app.ts", "repository": "https://git.odit.services/lfk/backend", "author": { @@ -102,4 +102,4 @@ "docs/*" ] } -} \ No newline at end of file +} From 3f2a2d292979c7f8162d92465b60b220f2634e7a Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 17:03:51 +0100 Subject: [PATCH 27/28] =?UTF-8?q?=F0=9F=9A=80Bumped=20version=20to=20v0.5.?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e39f07e..5f6a7d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@odit/lfk-backend", - "version": "0.4.7", + "version": "0.5.0", "main": "src/app.ts", "repository": "https://git.odit.services/lfk/backend", "author": { From 52728290b477d3f90ee7c14e0d438c4c74415322 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 4 Mar 2021 16:07:53 +0000 Subject: [PATCH 28/28] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eefeca7..e65ea03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,41 @@ All notable changes to this project will be documented in this file. Dates are displayed in UTC. +#### [v0.5.0](https://git.odit.services/lfk/backend/compare/v0.4.6...v0.5.0) + +- Removed mail templates [`c2fdfee`](https://git.odit.services/lfk/backend/commit/c2fdfeed4f5fc454b02bc4b198965889c173bbaa) +- Removed mail config [`0342757`](https://git.odit.services/lfk/backend/commit/0342757d929b12635c88e74f17495df656865b1a) +- Added selfservice scan response class [`6074ac5`](https://git.odit.services/lfk/backend/commit/6074ac5b3a8e43fd98394c1fb70c6e1dea8fcd5e) +- Removed old mailer code [`0fcc729`](https://git.odit.services/lfk/backend/commit/0fcc729b56430f0fdb56242857aa1d883d5a4866) +- Added the new mailer code [`1551a44`](https://git.odit.services/lfk/backend/commit/1551a444babc025cde6e894c66d2be2c84ab26da) +- Removed (now useless) mail controller [`485c247`](https://git.odit.services/lfk/backend/commit/485c247cd3305c4c4422d5582b1d61cc7af84989) +- Trackscans now have a laptime that get's calculated on creation [`aa83373`](https://git.odit.services/lfk/backend/commit/aa833736d32993b1656abeeb02a4f8b021ec6252) +- Removed useless functions and updated comments [`ada6798`](https://git.odit.services/lfk/backend/commit/ada679823cda8bc31d45c0ff6905f3d270cfd729) +- Added new selfservice scans endpoint [`771a205`](https://git.odit.services/lfk/backend/commit/771a205fe634fc5c07e794b3245c59483ff14bd8) +- Updated mail errors [`f289afd`](https://git.odit.services/lfk/backend/commit/f289afd8bc47f6eae9f12f765322b2db974ba918) +- Laptime is now a part of the response [`a2c97a1`](https://git.odit.services/lfk/backend/commit/a2c97a11a3dc82543076e3844f20d1218943bbf9) +- Updated readme env section [`db58a28`](https://git.odit.services/lfk/backend/commit/db58a280b3792b768eb2b1c82a76d9a9836978b1) +- Added locale to pw reset endpoint [`a5d2a6e`](https://git.odit.services/lfk/backend/commit/a5d2a6ecd31dc9c186d4201aef5c52e34cbef3b5) +- Now using mailer as static funtion [`9a1678a`](https://git.odit.services/lfk/backend/commit/9a1678acf0929dab9f84bd2c6a961b52e36172ce) +- Updated readme env section [`149f3a8`](https://git.odit.services/lfk/backend/commit/149f3a83b2e9d59bfbf36c7ea9e27bc7f514856d) +- Now checking for mails being set [`bb9bad6`](https://git.odit.services/lfk/backend/commit/bb9bad6d90370e768d4baffaae23ec756cc8353b) +- Updated auth reset test for new mailer [`ae7d617`](https://git.odit.services/lfk/backend/commit/ae7d6176902699f82ea127194908ee360233e7b4) +- Added scans returns 200 test [`82c65b6`](https://git.odit.services/lfk/backend/commit/82c65b632cdf44165b083494702b836c74e46a41) +- 🚀Bumped version to v0.4.7 [`f1d85cf`](https://git.odit.services/lfk/backend/commit/f1d85cfb855c2aae581ade69751b3969ce38f020) +- Added new mailer settings to config [`ddea02d`](https://git.odit.services/lfk/backend/commit/ddea02db574cc348685558f3fa3ecc84adbd6b65) +- 🧾New changelog file version [CI SKIP] [skip ci] [`be397c8`](https://git.odit.services/lfk/backend/commit/be397c8899d5b4406c17e8f9951555c54f852901) +- 🚀Bumped version to v0.5.0 [`3f2a2d2`](https://git.odit.services/lfk/backend/commit/3f2a2d292979c7f8162d92465b60b220f2634e7a) +- Merge pull request 'Features for the new selfservice feature/151-selfservice_scans_mails' (#152) from feature/151-selfservice_scans_mails into dev [`15356c1`](https://git.odit.services/lfk/backend/commit/15356c1030988d03e3739f3ffe770669789759f2) +- Now generateing bs mailer config in test env [`bf6b701`](https://git.odit.services/lfk/backend/commit/bf6b70106eb735d9ad6f6ad89f09194680af5ae1) +- Promoted axios to dependency [`a9e06c9`](https://git.odit.services/lfk/backend/commit/a9e06c905537b6da24706389e304e825a33a28ad) +- Removed nodemailer from backend [`5833f42`](https://git.odit.services/lfk/backend/commit/5833f4218f9a4c97b69021814df92470a1816917) +- Added another resonse type [`030b225`](https://git.odit.services/lfk/backend/commit/030b2255d42aab21d8974fc3a7235285934d53b7) +- Added new selfservice response type [`f7f6df4`](https://git.odit.services/lfk/backend/commit/f7f6df41ff74708482db3ea2db717ffb562131c0) + #### [v0.4.6](https://git.odit.services/lfk/backend/compare/v0.4.5...v0.4.6) +> 26 February 2021 + - Merge pull request 'Alpha Release 0.4.6' (#148) from dev into main [`dd3c927`](https://git.odit.services/lfk/backend/commit/dd3c9275d60cb5bb1a40fbe91f666f17a8e0c8d3) - Added tests for the new org selfservice endpoints [`28ef139`](https://git.odit.services/lfk/backend/commit/28ef139a70e0c063982b2eb9167b7abe41db1621) - Added selfservice org response model [`ba3b5ee`](https://git.odit.services/lfk/backend/commit/ba3b5eeefc45f9bd94aef24f9f509f6835f5ea7c)