Masking the server configuration for external services

This commit is contained in:
Jose Alberto Hernandez
2024-04-17 07:24:18 -06:00
committed by Jose Alberto Hernandez
parent da10c42bf0
commit c3c74faa4d
2 changed files with 9 additions and 1 deletions
@@ -16,7 +16,7 @@
<ng-container matColumnDef="value">
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Value' | translate}} </th>
<td mat-cell *matCellDef="let configuration"> {{ configuration.value }} </td>
<td mat-cell *matCellDef="let configuration"> {{ getConfigurationValue(configuration) }} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
@@ -49,4 +49,12 @@ export class NotificationComponent implements OnInit {
this.dataSource.sort = this.sort;
}
getConfigurationValue(configuration: any): string {
const value = configuration.value;
if (configuration.name === 'server_key') {
return value.replace(value.substr(1, value.length - 3), value.substr(1, value.length - 3).replace(/./g, '*'));
}
return value;
}
}