TD-45: to dev.vality (#2)

This commit is contained in:
Baikov Dmitrii 2022-01-27 10:11:10 -08:00 committed by GitHub
parent 8b5b891c6c
commit 635f00aaff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 147 additions and 157 deletions

10
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,10 @@
name: Maven Build Artifact
on:
pull_request:
branches:
- '*'
jobs:
build:
uses: valitydev/base-workflow/.github/workflows/maven-library-build.yml@v1

16
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Maven Deploy Artifact
on:
push:
branches:
- 'master'
- 'main'
jobs:
deploy:
uses: valitydev/base-workflow/.github/workflows/maven-library-deploy.yml@v1
secrets:
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_TOKEN }}
deploy-secret-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
deploy-secret-key-password: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

4
.gitmodules vendored
View File

@ -1,4 +0,0 @@
[submodule "build_utils"]
path = build_utils
url = git@github.com:rbkmoney/build_utils.git
branch = master

15
Jenkinsfile vendored
View File

@ -1,15 +0,0 @@
#!groovy
build('adapter-bank-spring-boot-starter', 'docker-host') {
checkoutRepo()
loadBuildUtils()
def javaLibPipeline
runStage('load JavaLib pipeline') {
javaLibPipeline = load("build_utils/jenkins_lib/pipeJavaLib.groovy")
}
def buildImageTag = "fcf116dd775cc2e91bffb6a36835754e3f2d5321"
javaLibPipeline(buildImageTag)
}

View File

