INFRA-1896 | Harinder | Bug fix: Fetching env vars from paths causing issues in OKTA_GROUP_MAPPING

This commit is contained in:
Harinder Singh
2023-07-04 16:48:57 +05:30
parent 2023ed0c27
commit f9d817da3d
6 changed files with 15 additions and 11 deletions

View File

@@ -97,6 +97,10 @@
{
"name": "JWT_SECRET_KEY",
"value": "$JWT_SECRET_KEY"
},
{
"name": "TEAMS_LIST_VAULT",
"value": "$TEAMS_LIST_VAULT"
}
],
"namespace": "$NAMESPACE",

View File

@@ -19,8 +19,8 @@ public class TeamConfiguration {
private final TeamRepository teamRepository;
@Value("${slack.teams.mapping}")
private String[] slackTeamMappings;
@Value("${teams.list.vault}")
private String[] teamsListVault;
@Bean
public boolean consolidateTeamListInDBFromVault() {
@@ -42,8 +42,8 @@ public class TeamConfiguration {
// Find diff of team list from Vault and DB
List<String> newTeamList = new ArrayList<>();
log.info("Teams list from Vault: {}", (Object) slackTeamMappings);
for (String team: slackTeamMappings){
log.info("Teams list from Vault: {}", (Object) teamsListVault);
for (String team: teamsListVault){
if(!teamDbMap.containsKey(team)){
newTeamList.add(team);
if (!newTeamsSynced){

View File

@@ -23,5 +23,5 @@ spring.main.allow-bean-definition-overriding=true
#JWT token generation
jwt.secret.key=${JWT_SECRET_KEY}
#Slack teams mapping - Single source of truth for teams
slack.teams.mapping=${SLACK_TEAMS_MAPPING_ARRAY:InsurancePlatform,Co-Lending,IT}
#Teams List from Vault - Single source of truth for teams in vault
teams.list.vault=${TEAMS_LIST_VAULT:InsurancePlatform,Co-Lending,IT}

View File

@@ -60,5 +60,5 @@ manifest.limit.config.path=classpath:changerequest
#JWT token generation
jwt.secret.key=${JWT_SECRET_KEY:'something'}
#Slack teams mapping - Single source of truth for teams
slack.teams.mapping=${SLACK_TEAMS_MAPPING_ARRAY:InsurancePlatform,Co-Lending,IT}
#Teams List from Vault - Single source of truth for teams in vault
teams.list.vault=${TEAMS_LIST_VAULT:InsurancePlatform,Co-Lending,IT}

View File

@@ -38,7 +38,7 @@ class TeamConfigurationTest {
teamList[0] = "IP";
teamList[1] = "Hifi";
ReflectionTestUtils.setField(teamConfiguration,
"slackTeamMappings",
"teamsListVault",
teamList);
}

View File

@@ -46,5 +46,5 @@ spring.main.allow-bean-definition-overriding=true
manifest.limit.config.path=classpath:changerequest
jwt.secret.key=${JWT_SECRET_KEY:test-secret-key}
#Slack teams mapping - Single source of truth for teams
slack.teams.mapping=${SLACK_TEAMS_MAPPING_ARRAY:InsurancePlatform,Co-Lending,IT}
#Teams List from Vault - Single source of truth for teams in vault
teams.list.vault=${TEAMS_LIST_VAULT:InsurancePlatform,Co-Lending,IT}