mirror of
https://github.com/valitydev/file-storage.git
synced 2024-11-06 00:35:22 +00:00
migrate on dev.vality
This commit is contained in:
parent
efde7f746f
commit
10bfb3d132
6
.codecov.yml
Normal file
6
.codecov.yml
Normal file
@ -0,0 +1,6 @@
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
target: auto
|
||||
threshold: 1%
|
2
.github/settings.yml
vendored
Normal file
2
.github/settings.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
|
||||
_extends: .github
|
10
.github/workflows/basic-linters.yml
vendored
Normal file
10
.github/workflows/basic-linters.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
name: Vality basic linters
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
uses: valitydev/base-workflows/.github/workflows/basic-linters.yml@v1
|
10
.github/workflows/build.yml
vendored
Normal file
10
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
name: Maven Build Artifact
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: valitydev/java-workflow/.github/workflows/maven-service-build.yml@v1
|
18
.github/workflows/deploy.yml
vendored
Normal file
18
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: Maven Deploy Artifact
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'main'
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
uses: valitydev/java-workflow/.github/workflows/maven-service-deploy.yml@v1
|
||||
secrets:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
mm-webhook-url: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -1,4 +0,0 @@
|
||||
[submodule "build_utils"]
|
||||
path = build_utils
|
||||
url = git@github.com:rbkmoney/build_utils.git
|
||||
branch = master
|
1
CODEOWNERS
Normal file
1
CODEOWNERS
Normal file
@ -0,0 +1 @@
|
||||
* @valitydev/java
|
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@ -1,16 +0,0 @@
|
||||
#!groovy
|
||||
build('file-storage', 'java-maven') {
|
||||
checkoutRepo()
|
||||
loadBuildUtils()
|
||||
|
||||
def javaServicePipeline
|
||||
runStage('load JavaService pipeline') {
|
||||
javaServicePipeline = load("build_utils/jenkins_lib/pipeJavaService.groovy")
|
||||
}
|
||||
|
||||
def serviceName = env.REPO_NAME
|
||||
def mvnArgs = '-DjvmArgs="-Xmx256m"'
|
||||
def useJava11 = true
|
||||
|
||||
javaServicePipeline(serviceName, useJava11, mvnArgs)
|
||||
}
|
@ -1 +0,0 @@
|
||||
Subproject commit 29cb2775d05d9c18c3aa74a629459cde84a2d42e
|
@ -1,37 +0,0 @@
|
||||
version: '2.3'
|
||||
services:
|
||||
file-storage:
|
||||
build: target/
|
||||
image: file-storage:1.0.0-SNAPSHOT
|
||||
ports:
|
||||
- "8022:8022"
|
||||
depends_on:
|
||||
- ceph
|
||||
networks:
|
||||
- fsnet
|
||||
environment:
|
||||
SERVICE_NAME: "file-storage"
|
||||
storage.endpoint: "ceph:80"
|
||||
storage.signingRegion: "RU"
|
||||
storage.accessKey: "test"
|
||||
storage.secretKey: "test"
|
||||
storage.clientProtocol: "HTTP"
|
||||
storage.clientMaxErrorRetry: "10"
|
||||
storage.bucketName: "test"
|
||||
|
||||
ceph:
|
||||
image: 'dr.rbkmoney.com/ceph-demo:latest'
|
||||
ports:
|
||||
- "32827:80"
|
||||
networks:
|
||||
- fsnet
|
||||
environment:
|
||||
- RGW_NAME=localhost
|
||||
- NETWORK_AUTO_DETECT=4
|
||||
- CEPH_DEMO_UID=ceph-test
|
||||
- CEPH_DEMO_ACCESS_KEY=test
|
||||
- CEPH_DEMO_SECRET_KEY=test
|
||||
- CEPH_DEMO_BUCKET=TEST
|
||||
|
||||
networks:
|
||||
fsnet:
|
74
pom.xml
74
pom.xml
@ -4,17 +4,17 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<groupId>dev.vality</groupId>
|
||||
<artifactId>service-parent-pom</artifactId>
|
||||
<version>1.2.13</version>
|
||||
<version>1.0.16</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>file-storage</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>file-storage</name>
|
||||
<description>Service for uploading & downloading files</description>
|
||||
<description>Service for uploading and downloading files</description>
|
||||
|
||||
<properties>
|
||||
<server.port>8022</server.port>
|
||||
@ -26,36 +26,32 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- rbkmoney -->
|
||||
<!-- dev.vality -->
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<groupId>dev.vality</groupId>
|
||||
<artifactId>file-storage-proto</artifactId>
|
||||
<version>1.31-d1055d3</version>
|
||||
<version>1.33-86bcf44</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney.woody</groupId>
|
||||
<groupId>dev.vality.woody</groupId>
|
||||
<artifactId>woody-thrift</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney.geck</groupId>
|
||||
<groupId>dev.vality.geck</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney.geck</groupId>
|
||||
<groupId>dev.vality.geck</groupId>
|
||||
<artifactId>serializer</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<groupId>dev.vality.geck</groupId>
|
||||
<artifactId>filter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.vality</groupId>
|
||||
<artifactId>shared-resources</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<artifactId>custom-metrics-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<artifactId>custom-actuator-endpoints</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring libs -->
|
||||
<dependency>
|
||||
@ -86,7 +82,7 @@
|
||||
<dependency>
|
||||
<groupId>com.amazonaws</groupId>
|
||||
<artifactId>aws-java-sdk-s3</artifactId>
|
||||
<version>1.11.587</version>
|
||||
<version>1.12.213</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
@ -96,7 +92,15 @@
|
||||
<dependency>
|
||||
<groupId>software.amazon.awssdk</groupId>
|
||||
<artifactId>s3</artifactId>
|
||||
<version>2.17.56</version>
|
||||
<version>2.17.181</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test libs -->
|
||||
@ -104,17 +108,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<groupId>dev.vality</groupId>
|
||||
<artifactId>testcontainers-annotations</artifactId>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@ -148,12 +146,24 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<configuration>
|
||||
<nonFilteredFileExtensions>
|
||||
<nonFilteredFileExtension>p12</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-remote-resources-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
@ -163,7 +173,7 @@
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<resourceBundles>
|
||||
<resourceBundle>com.rbkmoney:shared-resources:${shared-resources.version}</resourceBundle>
|
||||
<resourceBundle>dev.vality:shared-resources:${shared-resources.version}</resourceBundle>
|
||||
</resourceBundles>
|
||||
<attachToMain>false</attachToMain>
|
||||
<attachToTest>false</attachToTest>
|
||||
|
6
renovate.json
Normal file
6
renovate.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"local>valitydev/.github:renovate-config"
|
||||
]
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
package com.rbkmoney.file.storage;
|
||||
package dev.vality.file.storage;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
|
||||
@ServletComponentScan
|
||||
@SpringBootApplication(scanBasePackages = {"com.rbkmoney.file.storage"})
|
||||
@SpringBootApplication(scanBasePackages = {"dev.vality.file.storage"})
|
||||
public class FileStorageApplication {
|
||||
|
||||
public static void main(String[] args) {
|
@ -1,4 +1,4 @@
|
||||
package com.rbkmoney.file.storage.configuration;
|
||||
package dev.vality.file.storage.configuration;
|
||||
|
||||
import com.amazonaws.ClientConfiguration;
|
||||
import com.amazonaws.auth.AWSCredentialsProviderChain;
|
||||
@ -10,7 +10,7 @@ import com.amazonaws.services.s3.AmazonS3;
|
||||
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
|
||||
import com.amazonaws.services.s3.transfer.TransferManager;
|
||||
import com.amazonaws.services.s3.transfer.TransferManagerBuilder;
|
||||
import com.rbkmoney.file.storage.configuration.properties.S3Properties;
|
||||
import dev.vality.file.storage.configuration.properties.S3Properties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
@ -1,6 +1,6 @@
|
||||
package com.rbkmoney.file.storage.configuration;
|
||||
package dev.vality.file.storage.configuration;
|
||||
|
||||
import com.rbkmoney.file.storage.configuration.properties.S3SdkV2Properties;
|
||||
import dev.vality.file.storage.configuration.properties.S3SdkV2Properties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
@ -1,4 +1,4 @@
|
||||
package com.rbkmoney.file.storage.configuration.properties;
|
||||
package dev.vality.file.storage.configuration.properties;
|
||||
|
||||
import com.amazonaws.Protocol;
|
||||
import lombok.Getter;
|
@ -1,4 +1,4 @@
|
||||
package com.rbkmoney.file.storage.configuration.properties;
|
||||
package dev.vality.file.storage.configuration.properties;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
@ -1,16 +1,17 @@
|
||||
package com.rbkmoney.file.storage.handler;
|
||||
package dev.vality.file.storage.handler;
|
||||
|
||||
import com.rbkmoney.file.storage.FileData;
|
||||
import com.rbkmoney.file.storage.FileNotFound;
|
||||
import com.rbkmoney.file.storage.FileStorageSrv;
|
||||
import com.rbkmoney.file.storage.NewFileResult;
|
||||
import com.rbkmoney.file.storage.msgpack.Value;
|
||||
import com.rbkmoney.file.storage.service.StorageService;
|
||||
import com.rbkmoney.file.storage.service.exception.FileNotFoundException;
|
||||
import com.rbkmoney.file.storage.service.exception.StorageException;
|
||||
import com.rbkmoney.geck.common.util.TypeUtil;
|
||||
import com.rbkmoney.woody.api.flow.error.WUnavailableResultException;
|
||||
import com.rbkmoney.woody.api.flow.error.WUndefinedResultException;
|
||||
import dev.vality.file.storage.FileData;
|
||||
import dev.vality.file.storage.FileNotFound;
|
||||
import dev.vality.file.storage.FileStorageSrv;
|
||||
import dev.vality.file.storage.NewFileResult;
|
||||
import dev.vality.file.storage.msgpack.Value;
|
||||
import dev.vality.file.storage.service.StorageService;
|
||||
import dev.vality.file.storage.service.exception.FileNotFoundException;
|
||||
import dev.vality.file.storage.service.exception.StorageException;
|
||||
import dev.vality.file.storage.util.CheckerUtil;
|
||||
import dev.vality.geck.common.util.TypeUtil;
|
||||
import dev.vality.woody.api.flow.error.WUnavailableResultException;
|
||||
import dev.vality.woody.api.flow.error.WUndefinedResultException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.thrift.TException;
|
||||
@ -20,8 +21,6 @@ import java.net.URL;
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.rbkmoney.file.storage.util.CheckerUtil.checkString;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@ -44,8 +43,8 @@ public class FileStorageHandler implements FileStorageSrv.Iface {
|
||||
@Override
|
||||
public String generateDownloadUrl(String fileDataId, String expiresAt) throws TException {
|
||||
try {
|
||||
checkString(fileDataId, "Bad request parameter, fileDataId required and not empty arg");
|
||||
checkString(expiresAt, "Bad request parameter, expiresAt required and not empty arg");
|
||||
CheckerUtil.checkString(fileDataId, "Bad request parameter, fileDataId required and not empty arg");
|
||||
CheckerUtil.checkString(expiresAt, "Bad request parameter, expiresAt required and not empty arg");
|
||||
Instant instant = TypeUtil.stringToInstant(expiresAt);
|
||||
URL url = storageService.generateDownloadUrl(fileDataId, instant);
|
||||
return url.toString();
|
||||
@ -61,7 +60,7 @@ public class FileStorageHandler implements FileStorageSrv.Iface {
|
||||
@Override
|
||||
public FileData getFileData(String fileDataId) throws TException {
|
||||
try {
|
||||
checkString(fileDataId, "Bad request parameter, fileDataId required and not empty arg");
|
||||
CheckerUtil.checkString(fileDataId, "Bad request parameter, fileDataId required and not empty arg");
|
||||
return storageService.getFileData(fileDataId);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw fileNotFound(e);
|
@ -1,4 +1,4 @@
|
||||
package com.rbkmoney.file.storage.service;
|
||||
package dev.vality.file.storage.service;
|
||||
|
||||
import com.amazonaws.HttpMethod;
|
||||
import com.amazonaws.SdkBaseException;
|
||||
@ -6,15 +6,15 @@ import com.amazonaws.services.s3.AmazonS3;
|
||||
import com.amazonaws.services.s3.model.*;
|
||||
import com.amazonaws.services.s3.transfer.TransferManager;
|
||||
import com.amazonaws.services.s3.transfer.Upload;
|
||||
import com.rbkmoney.file.storage.FileData;
|
||||
import com.rbkmoney.file.storage.NewFileResult;
|
||||
import com.rbkmoney.file.storage.configuration.properties.S3Properties;
|
||||
import com.rbkmoney.file.storage.msgpack.Value;
|
||||
import com.rbkmoney.file.storage.service.exception.ExtractMetadataException;
|
||||
import com.rbkmoney.file.storage.service.exception.FileNotFoundException;
|
||||
import com.rbkmoney.file.storage.service.exception.StorageException;
|
||||
import com.rbkmoney.file.storage.service.exception.WaitingUploadException;
|
||||
import com.rbkmoney.file.storage.util.DamselUtil;
|
||||
import dev.vality.file.storage.FileData;
|
||||
import dev.vality.file.storage.NewFileResult;
|
||||
import dev.vality.file.storage.configuration.properties.S3Properties;
|
||||
import dev.vality.file.storage.msgpack.Value;
|
||||
import dev.vality.file.storage.service.exception.ExtractMetadataException;
|
||||
import dev.vality.file.storage.service.exception.FileNotFoundException;
|
||||
import dev.vality.file.storage.service.exception.StorageException;
|
||||
import dev.vality.file.storage.service.exception.WaitingUploadException;
|
||||
import dev.vality.file.storage.util.DamselUtil;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.ToString;
|
@ -1,12 +1,12 @@
|
||||
package com.rbkmoney.file.storage.service;
|
||||
package dev.vality.file.storage.service;
|
||||
|
||||
import com.rbkmoney.file.storage.FileData;
|
||||
import com.rbkmoney.file.storage.NewFileResult;
|
||||
import com.rbkmoney.file.storage.configuration.properties.S3SdkV2Properties;
|
||||
import com.rbkmoney.file.storage.msgpack.Value;
|
||||
import com.rbkmoney.file.storage.service.exception.FileNotFoundException;
|
||||
import com.rbkmoney.file.storage.service.exception.StorageException;
|
||||
import com.rbkmoney.file.storage.util.DamselUtil;
|
||||
import dev.vality.file.storage.FileData;
|
||||
import dev.vality.file.storage.NewFileResult;
|
||||
import dev.vality.file.storage.configuration.properties.S3SdkV2Properties;
|
||||
import dev.vality.file.storage.msgpack.Value;
|
||||
import dev.vality.file.storage.service.exception.FileNotFoundException;
|
||||
import dev.vality.file.storage.service.exception.StorageException;
|
||||
import dev.vality.file.storage.util.DamselUtil;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.ToString;
|
@ -1,8 +1,8 @@
|
||||
package com.rbkmoney.file.storage.service;
|
||||
package dev.vality.file.storage.service;
|
||||
|
||||
import com.rbkmoney.file.storage.FileData;
|
||||
import com.rbkmoney.file.storage.NewFileResult;
|
||||
import com.rbkmoney.file.storage.msgpack.Value;
|
||||
import dev.vality.file.storage.FileData;
|
||||
import dev.vality.file.storage.NewFileResult;
|
||||
import dev.vality.file.storage.msgpack.Value;
|
||||
|
||||
import java.net.URL;
|
||||
import java.time.Instant;
|
@ -1,4 +1,4 @@
|
||||
package com.rbkmoney.file.storage.service.exception;
|
||||
package dev.vality.file.storage.service.exception;
|
||||
|
||||
public class ExtractMetadataException extends StorageException {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.rbkmoney.file.storage.service.exception;
|
||||
package dev.vality.file.storage.service.exception;
|
||||
|
||||
public class FileNotFoundException extends StorageException {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.rbkmoney.file.storage.service.exception;
|
||||
package dev.vality.file.storage.service.exception;
|
||||
|
||||
public class StorageException extends RuntimeException {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.rbkmoney.file.storage.service.exception;
|
||||
package dev.vality.file.storage.service.exception;
|
||||
|
||||
public class WaitingUploadException extends StorageException {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.rbkmoney.file.storage.servlet;
|
||||
package dev.vality.file.storage.servlet;
|
||||
|
||||
import com.rbkmoney.file.storage.FileStorageSrv;
|
||||
import com.rbkmoney.woody.thrift.impl.http.THServiceBuilder;
|
||||
import dev.vality.file.storage.FileStorageSrv;
|
||||
import dev.vality.woody.thrift.impl.http.THServiceBuilder;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.servlet.*;
|
@ -1,4 +1,4 @@
|
||||
package com.rbkmoney.file.storage.util;
|
||||
package dev.vality.file.storage.util;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.rbkmoney.file.storage.util;
|
||||
package dev.vality.file.storage.util;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.rbkmoney.geck.serializer.kit.json.JsonHandler;
|
||||
import com.rbkmoney.geck.serializer.kit.json.JsonProcessor;
|
||||
import com.rbkmoney.geck.serializer.kit.tbase.TBaseHandler;
|
||||
import com.rbkmoney.geck.serializer.kit.tbase.TBaseProcessor;
|
||||
import dev.vality.geck.serializer.kit.json.JsonHandler;
|
||||
import dev.vality.geck.serializer.kit.json.JsonProcessor;
|
||||
import dev.vality.geck.serializer.kit.tbase.TBaseHandler;
|
||||
import dev.vality.geck.serializer.kit.tbase.TBaseProcessor;
|
||||
import org.apache.thrift.TBase;
|
||||
|
||||
import java.io.IOException;
|
@ -1,24 +1,23 @@
|
||||
info:
|
||||
version: @project.version@
|
||||
version: '@project.version@'
|
||||
stage: dev
|
||||
|
||||
server:
|
||||
port: @server.port@
|
||||
port: '@server.port@'
|
||||
|
||||
management:
|
||||
security:
|
||||
flag: false
|
||||
server:
|
||||
port: @management.port@
|
||||
port: '@management.port@'
|
||||
metrics:
|
||||
export:
|
||||
statsd:
|
||||
flavor: etsy
|
||||
enabled: false
|
||||
prometheus:
|
||||
enabled: false
|
||||
tags:
|
||||
application: '@project.name@'
|
||||
endpoint:
|
||||
health:
|
||||
probes:
|
||||
enabled: true
|
||||
show-details: always
|
||||
metrics:
|
||||
enabled: true
|
||||
@ -31,7 +30,7 @@ management:
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: @project.name@
|
||||
name: '@project.name@'
|
||||
output:
|
||||
ansi:
|
||||
enabled: always
|
||||
|
@ -1,10 +0,0 @@
|
||||
package com.rbkmoney.file.storage.awssdks3v2;
|
||||
|
||||
import com.rbkmoney.file.storage.FileStorageTest;
|
||||
import com.rbkmoney.testcontainers.annotations.minio.MinioTestcontainerSingleton;
|
||||
|
||||
@MinioTestcontainerSingleton(
|
||||
properties = "s3-sdk-v2.enabled=true",
|
||||
bucketName = "awssdks3v2")
|
||||
public class WithMinio extends FileStorageTest {
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package com.rbkmoney.file.storage.s3signer;
|
||||
|
||||
import com.rbkmoney.file.storage.FileStorageTest;
|
||||
import com.rbkmoney.testcontainers.annotations.ceph.CephTestcontainerSingleton;
|
||||
|
||||
@CephTestcontainerSingleton(bucketName = "s3signer")
|
||||
public class WithCeph extends FileStorageTest {
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package com.rbkmoney.file.storage.s3signer;
|
||||
|
||||
import com.rbkmoney.file.storage.FileStorageTest;
|
||||
import com.rbkmoney.testcontainers.annotations.minio.MinioTestcontainerSingleton;
|
||||
|
||||
@MinioTestcontainerSingleton(bucketName = "s3signer")
|
||||
public class WithMinio extends FileStorageTest {
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
package com.rbkmoney.file.storage;
|
||||
package dev.vality.file.storage;
|
||||
|
||||
import com.amazonaws.SdkClientException;
|
||||
import com.amazonaws.services.s3.AmazonS3;
|
||||
import com.amazonaws.services.s3.transfer.TransferManager;
|
||||
import com.rbkmoney.woody.api.flow.error.WRuntimeException;
|
||||
import com.rbkmoney.woody.thrift.impl.http.THSpawnClientBuilder;
|
||||
import dev.vality.woody.api.flow.error.WRuntimeException;
|
||||
import dev.vality.woody.thrift.impl.http.THSpawnClientBuilder;
|
||||
import org.apache.thrift.TException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
@ -1,6 +1,6 @@
|
||||
package com.rbkmoney.file.storage;
|
||||
package dev.vality.file.storage;
|
||||
|
||||
import com.rbkmoney.woody.thrift.impl.http.THSpawnClientBuilder;
|
||||
import dev.vality.woody.thrift.impl.http.THSpawnClientBuilder;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
@ -30,8 +30,8 @@ import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import static com.rbkmoney.file.storage.msgpack.Value.*;
|
||||
import static com.rbkmoney.testcontainers.annotations.util.ValuesGenerator.*;
|
||||
import static dev.vality.file.storage.msgpack.Value.*;
|
||||
import static dev.vality.testcontainers.annotations.util.ValuesGenerator.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@ -59,9 +59,9 @@ public abstract class FileStorageTest {
|
||||
@Test
|
||||
public void fileUploadWithHttpClientBuilderTest() throws IOException, URISyntaxException, TException {
|
||||
String expirationTime = generateCurrentTimePlusDay().toString();
|
||||
Map<String, com.rbkmoney.file.storage.msgpack.Value> metadata = new HashMap<>();
|
||||
metadata.put("author", com.rbkmoney.file.storage.msgpack.Value.str("Mary Doe"));
|
||||
metadata.put("version", com.rbkmoney.file.storage.msgpack.Value.str("1.0.0.0"));
|
||||
Map<String, dev.vality.file.storage.msgpack.Value> metadata = new HashMap<>();
|
||||
metadata.put("author", dev.vality.file.storage.msgpack.Value.str("Mary Doe"));
|
||||
metadata.put("version", dev.vality.file.storage.msgpack.Value.str("1.0.0.0"));
|
||||
|
||||
NewFileResult fileResult = fileStorageClient.createNewFile(metadata, expirationTime);
|
||||
|
||||
@ -94,9 +94,9 @@ public abstract class FileStorageTest {
|
||||
try {
|
||||
// создание нового файла
|
||||
String expirationTime = generateCurrentTimePlusDay().toString();
|
||||
Map<String, com.rbkmoney.file.storage.msgpack.Value> metadata = new HashMap<>();
|
||||
metadata.put("author", com.rbkmoney.file.storage.msgpack.Value.str("Mary Doe"));
|
||||
metadata.put("version", com.rbkmoney.file.storage.msgpack.Value.str("1.0.0.0"));
|
||||
Map<String, dev.vality.file.storage.msgpack.Value> metadata = new HashMap<>();
|
||||
metadata.put("author", dev.vality.file.storage.msgpack.Value.str("Mary Doe"));
|
||||
metadata.put("version", dev.vality.file.storage.msgpack.Value.str("1.0.0.0"));
|
||||
NewFileResult fileResult = fileStorageClient.createNewFile(metadata, expirationTime);
|
||||
uploadTestData(fileResult, FILE_NAME, FILE_DATA);
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.rbkmoney.file.storage.awssdks3v2;
|
||||
package dev.vality.file.storage.awssdks3v2;
|
||||
|
||||
import com.rbkmoney.file.storage.FileStorageTest;
|
||||
import com.rbkmoney.testcontainers.annotations.ceph.CephTestcontainerSingleton;
|
||||
import dev.vality.file.storage.FileStorageTest;
|
||||
import dev.vality.testcontainers.annotations.ceph.CephTestcontainerSingleton;
|
||||
|
||||
@CephTestcontainerSingleton(
|
||||
properties = {"s3-sdk-v2.enabled=true", "s3-sdk-v2.region=us-east-1"},
|
@ -0,0 +1,10 @@
|
||||
package dev.vality.file.storage.awssdks3v2;
|
||||
|
||||
import dev.vality.file.storage.FileStorageTest;
|
||||
import dev.vality.testcontainers.annotations.minio.MinioTestcontainerSingleton;
|
||||
|
||||
@MinioTestcontainerSingleton(
|
||||
properties = "s3-sdk-v2.enabled=true",
|
||||
bucketName = "awssdks3v2")
|
||||
public class WithMinio extends FileStorageTest {
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package dev.vality.file.storage.s3signer;
|
||||
|
||||
import dev.vality.file.storage.FileStorageTest;
|
||||
import dev.vality.testcontainers.annotations.ceph.CephTestcontainerSingleton;
|
||||
|
||||
@CephTestcontainerSingleton(bucketName = "s3signer")
|
||||
public class WithCeph extends FileStorageTest {
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package dev.vality.file.storage.s3signer;
|
||||
|
||||
import dev.vality.file.storage.FileStorageTest;
|
||||
import dev.vality.testcontainers.annotations.minio.MinioTestcontainerSingleton;
|
||||
|
||||
@MinioTestcontainerSingleton(bucketName = "s3signer")
|
||||
public class WithMinio extends FileStorageTest {
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package com.rbkmoney.file.storage.s3v4signer;
|
||||
package dev.vality.file.storage.s3v4signer;
|
||||
|
||||
import com.rbkmoney.file.storage.FileStorageTest;
|
||||
import com.rbkmoney.testcontainers.annotations.ceph.CephTestcontainerSingleton;
|
||||
import dev.vality.file.storage.FileStorageTest;
|
||||
import dev.vality.testcontainers.annotations.ceph.CephTestcontainerSingleton;
|
||||
|
||||
@CephTestcontainerSingleton(
|
||||
properties = "s3.signer-override=AWSS3V4SignerType",
|
@ -1,7 +1,7 @@
|
||||
package com.rbkmoney.file.storage.s3v4signer;
|
||||
package dev.vality.file.storage.s3v4signer;
|
||||
|
||||
import com.rbkmoney.file.storage.FileStorageTest;
|
||||
import com.rbkmoney.testcontainers.annotations.minio.MinioTestcontainerSingleton;
|
||||
import dev.vality.file.storage.FileStorageTest;
|
||||
import dev.vality.testcontainers.annotations.minio.MinioTestcontainerSingleton;
|
||||
|
||||
@MinioTestcontainerSingleton(
|
||||
properties = "s3.signer-override=AWSS3V4SignerType",
|
@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
|
||||
<logger name="org.springframework.jdbc.core.JdbcTemplate">
|
||||
<level value="error"/>
|
||||
</logger>
|
||||
|
||||
<logger name="org.springframework.jdbc.core.StatementCreatorUtils">
|
||||
<level value="error"/>
|
||||
</logger>
|
||||
|
||||
<logger name="org.springframework.jdbc.support.JdbcAccessor">
|
||||
<level value="error"/>
|
||||
</logger>
|
||||
|
||||
<logger name="org.apache.http">
|
||||
<level value="error"/>
|
||||
</logger>
|
||||
|
||||
<logger name="com.amazonaws">
|
||||
<level value="error"/>
|
||||
</logger>
|
||||
|
||||
<logger name="com.rbkmoney.woody">
|
||||
<level value="error"/>
|
||||
</logger>
|
||||
|
||||
</configuration>
|
Loading…
Reference in New Issue
Block a user