Commit 41cbdd4b authored by Aman Verma's avatar Aman Verma
Browse files

adding values in application.properties

parent 47b37c56
Pipeline #62271 failed with stages
in 8 minutes and 28 seconds
......@@ -20,7 +20,7 @@ public class AuthorizationServiceForServicePrincipalImpl implements IAuthorizati
private DpsHeaders headers;
@Value("${aws.dynamodb.region}")
@Value("${aws.region}")
private String awsRegion;
@Value("${aws.environment}")
......
......@@ -16,14 +16,10 @@ import java.util.Objects;
public class PropertiesConfiguration {
private String googleAudiences;
private List<String> partitionAdminAccounts;
private List<String> adminAccounts;
private String googleCloudProject;
private int cacheExpiration;
private int cacheMaxSize;
private String serviceAccountTail;
@PostConstruct
......
......@@ -40,7 +40,7 @@ public class AuthorizationServiceForServicePrincipalImpl implements IAuthorizati
throw AppException.createUnauthorized("Unauthorized. The JWT token could not be validated");
}
email = googleIdToken.getPayload().getEmail();
List<String> partitionAdminAccounts = configuration.getPartitionAdminAccounts();
List<String> partitionAdminAccounts = configuration.getAdminAccounts();
if (Objects.nonNull(partitionAdminAccounts) && !partitionAdminAccounts.isEmpty()) {
return isAllowedAccount(email);
} else {
......@@ -61,7 +61,7 @@ public class AuthorizationServiceForServicePrincipalImpl implements IAuthorizati
private boolean isAllowedAccount(String accountEmail) {
if (StringUtils.endsWith(accountEmail, configuration.getServiceAccountTail())) {
for (String partitionAdmin : configuration.getPartitionAdminAccounts()) {
for (String partitionAdmin : configuration.getAdminAccounts()) {
if (partitionAdmin.equals(accountEmail)) {
return true;
}
......
......@@ -13,7 +13,10 @@ LOG_PREFIX=schema
shared.tenant.name=common
google.audiences=123.apps.googleusercontent.com
admin-accounts=osdu-gcp-sa
partition.api=http://localhost:8081/api/partition/v1
gcp.schema-changed.messagingEnabled=false
gcp.schema-changed.topicName=topicName
\ No newline at end of file
gcp.schema-changed.topicName=topicName
GOOGLE_CLOUD_PROJECT=${google-cloud-project:opendes}
\ No newline at end of file
......@@ -16,7 +16,7 @@ import org.springframework.web.context.annotation.RequestScope;
@RequestScope
@Slf4j
public class AuthorizationServiceForServicePrincipalImpl implements IAuthorizationServiceForServicePrincipal {
@Value("${service.partition.admin.user}")
@Value("${service.admin.user}")
String partitionAdminUser;
......
......@@ -21,6 +21,7 @@ ibm.tenant.db.name=TODO
spring.main.allow-bean-definition-overriding=true
service.admin.user=partition-service-admin@in.ibm.com
# Use this property to name your shared tenant name
shared.tenant.name=common
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment