Merge pull request #1 from valitydev/ft/TD-152/bump-service-add-metrics

[TD-152] Bump service and add metrics
This commit is contained in:
Pospolita Nikita 2022-02-14 14:05:58 +03:00 committed by GitHub
commit 1d1556ac81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
115 changed files with 579 additions and 569 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/java-workflow/.github/workflows/maven-service-build.yml@v1

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

@ -0,0 +1,13 @@
name: Deploy Docker Image
on:
push:
branches:
- 'master'
jobs:
build-and-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
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('org-manager', 'java-maven') {
checkoutRepo()
loadBuildUtils()
def javaServicePipeline
runStage('load JavaService pipeline') {
javaServicePipeline = load("build_utils/jenkins_lib/pipeJavaServiceInsideDocker.groovy")
}
def serviceName = env.REPO_NAME
def mvnArgs = '-DjvmArgs="-Xmx256m"'
javaServicePipeline(serviceName, mvnArgs)
}

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

51
pom.xml
View File

@ -4,9 +4,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>service-parent-pom</artifactId>
<version>2.0.11</version>
<version>1.0.9</version>
</parent>
<artifactId>org-manager</artifactId>
@ -22,56 +22,47 @@
<server.rest.port>8080</server.rest.port>
<management.port>8023</management.port>
<exposed.ports>${server.port} ${server.rest.port} ${management.port}</exposed.ports>
<dockerfile.registry>${env.REGISTRY}</dockerfile.registry>
<spring-security.version>5.5.2</spring-security.version>
<keycloak.version>14.0.0</keycloak.version>
<keycloak.version>17.0.0</keycloak.version>
<schedlock.version>4.14.0</schedlock.version>
<swag.organizations.version>1.19-8707f87-server</swag.organizations.version>
</properties>
<dependencies>
<!--rbkmoney-->
<!--vality-->
<dependency>
<groupId>com.rbkmoney</groupId>
<artifactId>spring-boot-starter-metrics-statsd</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<artifactId>custom-actuator-endpoints</artifactId>
</dependency>
<dependency>
<groupId>com.rbkmoney.woody</groupId>
<groupId>dev.vality.woody</groupId>
<artifactId>woody-thrift</artifactId>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>shared-resources</artifactId>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>swag-organizations</artifactId>
<version>${swag.organizations.version}</version>
<version>1.1-bb2f2f5-server</version>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>damsel</artifactId>
<version>1.544-dcd92dd</version>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>org-management-proto</artifactId>
<version>1.2-06c5c84</version>
<version>1.6-abb4b4d</version>
<exclusions>
<exclusion>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>bouncer-proto</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<groupId>dev.vality</groupId>
<artifactId>bouncer-proto</artifactId>
<version>1.20-7dee26e</version>
<version>1.36-96bd74d</version>
</dependency>
<!--spring-->
<dependency>
@ -167,6 +158,14 @@
<!--third party-->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
@ -229,7 +228,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.16.0</version>
<version>1.16.3</version>
<scope>test</scope>
<exclusions>
<exclusion>
@ -280,7 +279,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>

View File

@ -1,8 +0,0 @@
package com.rbkmoney.orgmanager.service;
import com.rbkmoney.orgmanager.service.dto.BouncerContextDto;
public interface BouncerService {
boolean havePrivileges(BouncerContextDto bouncerContext);
}

View File

@ -1,13 +0,0 @@
package com.rbkmoney.orgmanager.service;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.swag.organizations.model.MemberRole;
public interface MemberRoleService {
MemberRole findById(String id);
MemberRoleEntity findEntityById(String id);
}

View File

@ -1,9 +0,0 @@
package com.rbkmoney.orgmanager.service;
import com.rbkmoney.orgmanager.service.model.UserInfo;
public interface UserService {
UserInfo findById(String id);
}

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager;
package dev.vality.orgmanager;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -1,8 +1,8 @@
package com.rbkmoney.orgmanager.config;
package dev.vality.orgmanager.config;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rbkmoney.orgmanager.controller.converter.InvitationStatusConverter;
import dev.vality.orgmanager.controller.converter.InvitationStatusConverter;
import org.openapitools.jackson.nullable.JsonNullableModule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

View File

