Replace the header "Byt lösenord" link with an Inställningar menu for changing email or password. Email changes are two-step: request with password, confirmation link to the new address, then password again on confirm so a wrong inbox cannot take over the account. - Backend: EmailChangeService, V10 email_change_tokens, confirm API - Frontend: ChangeEmailPage, ConfirmEmailChangePage, header dropdown - E2E: account-settings round-trips, Mailpit verification, wrong-password guard - Flyway: V9 restore for dev DBs, CI migration checks, V10 for email tokens Co-authored-by: Cursor <cursoragent@cursor.com>
100 lines
2.8 KiB
Groovy
100 lines
2.8 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.register('flywayMigrationCheck', Exec) {
|
|
group = 'verification'
|
|
description = 'Ensure Flyway migrations are unique, immutable, and use new version numbers'
|
|
workingDir = rootProject.projectDir
|
|
commandLine 'bash', 'scripts/check-flyway-migrations.sh'
|
|
}
|
|
|
|
tasks.named('check').configure {
|
|
dependsOn jacocoTestCoverageVerification, flywayMigrationCheck
|
|
}
|
|
|
|
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')] : []
|
|
}
|