@Test public void getCredentialSecret() throws Exception { String account = "dev"; String region = "us-east-1"; String application = "membership"; String environment = "environment"; String component = "testComponent"; String shortKey = "shortKey"; Credential expected = new Credential(shortKey,null,account, region, application, environment, component, null, null,"Secret"); Credential actual = credentialsService.getCredentialSecret(account, region, application, environment, component, shortKey); assertEquals(expected.getSecret(), actual.getSecret()); }
@PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account)") public Credential getCredentialSecret(String account, String region, String application, String environment, String component, String shortKey) { setFideliusEnvironment(account, region); String user = fideliusRoleService.getUserProfile().getUserId(); try { if (component != null && (component.isEmpty() || component.equals("null"))) { component = null; } String credentialSecret = fideliusService.getCredential(shortKey, application, environment, component, tableName, user); return new Credential(shortKey,null, account, region, application, environment, component,null,null, credentialSecret); } catch (Exception e) { this.logger.error("Credential not found " + e.toString()); return null; } }
CredentialsService { @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account)") public Credential getCredentialSecret(String account, String region, String application, String environment, String component, String shortKey) { setFideliusEnvironment(account, region); String user = fideliusRoleService.getUserProfile().getUserId(); try { if (component != null && (component.isEmpty() || component.equals("null"))) { component = null; } String credentialSecret = fideliusService.getCredential(shortKey, application, environment, component, tableName, user); return new Credential(shortKey,null, account, region, application, environment, component,null,null, credentialSecret); } catch (Exception e) { this.logger.error("Credential not found " + e.toString()); return null; } } }
CredentialsService { @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account)") public Credential getCredentialSecret(String account, String region, String application, String environment, String component, String shortKey) { setFideliusEnvironment(account, region); String user = fideliusRoleService.getUserProfile().getUserId(); try { if (component != null && (component.isEmpty() || component.equals("null"))) { component = null; } String credentialSecret = fideliusService.getCredential(shortKey, application, environment, component, tableName, user); return new Credential(shortKey,null, account, region, application, environment, component,null,null, credentialSecret); } catch (Exception e) { this.logger.error("Credential not found " + e.toString()); return null; } }  }
CredentialsService { @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account)") public Credential getCredentialSecret(String account, String region, String application, String environment, String component, String shortKey) { setFideliusEnvironment(account, region); String user = fideliusRoleService.getUserProfile().getUserId(); try { if (component != null && (component.isEmpty() || component.equals("null"))) { component = null; } String credentialSecret = fideliusService.getCredential(shortKey, application, environment, component, tableName, user); return new Credential(shortKey,null, account, region, application, environment, component,null,null, credentialSecret); } catch (Exception e) { this.logger.error("Credential not found " + e.toString()); return null; } }  @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account, \"LIST_CREDENTIALS\")") List<Credential> getAllCredentials(String tableName, String account, String region, String application); @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account, \"LIST_CREDENTIALS\")") Credential getCredential(String account, String region, String application, String longKey); @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account, \"LIST_CREDENTIALS\")") List<HistoryEntry> getCredentialHistory(String tableName, String account, String region, String application, String environment, String component, String key); @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account)") Credential getCredentialSecret(String account, String region, String application, String environment,
                                      String component, String shortKey); @PreAuthorize("@fideliusRoleService.isAuthorized(#credential.application, #credential.account)") Credential putCredential(Credential credential); @PreAuthorize("@fideliusRoleService.isAuthorized(#credential.application, #credential.account)") Credential createCredential(Credential credential); @PreAuthorize("@fideliusRoleService.isAuthorizedToDelete(#credential.getApplication(), #credential.getAccount())") Credential deleteCredential(Credential credential); }
CredentialsService { @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account)") public Credential getCredentialSecret(String account, String region, String application, String environment, String component, String shortKey) { setFideliusEnvironment(account, region); String user = fideliusRoleService.getUserProfile().getUserId(); try { if (component != null && (component.isEmpty() || component.equals("null"))) { component = null; } String credentialSecret = fideliusService.getCredential(shortKey, application, environment, component, tableName, user); return new Credential(shortKey,null, account, region, application, environment, component,null,null, credentialSecret); } catch (Exception e) { this.logger.error("Credential not found " + e.toString()); return null; } }  @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account, \"LIST_CREDENTIALS\")") List<Credential> getAllCredentials(String tableName, String account, String region, String application); @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account, \"LIST_CREDENTIALS\")") Credential getCredential(String account, String region, String application, String longKey); @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account, \"LIST_CREDENTIALS\")") List<HistoryEntry> getCredentialHistory(String tableName, String account, String region, String application, String environment, String component, String key); @PreAuthorize("@fideliusRoleService.isAuthorized(#application, #account)") Credential getCredentialSecret(String account, String region, String application, String environment,
                                      String component, String shortKey); @PreAuthorize("@fideliusRoleService.isAuthorized(#credential.application, #credential.account)") Credential putCredential(Credential credential); @PreAuthorize("@fideliusRoleService.isAuthorized(#credential.application, #credential.account)") Credential createCredential(Credential credential); @PreAuthorize("@fideliusRoleService.isAuthorizedToDelete(#credential.getApplication(), #credential.getAccount())") Credential deleteCredential(Credential credential);  }