fix
This commit is contained in:
parent
ae72769741
commit
10d3438252
@ -29,6 +29,7 @@ import java.util.zip.ZipFile;
|
|||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
import java.util.zip.ZipOutputStream;
|
import java.util.zip.ZipOutputStream;
|
||||||
import org.bouncycastle.crypto.digests.SM3Digest;
|
import org.bouncycastle.crypto.digests.SM3Digest;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -40,6 +41,7 @@ public class ResourcePackageServiceImpl implements ResourcePackageService {
|
|||||||
private final MqReplayContextBuilder mqReplayContextBuilder;
|
private final MqReplayContextBuilder mqReplayContextBuilder;
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
public ResourcePackageServiceImpl(
|
public ResourcePackageServiceImpl(
|
||||||
ResourceBackupProperties resourceBackupProperties,
|
ResourceBackupProperties resourceBackupProperties,
|
||||||
ResourceEnvelopeCryptoService resourceEnvelopeCryptoService,
|
ResourceEnvelopeCryptoService resourceEnvelopeCryptoService,
|
||||||
|
|||||||
@ -221,9 +221,9 @@ tms:
|
|||||||
internal-token: ${TMS_INTERNAL_TOKEN:change-me-internal-token}
|
internal-token: ${TMS_INTERNAL_TOKEN:change-me-internal-token}
|
||||||
internal-auth:
|
internal-auth:
|
||||||
# 是否启用 /api/** 的内部登录鉴权;开发联调时可临时关闭。
|
# 是否启用 /api/** 的内部登录鉴权;开发联调时可临时关闭。
|
||||||
enabled: ${TMS_SECURITY_INTERNAL_AUTH_ENABLED:true}
|
enabled: ${TMS_SECURITY_INTERNAL_AUTH_ENABLED:false}
|
||||||
# 关闭内部鉴权后,注入请求上下文的调试角色。
|
# 关闭内部鉴权后,注入请求上下文的调试角色。
|
||||||
debug-role-code: ${TMS_SECURITY_INTERNAL_AUTH_DEBUG_ROLE_CODE:SUPER_ADMIN}
|
debug-role-code: ${TMS_SECURITY_INTERNAL_AUTH_DEBUG_ROLE_CODE:OPS_ADMIN}
|
||||||
# 关闭内部鉴权后,注入请求上下文的调试认证等级。
|
# 关闭内部鉴权后,注入请求上下文的调试认证等级。
|
||||||
debug-auth-level: ${TMS_SECURITY_INTERNAL_AUTH_DEBUG_AUTH_LEVEL:FULL}
|
debug-auth-level: ${TMS_SECURITY_INTERNAL_AUTH_DEBUG_AUTH_LEVEL:FULL}
|
||||||
# 关闭内部鉴权后,注入请求上下文的调试 session token。
|
# 关闭内部鉴权后,注入请求上下文的调试 session token。
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import java.nio.file.Path;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
@ -26,6 +27,15 @@ class ResourcePackageServiceTest {
|
|||||||
@TempDir
|
@TempDir
|
||||||
Path tempDir;
|
Path tempDir;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldDeclareSpringInjectionConstructorWhenMultipleConstructorsExist() {
|
||||||
|
long autowiredConstructors = java.util.Arrays.stream(ResourcePackageServiceImpl.class.getConstructors())
|
||||||
|
.filter(constructor -> constructor.isAnnotationPresent(Autowired.class))
|
||||||
|
.count();
|
||||||
|
|
||||||
|
Assertions.assertEquals(1, autowiredConstructors);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldWriteManifestEnvelopeAndCiphertextIntoBackupPackage() throws Exception {
|
void shouldWriteManifestEnvelopeAndCiphertextIntoBackupPackage() throws Exception {
|
||||||
ResourceBackupProperties properties = new ResourceBackupProperties();
|
ResourceBackupProperties properties = new ResourceBackupProperties();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user