Operators can fix prod admin passwords without email via Byt lösenord; end users can use forgot-password when SMTP is configured. Local and CI use Mailpit to capture outbound mail and verify reset links end-to-end. - Backend: V8 password_reset_tokens, PasswordResetService, EmailService, POST /api/auth/forgot-password, reset-password, change-password - Optional testToken in forgot-password response (docker profile only, for E2E) - Frontend: ForgotPasswordPage, ResetPasswordPage, ChangePasswordPage, routes, login link, header Byt lösenord - Mailpit (ghcr.io/axllent/mailpit:v1.28) in docker-compose + e2e stack - E2E: password-reset.spec.ts + Mailpit API helper tests SMTP delivery - Separate dev/e2e Docker image names to avoid overwriting bilhej-frontend - Docs: README email section, production-email-checklist, .env.example - Unit/integration tests for reset, change password, and Vitest page specs Co-authored-by: Cursor <cursoragent@cursor.com>
93 lines
2.6 KiB
Groovy
93 lines
2.6 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'jacoco'
|
|
id 'org.springframework.boot' version '4.0.6'
|
|
id 'io.spring.dependency-management' version '1.1.7'
|
|
}
|
|
|
|
group = 'se.bilhalsning'
|
|
version = '0.0.1-SNAPSHOT'
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
|
implementation 'org.springframework.boot:spring-boot-starter-flyway'
|
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
|
implementation 'org.springframework.boot:spring-boot-starter-mail'
|
|
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
|
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
|
|
implementation 'org.flywaydb:flyway-database-postgresql'
|
|
implementation 'org.jsoup:jsoup:1.18.1'
|
|
implementation 'io.jsonwebtoken:jjwt-api:0.12.6'
|
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
|
compileOnly 'org.projectlombok:lombok'
|
|
runtimeOnly 'com.h2database:h2'
|
|
runtimeOnly 'org.postgresql:postgresql'
|
|
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6'
|
|
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.6'
|
|
annotationProcessor 'org.projectlombok:lombok'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-flyway-test'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-security-test'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-validation-test'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
|
|
testCompileOnly 'org.projectlombok:lombok'
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
testAnnotationProcessor 'org.projectlombok:lombok'
|
|
}
|
|
|
|
tasks.named('test') {
|
|
useJUnitPlatform()
|
|
finalizedBy jacocoTestReport
|
|
}
|
|
|
|
jacoco {
|
|
toolVersion = "0.8.12"
|
|
}
|
|
|
|
jacocoTestReport {
|
|
dependsOn test
|
|
reports {
|
|
xml.required = true
|
|
csv.required = false
|
|
html.required = true
|
|
}
|
|
}
|
|
|
|
jacocoTestCoverageVerification {
|
|
dependsOn jacocoTestReport
|
|
violationRules {
|
|
rule {
|
|
limit {
|
|
minimum = 0.70
|
|
}
|
|
}
|
|
rule {
|
|
limit {
|
|
counter = 'BRANCH'
|
|
minimum = 0.60
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.named('check').configure {
|
|
dependsOn jacocoTestCoverageVerification
|
|
}
|
|
|
|
tasks.register('hashPassword', JavaExec) {
|
|
group = 'utility'
|
|
description = 'Print BCrypt hash for a password (strength 12). Usage: -Ppassword=secret'
|
|
classpath = sourceSets.test.runtimeClasspath
|
|
mainClass = 'se.bilhalsning.tools.BcryptHashCli'
|
|
args = project.findProperty('password') ? [project.property('password')] : []
|
|
}
|