Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix merge conflicts from PRs Listed Below #86

Merged
merged 3 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package com.cyberark.conjur.springboot.core.env;

import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -21,6 +26,7 @@
*
*/
public class ConjurConnectionManager implements EnvironmentAware, BeanFactoryPostProcessor {
private static ConjurConnectionManager conjurConnectionInstance = null;

private static final Logger logger = LoggerFactory.getLogger(ConjurConnectionManager.class);
private Environment environment;
Expand Down Expand Up @@ -84,16 +90,19 @@ else if (StringUtils.isNotEmpty(System.getenv().get("CONJUR_CERT_FILE"))){
}
}

private String obfuscateString(String str) {
int len = str.length();
if (len <= 2) {
return str;
} else {
char first = str.charAt(0);
char last = str.charAt(len - 1);
String middle = "*******";
return first + middle + last;
/**
* method to create instance of class and checking for multiple threads.
* @return unique instance of class.
*/
public static ConjurConnectionManager getInstance() {
if (conjurConnectionInstance == null) {
synchronized (ConjurConnectionManager.class) {
if (conjurConnectionInstance == null) {
conjurConnectionInstance = new ConjurConnectionManager();
}
}
}
return conjurConnectionInstance;
}

private String obfuscateString(String str) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ public String[] getPropertyNames() {

@Override
public Object getProperty(String key) {
String secretValue;
key = ConjurConfig.getInstance().mapProperty(key);

ConjurConnectionManager.getInstance();
Expand Down Expand Up @@ -177,8 +176,4 @@ private boolean propertyExists(String key) {
return properties.stream()
.anyMatch(property -> property.contains(key));
}

public void setSecretsApi(SecretsApi secretsApi) {
this.secretsApi = secretsApi;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ConjurRetrieveSecretService {

private static final Logger logger = LoggerFactory.getLogger(ConjurRetrieveSecretService.class);

private final SecretsApi secretsApi;
private SecretsApi secretsApi;

public ConjurRetrieveSecretService(SecretsApi secretsApi) {
this.secretsApi = secretsApi;
Expand Down