[
https://issues.apache.org/jira/browse/KNOX-2747?focusedWorklogId=775136&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-775136
]
ASF GitHub Bot logged work on KNOX-2747:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/May/22 16:44
Start Date: 26/May/22 16:44
Worklog Time Spent: 10m
Work Description: pzampino commented on code in PR #581:
URL: https://github.com/apache/knox/pull/581#discussion_r882870933
##########
gateway-server/src/test/java/org/apache/knox/gateway/services/security/impl/RemoteAliasServiceTestProvider.java:
##########
@@ -88,7 +88,8 @@ public void removeAliasesForCluster(String clusterName,
Set<String> aliases) thr
@Override
public char[] getPasswordFromAliasForCluster(String clusterName, String
alias) {
- return aliases.getOrDefault(clusterName, new
HashMap<>()).get(alias).toCharArray();
+ String value = aliases.getOrDefault(clusterName, new
HashMap<>()).get(alias);
+ return value == null ? null : value.toCharArray();
Review Comment:
This is only needed now because the password may be null since it's not
ALWAYS being generated?
Issue Time Tracking
-------------------
Worklog Id: (was: 775136)
Time Spent: 20m (was: 10m)
> RemoteAliasService generates password without checking if it already exists
> ---------------------------------------------------------------------------
>
> Key: KNOX-2747
> URL: https://issues.apache.org/jira/browse/KNOX-2747
> Project: Apache Knox
> Issue Type: Bug
> Reporter: Attila Magyar
> Assignee: Attila Magyar
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> RemoteAliasService:
> {code}
> /* Generate a new password */
> if (generate) {
> generateAliasForCluster(clusterName, alias);
> }
> {code}
> DefaultAliasService checks first
> {code}
> credential = keystoreService.getCredentialForCluster(clusterName,
> alias);
> if (credential == null && generate) {
> generateAliasForCluster(clusterName, alias);
> credential = keystoreService.getCredentialForCluster(clusterName,
> alias);
> }
> {code}
> This causes the Pac4jDispatcherFilter to regenerate the password at each
> topology change.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)