@ -1,7 +1,5 @@
### adapter-bank-spring-boot-starter
[![Build Status](http://ci.rbkmoney.com/buildStatus/icon?job=rbkmoney_private/adapter-bank-spring-boot-starter/master)](http://ci.rbkmoney.com/job/rbkmoney_private/job/adapter-bank-spring-boot-starter/job/master/)
**Adapter-bank-spring-boot-starter** - это подключаемый Spring Boot модуль для стандартных
компонентов proxy-алаптеров.

@ -1 +0,0 @@
Subproject commit e89b885839df8013df804d48ff24dff10c9c451e

98
pom.xml
View File

@ -5,18 +5,18 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>library-parent-pom</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
<relativePath/>
</parent>
<artifactId>adapter-bank-spring-boot-starter</artifactId>
<version>0.0.19</version>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>adapter-bank-spring-boot-starter</name>
<description>Spring boot starter for bank adapter</description>
<url>https://github.com/rbkmoney/adapter-bank-spring-boot-starter</url>
<url>https://github.com/valitydev/adapter-bank-spring-boot-starter</url>
<licenses>
<license>
@ -27,36 +27,37 @@
<developers>
<developer>
<organization>RBK.money</organization>
<organizationUrl>https://rbk.money</organizationUrl>
<organization>Vality</organization>
<organizationUrl>https://vality.dev</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/rbkmoney/adapter-bank-spring-boot-starter.git</connection>
<developerConnection>scm:git:ssh://github.com/rbkmoney/adapter-bank-spring-boot-starter.git</developerConnection>
<url>https://github.com/rbkmoney/adapter-bank-spring-boot-starter/tree/master</url>
<connection>scm:git:git://github.com/valitydev/adapter-bank-spring-boot-starter.git</connection>
<developerConnection>scm:git:ssh://github.com/valitydev/adapter-bank-spring-boot-starter.git</developerConnection>
<url>https://github.com/valitydev/adapter-bank-spring-boot-starter/tree/master</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>8</java.version>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
<java.version>15</java.version>
<adapter-client-lib.version>2.1.27</adapter-client-lib.version>
<adapter-thrift-lib.version>1.0.5</adapter-thrift-lib.version>
<adapter-common-lib.version>0.0.26</adapter-common-lib.version>
<adapter-client-lib.version>1.0.1</adapter-client-lib.version>
<adapter-thrift-lib.version>1.0.0</adapter-thrift-lib.version>
<adapter-common-lib.version>1.0.0</adapter-common-lib.version>
<damsel.version>1.439-b18f037</damsel.version>
<cds-proto.version>1.62-07f2b0f</cds-proto.version>
<damsel.version>1.544-dcd92dd</damsel.version>
<cds-proto.version>1.66-01353ce</cds-proto.version>
<spring-boot.version>2.3.8.RELEASE</spring-boot.version>
<woody.version>[1.1.21,)</woody.version>
<geck.version>[0.6.11,)</geck.version>
<lombok.version>1.18.4</lombok.version>
<spring-boot.version>2.6.3</spring-boot.version>
<woody.version>1.0.4</woody.version>
<geck.version>0.0.1</geck.version>
<lombok.version>1.18.22</lombok.version>
<slf4j-api.version>1.7.30</slf4j-api.version>
<javax.servlet-api.version>4.0.1</javax.servlet-api.version>
<hibernate-validator.version>6.1.5.Final</hibernate-validator.version>
<error-mapping-java.version>1.0.6</error-mapping-java.version>
<error-mapping-java.version>1.0.0</error-mapping-java.version>
<junit.version>4.12</junit.version>
</properties>
@ -116,53 +117,53 @@
<version>${spring-boot.version}</version>
</dependency>
<!--rbk-->
<!--vality-->
<dependency>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>error-mapping-java</artifactId>
<version>${error-mapping-java.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.rbkmoney.woody</groupId>
<groupId>dev.vality.woody</groupId>
<artifactId>woody-thrift</artifactId>
<version>${woody.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>damsel</artifactId>
<version>${damsel.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>cds-proto</artifactId>
<version>${cds-proto.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.rbkmoney.adapter-thrift-lib</groupId>
<groupId>dev.vality.adapter-thrift-lib</groupId>
<artifactId>cds-utils</artifactId>
<version>${adapter-thrift-lib.version}</version>
</dependency>
<dependency>
<groupId>com.rbkmoney.adapter-thrift-lib</groupId>
<groupId>dev.vality.adapter-thrift-lib</groupId>
<artifactId>damsel-utils</artifactId>
<version>${adapter-thrift-lib.version}</version>
</dependency>
<dependency>
<groupId>com.rbkmoney.geck</groupId>
<groupId>dev.vality.geck</groupId>
<artifactId>serializer</artifactId>
<version>${geck.version}</version>
</dependency>
<dependency>
<groupId>com.rbkmoney.adapter-client-lib</groupId>
<groupId>dev.vality.adapter-client-lib</groupId>
<artifactId>hellgate-adapter-client</artifactId>
<version>${adapter-client-lib.version}</version>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>adapter-common-lib</artifactId>
<version>${adapter-common-lib.version}</version>
</dependency>
@ -175,39 +176,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<configuration>
<destFile>${sonar.jacoco.reportPath}</destFile>
<append>true</append>
</configuration>
<executions>
<execution>
<id>agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

18
renovate.json Normal file
View File

@ -0,0 +1,18 @@
{
"extends": [
"config:base"
],
"packageRules": [
{
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"minor",
"patch"
],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch"
}
]
}

View File

@ -1,13 +0,0 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.flow;
import com.rbkmoney.adapter.bank.spring.boot.starter.model.GeneralEntryStateModel;
import com.rbkmoney.adapter.bank.spring.boot.starter.model.GeneralExitStateModel;
import com.rbkmoney.adapter.common.enums.Step;
public interface StepResolver<T extends GeneralEntryStateModel, R extends GeneralExitStateModel> {
Step resolveEntry(T entryStateModel);
Step resolveExit(R exitStateModel);
}

View File

@ -1,9 +1,9 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.configuration;
package dev.vality.adapter.bank.spring.boot.starter.configuration;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rbkmoney.adapter.common.mapper.SimpleErrorMapping;
import com.rbkmoney.adapter.common.mapper.SimpleObjectMapper;
import com.rbkmoney.error.mapping.ErrorMapping;
import dev.vality.adapter.common.mapper.SimpleErrorMapping;
import dev.vality.adapter.common.mapper.SimpleObjectMapper;
import dev.vality.error.mapping.ErrorMapping;
import java.io.IOException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

View File

@ -1,9 +1,9 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.configuration;
package dev.vality.adapter.bank.spring.boot.starter.configuration;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rbkmoney.adapter.common.state.deserializer.AdapterDeserializer;
import com.rbkmoney.adapter.common.state.deserializer.CallbackDeserializer;
import com.rbkmoney.adapter.common.state.deserializer.RecurrentTokenDeserializer;
import dev.vality.adapter.common.state.deserializer.AdapterDeserializer;
import dev.vality.adapter.common.state.deserializer.CallbackDeserializer;
import dev.vality.adapter.common.state.deserializer.RecurrentTokenDeserializer;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.configuration;
package dev.vality.adapter.bank.spring.boot.starter.configuration;
import com.rbkmoney.adapter.common.component.NetworkFilterComponent;
import dev.vality.adapter.common.component.NetworkFilterComponent;
import org.apache.catalina.connector.Connector;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;

View File

@ -1,9 +1,9 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.configuration;
package dev.vality.adapter.bank.spring.boot.starter.configuration;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rbkmoney.adapter.common.state.serializer.AdapterSerializer;
import com.rbkmoney.adapter.common.state.serializer.CallbackSerializer;
import com.rbkmoney.adapter.common.state.serializer.RecurrentTokenSerializer;
import dev.vality.adapter.common.state.serializer.AdapterSerializer;
import dev.vality.adapter.common.state.serializer.CallbackSerializer;
import dev.vality.adapter.common.state.serializer.RecurrentTokenSerializer;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,9 +1,9 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.controller;
package dev.vality.adapter.bank.spring.boot.starter.controller;
import com.rbkmoney.adapter.common.controller.AdapterController;
import com.rbkmoney.adapter.common.state.deserializer.CallbackDeserializer;
import com.rbkmoney.adapter.common.state.serializer.CallbackSerializer;
import com.rbkmoney.adapter.helpers.hellgate.HellgateAdapterClient;
import dev.vality.adapter.common.controller.AdapterController;
import dev.vality.adapter.common.state.deserializer.CallbackDeserializer;
import dev.vality.adapter.common.state.serializer.CallbackSerializer;
import dev.vality.adapter.helpers.hellgate.HellgateAdapterClient;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

View File

@ -1,8 +1,8 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.flow;
package dev.vality.adapter.bank.spring.boot.starter.flow;
import com.rbkmoney.adapter.bank.spring.boot.starter.model.GeneralEntryStateModel;
import com.rbkmoney.adapter.bank.spring.boot.starter.model.GeneralExitStateModel;
import com.rbkmoney.adapter.common.enums.Step;
import dev.vality.adapter.bank.spring.boot.starter.model.GeneralEntryStateModel;
import dev.vality.adapter.bank.spring.boot.starter.model.GeneralExitStateModel;
import dev.vality.adapter.common.enums.Step;
public class DefaultStepResolverImpl implements StepResolver<GeneralEntryStateModel, GeneralExitStateModel> {

View File

@ -0,0 +1,13 @@
package dev.vality.adapter.bank.spring.boot.starter.flow;
import dev.vality.adapter.bank.spring.boot.starter.model.GeneralEntryStateModel;
import dev.vality.adapter.bank.spring.boot.starter.model.GeneralExitStateModel;
import dev.vality.adapter.common.enums.Step;
public interface StepResolver<T extends GeneralEntryStateModel, R extends GeneralExitStateModel> {
Step resolveEntry(T entryStateModel);
Step resolveExit(R exitStateModel);
}

View File

@ -1,4 +1,4 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.logging.annotation;
package dev.vality.adapter.bank.spring.boot.starter.logging.annotation;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMethod;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.logging.annotation;
package dev.vality.adapter.bank.spring.boot.starter.logging.annotation;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMethod;

View File

@ -1,7 +1,7 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.logging.aspect;
package dev.vality.adapter.bank.spring.boot.starter.logging.aspect;
import com.rbkmoney.adapter.bank.spring.boot.starter.logging.annotation.GetLogging;
import com.rbkmoney.adapter.bank.spring.boot.starter.logging.annotation.PostLogging;
import dev.vality.adapter.bank.spring.boot.starter.logging.annotation.GetLogging;
import dev.vality.adapter.bank.spring.boot.starter.logging.annotation.PostLogging;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
@ -19,7 +19,7 @@ public class RequestLoggingAspect {
private static final String REQUEST_LOG = "Request [{} {}]: {}";
private static final String RESPONSE_LOG = "Response [{} {}]: {}";
@Around("@annotation(com.rbkmoney.adapter.bank.spring.boot.starter.logging.annotation.GetLogging)")
@Around("@annotation(dev.vality.adapter.bank.spring.boot.starter.logging.annotation.GetLogging)")
public Object logGetRequest(ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
GetLogging getLogging = AnnotationUtils.findAnnotation(signature.getMethod(), GetLogging.class);
@ -30,7 +30,7 @@ public class RequestLoggingAspect {
return log(joinPoint, method, endpoint);
}
@Around("@annotation(com.rbkmoney.adapter.bank.spring.boot.starter.logging.annotation.PostLogging)")
@Around("@annotation(dev.vality.adapter.bank.spring.boot.starter.logging.annotation.PostLogging)")
public Object logPostRequest(ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
PostLogging postLogging = AnnotationUtils.findAnnotation(signature.getMethod(), PostLogging.class);

View File

@ -1,7 +1,7 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.model;
package dev.vality.adapter.bank.spring.boot.starter.model;
import com.rbkmoney.adapter.common.enums.TargetStatus;
import com.rbkmoney.adapter.common.model.AdapterContext;
import dev.vality.adapter.common.enums.TargetStatus;
import dev.vality.adapter.common.model.AdapterContext;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.model;
package dev.vality.adapter.bank.spring.boot.starter.model;
import com.rbkmoney.adapter.common.model.AdapterContext;
import dev.vality.adapter.common.model.AdapterContext;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@ -1,6 +1,7 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.service;
package dev.vality.adapter.bank.spring.boot.starter.service;
import dev.vality.adapter.bank.spring.boot.starter.model.GeneralExitStateModel;
import com.rbkmoney.adapter.bank.spring.boot.starter.model.GeneralExitStateModel;
import java.util.Map;
public interface ThreeDsPropertiesService {

View File

@ -1,12 +1,13 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.service;
package dev.vality.adapter.bank.spring.boot.starter.service;
import com.rbkmoney.adapter.bank.spring.boot.starter.model.GeneralExitStateModel;
import com.rbkmoney.adapter.common.constants.ThreeDsFields;
import com.rbkmoney.adapter.common.model.AdapterContext;
import com.rbkmoney.adapter.common.properties.CommonAdapterProperties;
import com.rbkmoney.adapter.common.utils.converter.RedirectUtils;
import dev.vality.adapter.bank.spring.boot.starter.model.GeneralExitStateModel;
import dev.vality.adapter.common.constants.ThreeDsFields;
import dev.vality.adapter.common.model.AdapterContext;
import dev.vality.adapter.common.properties.CommonAdapterProperties;
import dev.vality.adapter.common.utils.converter.RedirectUtils;
import java.util.HashMap;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

View File

@ -1,7 +1,7 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.rbkmoney.adapter.bank.spring.boot.starter.configuration.AppConfiguration,\
com.rbkmoney.adapter.bank.spring.boot.starter.configuration.SerializerConfiguration,\
com.rbkmoney.adapter.bank.spring.boot.starter.configuration.DeserializerConfiguration,\
com.rbkmoney.adapter.bank.spring.boot.starter.controller.AdapterControllerDecorator,\
com.rbkmoney.adapter.bank.spring.boot.starter.service.ThreeDsPropertiesServiceImpl,\
com.rbkmoney.adapter.bank.spring.boot.starter.logging.aspect.RequestLoggingAspect
dev.vality.adapter.bank.spring.boot.starter.configuration.AppConfiguration,\
dev.vality.adapter.bank.spring.boot.starter.configuration.SerializerConfiguration,\
dev.vality.adapter.bank.spring.boot.starter.configuration.DeserializerConfiguration,\
dev.vality.adapter.bank.spring.boot.starter.controller.AdapterControllerDecorator,\
dev.vality.adapter.bank.spring.boot.starter.service.ThreeDsPropertiesServiceImpl,\
dev.vality.adapter.bank.spring.boot.starter.logging.aspect.RequestLoggingAspect

View File

@ -1,9 +1,9 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.utils;
package dev.vality.adapter.bank.spring.boot.starter.utils;
import com.rbkmoney.adapter.common.utils.converter.CardDataUtils;
import com.rbkmoney.cds.storage.AuthData;
import com.rbkmoney.cds.storage.CardSecurityCode;
import com.rbkmoney.cds.storage.SessionData;
import dev.vality.adapter.common.utils.converter.CardDataUtils;
import dev.vality.cds.storage.AuthData;
import dev.vality.cds.storage.CardSecurityCode;
import dev.vality.cds.storage.SessionData;
import org.junit.Assert;
import org.junit.Test;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.adapter.bank.spring.boot.starter.utils;
package dev.vality.adapter.bank.spring.boot.starter.utils;
import com.rbkmoney.adapter.common.utils.encryption.HmacEncryption;
import dev.vality.adapter.common.utils.encryption.HmacEncryption;
import org.junit.Assert;
import org.junit.Test;