Skip to content

Commit

Permalink
Stopped secret placeholder from overriding the client secret and pass…
Browse files Browse the repository at this point in the history
…word in endpoint security
  • Loading branch information
Oshanath committed Sep 30, 2024
1 parent e5d2a9c commit f53d7bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,11 @@ function EndpointOverview(props) {
const saveEndpointSecurityConfig = (endpointSecurityObj, enType) => {
const { type } = endpointSecurityObj;
let newEndpointSecurityObj = endpointSecurityObj;
const secretPlaceholder = '******';
newEndpointSecurityObj.clientSecret = newEndpointSecurityObj.clientSecret
=== secretPlaceholder ? '' : newEndpointSecurityObj.clientSecret;
newEndpointSecurityObj.password = newEndpointSecurityObj.password
=== secretPlaceholder ? '' : newEndpointSecurityObj.password;
if (type === 'NONE') {
newEndpointSecurityObj = { ...CONSTS.DEFAULT_ENDPOINT_SECURITY, type };
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,14 @@ function EndpointSecurity(props) {
const {
type, username, password, grantType, tokenUrl, clientId, clientSecret, customParameters,
} = securityInfo;
const secretPlaceholder = '******';
tmpSecurity.type = type === null ? 'NONE' : type;
tmpSecurity.username = username;
tmpSecurity.password = password === '' ? '**********' : password;
tmpSecurity.password = password === '' ? secretPlaceholder : password;
tmpSecurity.grantType = grantType;
tmpSecurity.tokenUrl = tokenUrl;
tmpSecurity.clientId = clientId === '' ? '********' : clientId;
tmpSecurity.clientSecret = clientSecret === '' ? '********' : clientSecret;
tmpSecurity.clientId = clientId === '' ? secretPlaceholder : clientId;
tmpSecurity.clientSecret = clientSecret === '' ? secretPlaceholder : clientSecret;
tmpSecurity.customParameters = customParameters;
}
setEndpointSecurityInfo(tmpSecurity);
Expand Down

0 comments on commit f53d7bd

Please sign in to comment.