Skip to content
Snippets Groups Projects
Commit aafd78e9 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4606 complete configuration of user service

parent 64b82f5c
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,7 @@ public class OzgCloudClientAutoConfiguration {
private static final String CLIENT_NAME_VORGANG_MANAGER = "vorgang-manager";
private static final String CLIENT_NAME_FILE_MANAGER = "file-manager";
private static final String CLIENT_NAME_COMMAND_MANAGER = "command-manager";
private static final String CLIENT_NAME_USER_MANAGER = "user-manager";
@Autowired
private OzgCloudVorgangManagerProperties vorgangManagerProperties;
......@@ -59,6 +60,8 @@ public class OzgCloudClientAutoConfiguration {
private OzgCloudFileManagerProperties fileManagerProperties;
@Autowired
private OzgCloudCommandManagerProperties commandManagerProperties;
@Autowired
private OzgCloudUserManagerProperties userManagerProperties;
// @Bean
// @ConditionalOnProperty("ozgcloud.vorgang-manager.address")
......@@ -82,6 +85,23 @@ public class OzgCloudClientAutoConfiguration {
return properties;
}
@Bean
@ConditionalOnProperty("ozgcloud.user-manager.address")
GrpcChannelsProperties userManagerProperties() {
var properties = new GrpcChannelsProperties();
var clientMap = properties.getClient();
addUserManager(clientMap);
return properties;
}
private void addUserManager(Map<String, GrpcChannelProperties> clientMap) {
var channelProps = new GrpcChannelProperties();
channelProps.setAddress(userManagerProperties.getAddress());
channelProps.setNegotiationType(userManagerProperties.getNegotiationType());
clientMap.put(CLIENT_NAME_USER_MANAGER, channelProps);
}
private void addVorgangManager(Map<String, GrpcChannelProperties> clientMap) {
var channelProps = new GrpcChannelProperties();
channelProps.setAddress(vorgangManagerProperties.getAddress());
......
package de.ozgcloud.client.autoconfigure;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import lombok.Getter;
import lombok.Setter;
import net.devh.boot.grpc.client.config.NegotiationType;
@Getter
@Setter
@Configuration
@ConfigurationProperties("ozgcloud.vorgang-manager")
public class OzgCloudUserManagerProperties {
/**
* Network-Address of the User-Manager instance, starting with resolving
* protocoll.
*/
private String address;
/**
* Negotiation Type for the gRPC connection - possible Values: PLAINTEXT, TLS
*/
private NegotiationType negotiationType = NegotiationType.valueOf("TLS");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment