Skip to content

Commit

Permalink
Merge pull request #768 from Oshanath/main
Browse files Browse the repository at this point in the history
Stopped secret placeholder from overriding the client secret and password in endpoint security
  • Loading branch information
npamudika authored Oct 2, 2024
2 parents d9ee01c + f53d7bd commit fa270fa
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 fa270fa

Please sign in to comment.