feat: extend enterprise gateway policies billing protocols and operations

This commit is contained in:
wlx committed 2026-10-13 19:08:50 +08:00
1 parent 1528b71882
commit af43947b5d
67 files changed
+1822 -69

No files matched your search

@@ -51,6 +51,7 @@ class AuthPostgresTest {
context.registerBean(DataSource.class, () -> source);
context.registerBean(DataSourceTransactionManager.class, () -> new DataSourceTransactionManager(source));
context.registerBean(AuthService.class, () -> new AuthService(jdbc, hasher, json, 168));
context.registerBean(TotpService.class, () -> new TotpService(jdbc,new com.moyi.controlplane.security.SecretCipher("test-mfa")));
context.refresh();
AuthService auth = context.getBean(AuthService.class);
try (var threads = Executors.newFixedThreadPool(2)) {
@@ -0,0 +1,13 @@
package com.moyi.controlplane.auth;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import java.nio.charset.StandardCharsets;
class TotpServiceTest {
@Test void rfc6238Sha1VectorsTruncatedToSixDigits() {
String secret=TotpService.base32("12345678901234567890".getBytes(StandardCharsets.US_ASCII));
assertEquals("287082",TotpService.totp(secret,59/30));
assertEquals("081804",TotpService.totp(secret,1111111109L/30));
assertEquals("050471",TotpService.totp(secret,1111111111L/30));
assertEquals("353130",TotpService.totp(secret,20000000000L/30));
}
}