@ -1,7 +1,7 @@
package com.rbkmoney.orgmanager.config;
package dev.vality.orgmanager.config;
import com.rbkmoney.bouncer.decisions.ArbiterSrv;
import com.rbkmoney.woody.thrift.impl.http.THSpawnClientBuilder;
import dev.vality.bouncer.decisions.ArbiterSrv;
import dev.vality.woody.thrift.impl.http.THSpawnClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -0,0 +1,63 @@
package dev.vality.orgmanager.config;
import com.google.common.base.Strings;
import dev.vality.orgmanager.config.properties.KeyCloakProperties;
import org.keycloak.adapters.KeycloakConfigResolver;
import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.KeycloakDeploymentBuilder;
import org.keycloak.adapters.springsecurity.config.KeycloakSpringConfigResolverWrapper;
import org.keycloak.representations.adapters.config.AdapterConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
@Configuration
public class ConfigResolverConfig {
@Bean
public KeycloakConfigResolver keycloakConfigResolver(KeyCloakProperties keyCloakProperties) {
return facade -> {
KeycloakDeployment deployment = KeycloakDeploymentBuilder.build(adapterConfig(keyCloakProperties));
deployment.setNotBefore(keyCloakProperties.getNotBefore());
return deployment;
};
}
private AdapterConfig adapterConfig(KeyCloakProperties keyCloakProperties) {
String keycloakRealmPublicKey;
if (!Strings.isNullOrEmpty(keyCloakProperties.getRealmPublicKeyFilePath())) {
keycloakRealmPublicKey = readKeyFromFile(keyCloakProperties.getRealmPublicKeyFilePath());
} else {
keycloakRealmPublicKey = keyCloakProperties.getRealmPublicKey();
}
AdapterConfig adapterConfig = new AdapterConfig();
adapterConfig.setRealm(keyCloakProperties.getRealm());
adapterConfig.setRealmKey(keycloakRealmPublicKey);
adapterConfig.setResource(keyCloakProperties.getResource());
adapterConfig.setAuthServerUrl(keyCloakProperties.getAuthServerUrl());
adapterConfig.setUseResourceRoleMappings(true);
adapterConfig.setBearerOnly(true);
adapterConfig.setSslRequired(keyCloakProperties.getSslRequired());
return adapterConfig;
}
private String readKeyFromFile(String filePath) {
try {
List<String> strings = Files.readAllLines(Paths.get(filePath));
strings.remove(strings.size() - 1);
strings.remove(0);
return strings.stream().map(String::trim).collect(Collectors.joining());
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}

View File

@ -1,7 +1,7 @@
package com.rbkmoney.orgmanager.config;
package dev.vality.orgmanager.config;
import com.rbkmoney.damsel.message_sender.MessageSenderSrv;
import com.rbkmoney.woody.thrift.impl.http.THSpawnClientBuilder;
import dev.vality.damsel.message_sender.MessageSenderSrv;
import dev.vality.woody.thrift.impl.http.THSpawnClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,7 +1,7 @@
package com.rbkmoney.orgmanager.config;
package dev.vality.orgmanager.config;
import com.rbkmoney.damsel.payment_processing.PartyManagementSrv;
import com.rbkmoney.woody.thrift.impl.http.THSpawnClientBuilder;
import dev.vality.damsel.payment_processing.PartyManagementSrv;
import dev.vality.woody.thrift.impl.http.THSpawnClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.config;
package dev.vality.orgmanager.config;
import net.javacrumbs.shedlock.core.LockProvider;
import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider;

View File

@ -1,21 +1,11 @@
package com.rbkmoney.orgmanager.config;
package dev.vality.orgmanager.config;
import com.google.common.base.Strings;
import com.rbkmoney.orgmanager.config.properties.KeyCloakProperties;
import org.keycloak.adapters.KeycloakConfigResolver;
import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.KeycloakDeploymentBuilder;
import org.keycloak.adapters.springsecurity.KeycloakSecurityComponents;
import org.keycloak.adapters.springsecurity.config.KeycloakWebSecurityConfigurerAdapter;
import org.keycloak.adapters.springsecurity.management.HttpSessionManager;
import org.keycloak.representations.adapters.config.AdapterConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.*;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
@ -27,12 +17,6 @@ import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
@Configuration
@EnableWebSecurity
@ComponentScan(
@ -44,11 +28,9 @@ import java.util.stream.Collectors;
)
@EnableGlobalMethodSecurity(prePostEnabled = true, proxyTargetClass = true)
@ConditionalOnProperty(value = "auth.enabled", havingValue = "true")
@DependsOn("configResolverConfig")
public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
@Autowired
private KeyCloakProperties keyCloakProperties;
@Override
protected HttpSessionManager httpSessionManager() {
return super.httpSessionManager();
@ -78,15 +60,6 @@ public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
auth.authenticationProvider(keycloakAuthenticationProvider());
}
@Bean
public KeycloakConfigResolver keycloakConfigResolver() {
return facade -> {
KeycloakDeployment deployment = KeycloakDeploymentBuilder.build(adapterConfig());
deployment.setNotBefore(keyCloakProperties.getNotBefore());
return deployment;
};
}
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
@ -98,35 +71,4 @@ public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
source.registerCorsConfiguration("/**", configuration);
return source;
}
private AdapterConfig adapterConfig() {
String keycloakRealmPublicKey;
if (!Strings.isNullOrEmpty(keyCloakProperties.getRealmPublicKeyFilePath())) {
keycloakRealmPublicKey = readKeyFromFile(keyCloakProperties.getRealmPublicKeyFilePath());
} else {
keycloakRealmPublicKey = keyCloakProperties.getRealmPublicKey();
}
AdapterConfig adapterConfig = new AdapterConfig();
adapterConfig.setRealm(keyCloakProperties.getRealm());
adapterConfig.setRealmKey(keycloakRealmPublicKey);
adapterConfig.setResource(keyCloakProperties.getResource());
adapterConfig.setAuthServerUrl(keyCloakProperties.getAuthServerUrl());
adapterConfig.setUseResourceRoleMappings(true);
adapterConfig.setBearerOnly(true);
adapterConfig.setSslRequired(keyCloakProperties.getSslRequired());
return adapterConfig;
}
private String readKeyFromFile(String filePath) {
try {
List<String> strings = Files.readAllLines(Paths.get(filePath));
strings.remove(strings.size() - 1);
strings.remove(0);
return strings.stream().map(String::trim).collect(Collectors.joining());
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.config;
package dev.vality.orgmanager.config;
import org.apache.catalina.connector.Connector;
import org.springframework.beans.factory.annotation.Value;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.config.properties;
package dev.vality.orgmanager.config.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.config.properties;
package dev.vality.orgmanager.config.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.config.properties;
package dev.vality.orgmanager.config.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,10 +1,11 @@
package com.rbkmoney.orgmanager.config.properties;
package dev.vality.orgmanager.config.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
@Configuration
@Component
@ConfigurationProperties(prefix = "keycloak")
@Data
public class KeyCloakProperties {

View File

@ -1,9 +1,9 @@
package com.rbkmoney.orgmanager.controller;
package dev.vality.orgmanager.controller;
import com.rbkmoney.orgmanager.service.*;
import com.rbkmoney.orgmanager.service.dto.ResourceDto;
import com.rbkmoney.swag.organizations.api.OrgsApi;
import com.rbkmoney.swag.organizations.model.*;
import dev.vality.orgmanager.service.*;
import dev.vality.orgmanager.service.dto.ResourceDto;
import dev.vality.swag.organizations.api.OrgsApi;
import dev.vality.swag.organizations.model.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.keycloak.representations.AccessToken;

View File

@ -1,11 +1,11 @@
package com.rbkmoney.orgmanager.controller;
package dev.vality.orgmanager.controller;
import com.rbkmoney.orgmanager.service.KeycloakService;
import com.rbkmoney.orgmanager.service.OrganizationService;
import com.rbkmoney.orgmanager.service.ResourceAccessService;
import com.rbkmoney.orgmanager.service.dto.ResourceDto;
import com.rbkmoney.swag.organizations.api.UserApi;
import com.rbkmoney.swag.organizations.model.*;
import dev.vality.orgmanager.service.KeycloakService;
import dev.vality.orgmanager.service.OrganizationService;
import dev.vality.orgmanager.service.ResourceAccessService;
import dev.vality.orgmanager.service.dto.ResourceDto;
import dev.vality.swag.organizations.api.UserApi;
import dev.vality.swag.organizations.model.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.keycloak.representations.AccessToken;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.controller.converter;
package dev.vality.orgmanager.controller.converter;
import com.rbkmoney.swag.organizations.model.InvitationStatusName;
import dev.vality.swag.organizations.model.InvitationStatusName;
import org.springframework.core.convert.converter.Converter;
public class InvitationStatusConverter implements Converter<String, InvitationStatusName> {

View File

@ -1,9 +1,10 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.bouncer.context.v1.*;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import dev.vality.bouncer.base.Entity;
import dev.vality.bouncer.context.v1.*;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.entity.OrganizationEntity;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;

View File

@ -1,9 +1,9 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.orgmanager.config.properties.InviteTokenProperties;
import com.rbkmoney.orgmanager.entity.InvitationEntity;
import com.rbkmoney.orgmanager.util.JsonMapper;
import com.rbkmoney.swag.organizations.model.*;
import dev.vality.orgmanager.config.properties.InviteTokenProperties;
import dev.vality.orgmanager.entity.InvitationEntity;
import dev.vality.orgmanager.util.JsonMapper;
import dev.vality.swag.organizations.model.*;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

View File

@ -1,11 +1,11 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.orgmanager.service.dto.MemberDto;
import com.rbkmoney.orgmanager.service.dto.MemberWithRoleDto;
import com.rbkmoney.swag.organizations.model.Member;
import com.rbkmoney.swag.organizations.model.MemberRole;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.service.dto.MemberDto;
import dev.vality.orgmanager.service.dto.MemberWithRoleDto;
import dev.vality.swag.organizations.model.Member;
import dev.vality.swag.organizations.model.MemberRole;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

View File

@ -1,11 +1,11 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.orgmanager.service.dto.MemberWithRoleDto;
import com.rbkmoney.swag.organizations.model.MemberRole;
import com.rbkmoney.swag.organizations.model.MemberRoleScope;
import com.rbkmoney.swag.organizations.model.ResourceScopeId;
import com.rbkmoney.swag.organizations.model.RoleId;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.service.dto.MemberWithRoleDto;
import dev.vality.swag.organizations.model.MemberRole;
import dev.vality.swag.organizations.model.MemberRoleScope;
import dev.vality.swag.organizations.model.ResourceScopeId;
import dev.vality.swag.organizations.model.RoleId;
import org.springframework.stereotype.Service;
import java.util.Objects;

View File

@ -1,8 +1,8 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import com.rbkmoney.orgmanager.util.JsonMapper;
import com.rbkmoney.swag.organizations.model.Organization;
import dev.vality.orgmanager.entity.OrganizationEntity;
import dev.vality.orgmanager.util.JsonMapper;
import dev.vality.swag.organizations.model.Organization;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

View File

@ -1,9 +1,9 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.orgmanager.entity.OrganizationRoleEntity;
import com.rbkmoney.swag.organizations.model.ResourceScopeId;
import com.rbkmoney.swag.organizations.model.Role;
import com.rbkmoney.swag.organizations.model.RoleId;
import dev.vality.orgmanager.entity.OrganizationRoleEntity;
import dev.vality.swag.organizations.model.ResourceScopeId;
import dev.vality.swag.organizations.model.Role;
import dev.vality.swag.organizations.model.RoleId;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.entity;
package dev.vality.orgmanager.entity;
import lombok.*;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.entity;
package dev.vality.orgmanager.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.entity;
package dev.vality.orgmanager.entity;
import lombok.*;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.entity;
package dev.vality.orgmanager.entity;
import lombok.*;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.entity;
package dev.vality.orgmanager.entity;
import lombok.*;
import org.hibernate.annotations.Fetch;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.entity;
package dev.vality.orgmanager.entity;
import lombok.*;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.entity;
package dev.vality.orgmanager.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.entity.naming;
package dev.vality.orgmanager.entity.naming;
import com.google.common.base.CaseFormat;
import org.hibernate.boot.model.naming.Identifier;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.exception;
package dev.vality.orgmanager.exception;
public class AccessDeniedException extends RuntimeException {

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.exception;
package dev.vality.orgmanager.exception;
public class BouncerException extends RuntimeException {

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.exception;
package dev.vality.orgmanager.exception;
import lombok.Getter;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.exception;
package dev.vality.orgmanager.exception;
import lombok.Getter;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.exception;
package dev.vality.orgmanager.exception;
import lombok.Getter;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.exception;
package dev.vality.orgmanager.exception;
public class LastRoleException extends RuntimeException {

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.exception;
package dev.vality.orgmanager.exception;
public class PartyManagementException extends RuntimeException {

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.exception;
package dev.vality.orgmanager.exception;
public class ResourceNotFoundException extends RuntimeException {

View File

@ -1,7 +1,7 @@
package com.rbkmoney.orgmanager.exception;
package dev.vality.orgmanager.exception;
import com.rbkmoney.swag.organizations.model.InlineResponse422;
import com.rbkmoney.swag.organizations.model.InlineResponse4222;
import dev.vality.swag.organizations.model.InlineResponse422;
import dev.vality.swag.organizations.model.InlineResponse4222;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.pagination;
package dev.vality.orgmanager.pagination;
import lombok.EqualsAndHashCode;
import org.springframework.data.domain.Pageable;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.repository;
package dev.vality.orgmanager.repository;
import com.rbkmoney.orgmanager.entity.InvitationEntity;
import dev.vality.orgmanager.entity.InvitationEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.QueryHints;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.repository;
package dev.vality.orgmanager.repository;
import com.rbkmoney.orgmanager.entity.MemberContextEntity;
import dev.vality.orgmanager.entity.MemberContextEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

View File

@ -1,7 +1,7 @@
package com.rbkmoney.orgmanager.repository;
package dev.vality.orgmanager.repository;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.service.dto.MemberWithRoleDto;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.service.dto.MemberWithRoleDto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.repository;
package dev.vality.orgmanager.repository;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.repository;
package dev.vality.orgmanager.repository;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import dev.vality.orgmanager.entity.OrganizationEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.repository;
package dev.vality.orgmanager.repository;
import com.rbkmoney.orgmanager.entity.OrganizationRoleEntity;
import dev.vality.orgmanager.entity.OrganizationRoleEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.scheduler;
package dev.vality.orgmanager.scheduler;
import com.rbkmoney.orgmanager.service.InvitationService;
import dev.vality.orgmanager.service.InvitationService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;

View File

@ -1,13 +1,13 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.bouncer.context.v1.User;
import com.rbkmoney.bouncer.ctx.ContextFragment;
import com.rbkmoney.bouncer.ctx.ContextFragmentType;
import com.rbkmoney.orgmanagement.AuthContextProviderSrv;
import com.rbkmoney.orgmanager.converter.BouncerContextConverter;
import com.rbkmoney.orgmanager.service.model.UserInfo;
import com.rbkmoney.woody.api.trace.ContextUtils;
import com.rbkmoney.woody.api.trace.context.metadata.user.UserIdentityEmailExtensionKit;
import dev.vality.bouncer.context.v1.User;
import dev.vality.bouncer.ctx.ContextFragment;
import dev.vality.bouncer.ctx.ContextFragmentType;
import dev.vality.orgmanagement.AuthContextProviderSrv;
import dev.vality.orgmanager.converter.BouncerContextConverter;
import dev.vality.orgmanager.service.model.UserInfo;
import dev.vality.woody.api.trace.ContextUtils;
import dev.vality.woody.api.trace.context.metadata.user.UserIdentityEmailExtensionKit;
import lombok.RequiredArgsConstructor;
import org.apache.thrift.TException;
import org.apache.thrift.TSerializer;
@ -22,8 +22,8 @@ public class AuthContextService implements AuthContextProviderSrv.Iface {
@Override
public ContextFragment getUserContext(String id) throws TException {
com.rbkmoney.bouncer.context.v1.ContextFragment contextFragment =
new com.rbkmoney.bouncer.context.v1.ContextFragment();
dev.vality.bouncer.context.v1.ContextFragment contextFragment =
new dev.vality.bouncer.context.v1.ContextFragment();
contextFragment.setUser(getUser(id));
TSerializer byteSerializer = new TSerializer();
return new ContextFragment()

View File

@ -1,14 +1,16 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.bouncer.context.v1.*;
import com.rbkmoney.bouncer.ctx.ContextFragmentType;
import com.rbkmoney.bouncer.decisions.Context;
import com.rbkmoney.orgmanagement.UserNotFound;
import com.rbkmoney.orgmanager.config.properties.BouncerProperties;
import com.rbkmoney.orgmanager.converter.BouncerContextConverter;
import com.rbkmoney.orgmanager.service.dto.BouncerContextDto;
import com.rbkmoney.orgmanager.service.dto.InvitationDto;
import com.rbkmoney.orgmanager.service.model.UserInfo;
import dev.vality.bouncer.base.Entity;
import dev.vality.bouncer.context.v1.*;
import dev.vality.bouncer.ctx.ContextFragmentType;
import dev.vality.bouncer.decisions.Context;
import dev.vality.orgmanagement.UserNotFound;
import dev.vality.orgmanager.config.properties.BouncerProperties;
import dev.vality.orgmanager.converter.BouncerContextConverter;
import dev.vality.orgmanager.service.dto.BouncerContextDto;
import dev.vality.orgmanager.service.dto.InvitationDto;
import dev.vality.orgmanager.service.model.UserInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.thrift.TException;
@ -31,7 +33,7 @@ public class BouncerContextFactory {
public Context buildContext(BouncerContextDto bouncerContext) throws TException {
Context context = new Context();
com.rbkmoney.bouncer.ctx.ContextFragment fragment = new com.rbkmoney.bouncer.ctx.ContextFragment();
dev.vality.bouncer.ctx.ContextFragment fragment = new dev.vality.bouncer.ctx.ContextFragment();
fragment.setType(ContextFragmentType.v1_thrift_binary);
ContextFragment contextFragment = buildContextFragment(bouncerContext);
TSerializer serializer = new TSerializer();

View File

@ -0,0 +1,8 @@
package dev.vality.orgmanager.service;
import dev.vality.orgmanager.service.dto.BouncerContextDto;
public interface BouncerService {
boolean havePrivileges(BouncerContextDto bouncerContext);
}

View File

@ -1,13 +1,13 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.bouncer.decisions.ArbiterSrv;
import com.rbkmoney.bouncer.decisions.Context;
import com.rbkmoney.bouncer.decisions.Judgement;
import com.rbkmoney.bouncer.decisions.Resolution;
import com.rbkmoney.orgmanagement.UserNotFound;
import com.rbkmoney.orgmanager.config.properties.BouncerProperties;
import com.rbkmoney.orgmanager.exception.BouncerException;
import com.rbkmoney.orgmanager.service.dto.BouncerContextDto;
import dev.vality.bouncer.decisions.ArbiterSrv;
import dev.vality.bouncer.decisions.Context;
import dev.vality.bouncer.decisions.Judgement;
import dev.vality.bouncer.decisions.Resolution;
import dev.vality.orgmanagement.UserNotFound;
import dev.vality.orgmanager.config.properties.BouncerProperties;
import dev.vality.orgmanager.exception.BouncerException;
import dev.vality.orgmanager.service.dto.BouncerContextDto;
import lombok.RequiredArgsConstructor;
import org.apache.thrift.TException;
import org.springframework.stereotype.Service;

View File

@ -1,14 +1,14 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.orgmanager.converter.InvitationConverter;
import com.rbkmoney.orgmanager.entity.InvitationEntity;
import com.rbkmoney.orgmanager.exception.InviteAlreadyAcceptedException;
import com.rbkmoney.orgmanager.exception.InviteExpiredException;
import com.rbkmoney.orgmanager.exception.InviteRevokedException;
import com.rbkmoney.orgmanager.exception.ResourceNotFoundException;
import com.rbkmoney.orgmanager.repository.InvitationRepository;
import com.rbkmoney.orgmanager.repository.OrganizationRepository;
import com.rbkmoney.swag.organizations.model.*;
import dev.vality.orgmanager.converter.InvitationConverter;
import dev.vality.orgmanager.entity.InvitationEntity;
import dev.vality.orgmanager.exception.InviteAlreadyAcceptedException;
import dev.vality.orgmanager.exception.InviteExpiredException;
import dev.vality.orgmanager.exception.InviteRevokedException;
import dev.vality.orgmanager.exception.ResourceNotFoundException;
import dev.vality.orgmanager.repository.InvitationRepository;
import dev.vality.orgmanager.repository.OrganizationRepository;
import dev.vality.swag.organizations.model.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
@ -19,7 +19,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.util.stream.Collectors.toList;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import org.keycloak.KeycloakPrincipal;
import org.keycloak.representations.AccessToken;

View File

@ -1,9 +1,9 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.damsel.message_sender.MailBody;
import com.rbkmoney.damsel.message_sender.Message;
import com.rbkmoney.damsel.message_sender.MessageMail;
import com.rbkmoney.damsel.message_sender.MessageSenderSrv;
import dev.vality.damsel.message_sender.MailBody;
import dev.vality.damsel.message_sender.Message;
import dev.vality.damsel.message_sender.MessageMail;
import dev.vality.damsel.message_sender.MessageSenderSrv;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;

View File

@ -0,0 +1,13 @@
package dev.vality.orgmanager.service;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.swag.organizations.model.MemberRole;
public interface MemberRoleService {
MemberRole findById(String id);
MemberRoleEntity findEntityById(String id);
}

View File

@ -1,10 +1,10 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.orgmanager.converter.MemberRoleConverter;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.orgmanager.exception.ResourceNotFoundException;
import com.rbkmoney.orgmanager.repository.MemberRoleRepository;
import com.rbkmoney.swag.organizations.model.MemberRole;
import dev.vality.orgmanager.converter.MemberRoleConverter;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.exception.ResourceNotFoundException;
import dev.vality.orgmanager.repository.MemberRoleRepository;
import dev.vality.swag.organizations.model.MemberRole;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.entity.MemberEntity;
import java.util.Optional;

View File

@ -1,7 +1,7 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.repository.MemberRepository;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.repository.MemberRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

View File

@ -1,14 +1,14 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.orgmanager.converter.OrganizationRoleConverter;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import com.rbkmoney.orgmanager.entity.OrganizationRoleEntity;
import com.rbkmoney.orgmanager.exception.ResourceNotFoundException;
import com.rbkmoney.orgmanager.repository.OrganizationRepository;
import com.rbkmoney.orgmanager.repository.OrganizationRoleRepository;
import com.rbkmoney.swag.organizations.model.Role;
import com.rbkmoney.swag.organizations.model.RoleAvailableListResult;
import com.rbkmoney.swag.organizations.model.RoleId;
import dev.vality.orgmanager.converter.OrganizationRoleConverter;
import dev.vality.orgmanager.entity.OrganizationEntity;
import dev.vality.orgmanager.entity.OrganizationRoleEntity;
import dev.vality.orgmanager.exception.ResourceNotFoundException;
import dev.vality.orgmanager.repository.OrganizationRepository;
import dev.vality.orgmanager.repository.OrganizationRoleRepository;
import dev.vality.swag.organizations.model.Role;
import dev.vality.swag.organizations.model.RoleAvailableListResult;
import dev.vality.swag.organizations.model.RoleId;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

View File

@ -1,17 +1,17 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.orgmanager.converter.MemberConverter;
import com.rbkmoney.orgmanager.converter.MemberRoleConverter;
import com.rbkmoney.orgmanager.converter.OrganizationConverter;
import com.rbkmoney.orgmanager.entity.*;
import com.rbkmoney.orgmanager.exception.AccessDeniedException;
import com.rbkmoney.orgmanager.exception.LastRoleException;
import com.rbkmoney.orgmanager.exception.ResourceNotFoundException;
import com.rbkmoney.orgmanager.repository.MemberContextRepository;
import com.rbkmoney.orgmanager.repository.MemberRepository;
import com.rbkmoney.orgmanager.repository.OrganizationRepository;
import com.rbkmoney.orgmanager.service.dto.MemberWithRoleDto;
import com.rbkmoney.swag.organizations.model.*;
import dev.vality.orgmanager.converter.MemberConverter;
import dev.vality.orgmanager.converter.MemberRoleConverter;
import dev.vality.orgmanager.converter.OrganizationConverter;
import dev.vality.orgmanager.entity.*;
import dev.vality.orgmanager.exception.AccessDeniedException;
import dev.vality.orgmanager.exception.LastRoleException;
import dev.vality.orgmanager.exception.ResourceNotFoundException;
import dev.vality.orgmanager.repository.MemberContextRepository;
import dev.vality.orgmanager.repository.MemberRepository;
import dev.vality.orgmanager.repository.OrganizationRepository;
import dev.vality.orgmanager.service.dto.MemberWithRoleDto;
import dev.vality.swag.organizations.model.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.keycloak.representations.AccessToken;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
public interface PartyManagementService {

View File

@ -1,13 +1,13 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.damsel.domain.PartyContactInfo;
import com.rbkmoney.damsel.payment_processing.ExternalUser;
import com.rbkmoney.damsel.payment_processing.PartyExists;
import com.rbkmoney.damsel.payment_processing.PartyManagementSrv;
import com.rbkmoney.damsel.payment_processing.PartyParams;
import com.rbkmoney.damsel.payment_processing.UserInfo;
import com.rbkmoney.damsel.payment_processing.UserType;
import com.rbkmoney.orgmanager.exception.PartyManagementException;
import dev.vality.damsel.domain.PartyContactInfo;
import dev.vality.damsel.payment_processing.ExternalUser;
import dev.vality.damsel.payment_processing.PartyExists;
import dev.vality.damsel.payment_processing.PartyManagementSrv;
import dev.vality.damsel.payment_processing.PartyParams;
import dev.vality.damsel.payment_processing.UserInfo;
import dev.vality.damsel.payment_processing.UserType;
import dev.vality.orgmanager.exception.PartyManagementException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.thrift.TException;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.orgmanager.service.dto.ResourceDto;
import dev.vality.orgmanager.service.dto.ResourceDto;
public interface ResourceAccessService {

View File

@ -1,14 +1,14 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.orgmanager.config.properties.AccessProperties;
import com.rbkmoney.orgmanager.exception.AccessDeniedException;
import com.rbkmoney.orgmanager.service.dto.BouncerContextDto;
import com.rbkmoney.orgmanager.service.dto.InvitationDto;
import com.rbkmoney.orgmanager.service.dto.ResourceDto;
import com.rbkmoney.orgmanager.service.dto.RoleDto;
import com.rbkmoney.orgmanager.util.StackUtils;
import com.rbkmoney.swag.organizations.model.MemberRole;
import com.rbkmoney.swag.organizations.model.MemberRoleScope;
import dev.vality.orgmanager.config.properties.AccessProperties;
import dev.vality.orgmanager.exception.AccessDeniedException;
import dev.vality.orgmanager.service.dto.BouncerContextDto;
import dev.vality.orgmanager.service.dto.InvitationDto;
import dev.vality.orgmanager.service.dto.ResourceDto;
import dev.vality.orgmanager.service.dto.RoleDto;
import dev.vality.orgmanager.util.StackUtils;
import dev.vality.swag.organizations.model.MemberRole;
import dev.vality.swag.organizations.model.MemberRoleScope;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

View File

@ -0,0 +1,9 @@
package dev.vality.orgmanager.service;
import dev.vality.orgmanager.service.model.UserInfo;
public interface UserService {
UserInfo findById(String id);
}

View File

@ -1,10 +1,8 @@
package com.rbkmoney.orgmanager.service;
package dev.vality.orgmanager.service;
import com.rbkmoney.bouncer.context.v1.Organization;
import com.rbkmoney.bouncer.context.v1.User;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import com.rbkmoney.orgmanager.service.model.UserInfo;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.entity.OrganizationEntity;
import dev.vality.orgmanager.service.model.UserInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.service.dto;
package dev.vality.orgmanager.service.dto;
import lombok.Builder;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.service.dto;
package dev.vality.orgmanager.service.dto;
import lombok.Builder;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.service.dto;
package dev.vality.orgmanager.service.dto;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.service.dto;
package dev.vality.orgmanager.service.dto;
public interface MemberWithRoleDto {

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.service.dto;
package dev.vality.orgmanager.service.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.service.dto;
package dev.vality.orgmanager.service.dto;
import lombok.Builder;
import lombok.Data;

View File

@ -1,7 +1,7 @@
package com.rbkmoney.orgmanager.service.model;
package dev.vality.orgmanager.service.model;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.entity.OrganizationEntity;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@ -1,8 +1,8 @@
package com.rbkmoney.orgmanager.servlet;
package dev.vality.orgmanager.servlet;
import com.rbkmoney.orgmanagement.AuthContextProviderSrv;
import com.rbkmoney.woody.api.trace.context.metadata.user.UserIdentityEmailExtensionKit;
import com.rbkmoney.woody.thrift.impl.http.THServiceBuilder;
import dev.vality.orgmanagement.AuthContextProviderSrv;
import dev.vality.woody.api.trace.context.metadata.user.UserIdentityEmailExtensionKit;
import dev.vality.woody.thrift.impl.http.THServiceBuilder;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.util;
package dev.vality.orgmanager.util;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.util;
package dev.vality.orgmanager.util;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

View File

@ -10,9 +10,6 @@ management:
port: '@management.port@'
metrics:
export:
statsd:
flavor: etsy
enabled: false
prometheus:
enabled: false
endpoint:
@ -52,7 +49,7 @@ spring:
password: changeit
hibernate:
physical_naming_strategy: com.rbkmoney.orgmanager.entity.naming.SnakeCaseNamingStrategy
physical_naming_strategy: dev.vality.orgmanager.entity.naming.SnakeCaseNamingStrategy
info:
version: '@project.version@'

View File

@ -1,16 +1,17 @@
package com.rbkmoney.orgmanager;
package dev.vality.orgmanager;
import com.rbkmoney.bouncer.context.v1.Organization;
import com.rbkmoney.bouncer.context.v1.*;
import com.rbkmoney.orgmanager.entity.InvitationEntity;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import com.rbkmoney.orgmanager.entity.OrganizationRoleEntity;
import com.rbkmoney.orgmanager.service.dto.BouncerContextDto;
import com.rbkmoney.orgmanager.service.dto.RoleDto;
import com.rbkmoney.swag.organizations.model.Invitee;
import com.rbkmoney.swag.organizations.model.*;
import dev.vality.bouncer.base.Entity;
import dev.vality.bouncer.context.v1.Organization;
import dev.vality.bouncer.context.v1.*;
import dev.vality.orgmanager.entity.InvitationEntity;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.entity.OrganizationEntity;
import dev.vality.orgmanager.entity.OrganizationRoleEntity;
import dev.vality.orgmanager.service.dto.BouncerContextDto;
import dev.vality.orgmanager.service.dto.RoleDto;
import dev.vality.swag.organizations.model.Invitee;
import dev.vality.swag.organizations.model.*;
import org.keycloak.representations.AccessToken;
import java.time.LocalDateTime;

View File

@ -1,8 +1,8 @@
package com.rbkmoney.orgmanager.controller;
package dev.vality.orgmanager.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rbkmoney.orgmanager.repository.AbstractRepositoryTest;
import com.rbkmoney.orgmanager.service.ResourceAccessService;
import dev.vality.orgmanager.repository.AbstractRepositoryTest;
import dev.vality.orgmanager.service.ResourceAccessService;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.controller;
package dev.vality.orgmanager.controller;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.controller;
package dev.vality.orgmanager.controller;
import static com.github.tomakehurst.wiremock.client.WireMock.*;

View File

@ -1,4 +1,4 @@
package com.rbkmoney.orgmanager.controller;
package dev.vality.orgmanager.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.TestConfiguration;

View File

@ -1,16 +1,16 @@
package com.rbkmoney.orgmanager.controller;
package dev.vality.orgmanager.controller;
import com.rbkmoney.orgmanager.TestObjectFactory;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import com.rbkmoney.orgmanager.exception.AccessDeniedException;
import com.rbkmoney.orgmanager.exception.BouncerException;
import com.rbkmoney.orgmanager.service.dto.ResourceDto;
import com.rbkmoney.orgmanager.util.TestData;
import com.rbkmoney.swag.organizations.model.InvitationRequest;
import com.rbkmoney.swag.organizations.model.MemberRole;
import com.rbkmoney.swag.organizations.model.RoleId;
import dev.vality.orgmanager.TestObjectFactory;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.entity.OrganizationEntity;
import dev.vality.orgmanager.exception.AccessDeniedException;
import dev.vality.orgmanager.exception.BouncerException;
import dev.vality.orgmanager.service.dto.ResourceDto;
import dev.vality.orgmanager.util.TestData;
import dev.vality.swag.organizations.model.InvitationRequest;
import dev.vality.swag.organizations.model.MemberRole;
import dev.vality.swag.organizations.model.RoleId;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentMatchers;
import org.springframework.transaction.annotation.Transactional;

View File

@ -1,10 +1,10 @@
package com.rbkmoney.orgmanager.controller;
package dev.vality.orgmanager.controller;
import com.rbkmoney.orgmanager.entity.*;
import com.rbkmoney.orgmanager.exception.AccessDeniedException;
import com.rbkmoney.orgmanager.exception.ResourceNotFoundException;
import com.rbkmoney.orgmanager.service.dto.ResourceDto;
import com.rbkmoney.swag.organizations.model.*;
import dev.vality.orgmanager.entity.*;
import dev.vality.orgmanager.exception.AccessDeniedException;
import dev.vality.orgmanager.exception.ResourceNotFoundException;
import dev.vality.orgmanager.service.dto.ResourceDto;
import dev.vality.swag.organizations.model.*;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentMatchers;
import org.springframework.http.MediaType;
@ -17,8 +17,8 @@ import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import static com.rbkmoney.orgmanager.TestObjectFactory.*;
import static com.rbkmoney.orgmanager.controller.JwtTokenBuilder.DEFAULT_EMAIL;
import static dev.vality.orgmanager.TestObjectFactory.*;
import static dev.vality.orgmanager.controller.JwtTokenBuilder.DEFAULT_EMAIL;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.doThrow;

View File

@ -1,14 +1,14 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.bouncer.context.v1.Entity;
import com.rbkmoney.bouncer.context.v1.OrgRole;
import com.rbkmoney.bouncer.context.v1.OrgRoleScope;
import com.rbkmoney.bouncer.context.v1.User;
import com.rbkmoney.orgmanager.TestObjectFactory;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import com.rbkmoney.swag.organizations.model.RoleId;
import dev.vality.bouncer.base.Entity;
import dev.vality.bouncer.context.v1.OrgRole;
import dev.vality.bouncer.context.v1.OrgRoleScope;
import dev.vality.bouncer.context.v1.User;
import dev.vality.orgmanager.TestObjectFactory;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.entity.OrganizationEntity;
import dev.vality.swag.organizations.model.RoleId;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@ -1,11 +1,11 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rbkmoney.orgmanager.config.properties.InviteTokenProperties;
import com.rbkmoney.orgmanager.entity.InvitationEntity;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.orgmanager.util.JsonMapper;
import com.rbkmoney.swag.organizations.model.*;
import dev.vality.orgmanager.config.properties.InviteTokenProperties;
import dev.vality.orgmanager.entity.InvitationEntity;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.util.JsonMapper;
import dev.vality.swag.organizations.model.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@ -1,10 +1,10 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.orgmanager.entity.MemberEntity;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import com.rbkmoney.swag.organizations.model.Member;
import com.rbkmoney.swag.organizations.model.MemberRole;
import dev.vality.orgmanager.entity.MemberEntity;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.orgmanager.entity.OrganizationEntity;
import dev.vality.swag.organizations.model.Member;
import dev.vality.swag.organizations.model.MemberRole;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@ -1,10 +1,10 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.orgmanager.entity.MemberRoleEntity;
import com.rbkmoney.swag.organizations.model.MemberRole;
import com.rbkmoney.swag.organizations.model.MemberRoleScope;
import com.rbkmoney.swag.organizations.model.ResourceScopeId;
import com.rbkmoney.swag.organizations.model.RoleId;
import dev.vality.orgmanager.entity.MemberRoleEntity;
import dev.vality.swag.organizations.model.MemberRole;
import dev.vality.swag.organizations.model.MemberRoleScope;
import dev.vality.swag.organizations.model.ResourceScopeId;
import dev.vality.swag.organizations.model.RoleId;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@ -1,10 +1,10 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rbkmoney.orgmanager.entity.OrganizationEntity;
import com.rbkmoney.orgmanager.entity.OrganizationRoleEntity;
import com.rbkmoney.orgmanager.util.JsonMapper;
import com.rbkmoney.swag.organizations.model.Organization;
import dev.vality.orgmanager.entity.OrganizationEntity;
import dev.vality.orgmanager.entity.OrganizationRoleEntity;
import dev.vality.orgmanager.util.JsonMapper;
import dev.vality.swag.organizations.model.Organization;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@ -1,10 +1,10 @@
package com.rbkmoney.orgmanager.converter;
package dev.vality.orgmanager.converter;
import com.rbkmoney.orgmanager.entity.OrganizationRoleEntity;
import com.rbkmoney.orgmanager.entity.ScopeEntity;
import com.rbkmoney.swag.organizations.model.ResourceScopeId;
import com.rbkmoney.swag.organizations.model.Role;
import com.rbkmoney.swag.organizations.model.RoleId;
import dev.vality.orgmanager.entity.OrganizationRoleEntity;
import dev.vality.orgmanager.entity.ScopeEntity;
import dev.vality.swag.organizations.model.ResourceScopeId;
import dev.vality.swag.organizations.model.Role;
import dev.vality.swag.organizations.model.RoleId;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,6 @@
package com.rbkmoney.orgmanager.repository;
package dev.vality.orgmanager.repository;
import com.rbkmoney.orgmanager.OrgManagerApplication;
import dev.vality.orgmanager.OrgManagerApplication;
import org.junit.ClassRule;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
@ -56,7 +56,7 @@ public abstract class AbstractRepositoryTest {
@ClassRule
@SuppressWarnings("rawtypes")
public static PostgreSQLContainer postgres = new PostgreSQLContainer<>("postgres:9.6")
public static PostgreSQLContainer postgres = new PostgreSQLContainer<>("postgres:13.6")
.withStartupTimeout(Duration.ofMinutes(5));
public static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {

Some files were not shown because too many files have changed in this diff Show More