Skip to content

Commit

Permalink
validate provided iam port (#314)
Browse files Browse the repository at this point in the history
Co-authored-by: sergiyv-bitquill <[email protected]>
  • Loading branch information
sergiyvamz and sergiyv-improving authored Nov 15, 2024
1 parent 22b7b0e commit c1454f2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions common/lib/utils/iam_auth_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ export class IamAuthUtils {

public static getIamPort(props: Map<string, any>, hostInfo: HostInfo, defaultPort: number): number {
const port = WrapperProperties.IAM_DEFAULT_PORT.get(props);
if (port > 0) {
return port;
} else {
logger.debug(Messages.get("Authentication.invalidPort", isNaN(port) ? "-1" : String(port)));
if (port) {
if (isNaN(port) || port <= 0) {
logger.debug(Messages.get("Authentication.invalidPort", isNaN(port) ? "-1" : String(port)));
} else {
return port;
}
}

if (hostInfo.isPortSpecified()) {
Expand Down

0 comments on commit c1454f2

Please sign in to comment.