新需求更新 同步更新

This commit is contained in:
supernijia
2026-08-06 01:11:54 +08:00
parent 28423e015b
commit 40f4fae272
112 changed files with 7739 additions and 637 deletions
@@ -0,0 +1,27 @@
package com.nanri.aiimage.modules.auth.util;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
class WerkzeugPasswordEncoderTest {
private final WerkzeugPasswordEncoder encoder = new WerkzeugPasswordEncoder();
@Test
void matchesWerkzeugScryptHash() {
String hash = "scrypt:32768:8:1$VEWwSnHkAFcK3B3E$2065ba2db25c34072bf4d7ae9bd47b8c483289fafc3f5e98ae49bb232d30bf989b21ae0e9f14adc6e893e34a81543cf58641731431961ed9ab353bcebec2e78a";
assertTrue(encoder.matches("test-password", hash));
assertFalse(encoder.matches("wrong-password", hash));
}
@Test
void matchesGeneratedPbkdf2Hash() {
String hash = encoder.hash("test-password");
assertTrue(encoder.matches("test-password", hash));
assertFalse(encoder.matches("wrong-password", hash));
}
}