Browse Source

Fix redaction of symbol profile in activities

pull/7977/head
Thomas Kaul 2 weeks ago
parent
commit
f2870e8549
  1. 40
      apps/api/src/helper/object.helper.spec.ts
  2. 6
      libs/common/src/lib/config.ts

40
apps/api/src/helper/object.helper.spec.ts

@ -3082,6 +3082,20 @@ describe('redactAttributes', () => {
feeInBaseCurrency: 18.2, feeInBaseCurrency: 18.2,
id: '8c623328-6035-4b5f-b6d5-702cc1c9c56b', id: '8c623328-6035-4b5f-b6d5-702cc1c9c56b',
quantity: 50, quantity: 50,
// The relation of the database is part of the response next to the
// asset profile
SymbolProfile: {
comment: 'Reviewed by the administrator',
name: 'Apple Inc',
scraperConfiguration: {
headers: { Authorization: 'Bearer TOKEN' },
mode: 'lazy',
selector: '.price',
url: 'https://example.org/get_price'
},
symbol: 'AAPL',
symbolMapping: { YAHOO: 'AAPL' }
},
type: 'BUY', type: 'BUY',
unitPrice: 220.79, unitPrice: 220.79,
value: 11039.5, value: 11039.5,
@ -3111,6 +3125,13 @@ describe('redactAttributes', () => {
feeInBaseCurrency: null, feeInBaseCurrency: null,
id: '8c623328-6035-4b5f-b6d5-702cc1c9c56b', id: '8c623328-6035-4b5f-b6d5-702cc1c9c56b',
quantity: null, quantity: null,
SymbolProfile: {
comment: null,
name: 'Apple Inc',
scraperConfiguration: null,
symbol: 'AAPL',
symbolMapping: null
},
type: 'BUY', type: 'BUY',
// A price per unit stays visible, like the average price and the market // A price per unit stays visible, like the average price and the market
// price of a holding // price of a holding
@ -3169,6 +3190,18 @@ describe('redactAttributes', () => {
currency: 'USD', currency: 'USD',
fee: 19.9, fee: 19.9,
quantity: 50, quantity: 50,
SymbolProfile: {
comment: 'Reviewed by the administrator',
name: 'Apple Inc',
scraperConfiguration: {
headers: { Authorization: 'Bearer TOKEN' },
mode: 'lazy',
selector: '.price',
url: 'https://example.org/get_price'
},
symbol: 'AAPL',
symbolMapping: { YAHOO: 'AAPL' }
},
type: 'BUY', type: 'BUY',
unitPrice: 220.79, unitPrice: 220.79,
value: 11039.5, value: 11039.5,
@ -3194,6 +3227,13 @@ describe('redactAttributes', () => {
currency: 'USD', currency: 'USD',
fee: null, fee: null,
quantity: null, quantity: null,
SymbolProfile: {
comment: null,
name: 'Apple Inc',
scraperConfiguration: null,
symbol: 'AAPL',
symbolMapping: null
},
type: 'BUY', type: 'BUY',
unitPrice: 220.79, unitPrice: 220.79,
value: null, value: null,

6
libs/common/src/lib/config.ts

@ -138,6 +138,9 @@ export const DEFAULT_REDACTED_PATHS = [
'activities[*].feeInAssetProfileCurrency', 'activities[*].feeInAssetProfileCurrency',
'activities[*].feeInBaseCurrency', 'activities[*].feeInBaseCurrency',
'activities[*].quantity', 'activities[*].quantity',
'activities[*].SymbolProfile.comment',
'activities[*].SymbolProfile.scraperConfiguration',
'activities[*].SymbolProfile.symbolMapping',
'activities[*].value', 'activities[*].value',
'activities[*].valueInBaseCurrency', 'activities[*].valueInBaseCurrency',
'assetProfile.comment', 'assetProfile.comment',
@ -180,6 +183,9 @@ export const DEFAULT_REDACTED_PATHS = [
'settings.emergencyFund', 'settings.emergencyFund',
'settings.projectedTotalAmount', 'settings.projectedTotalAmount',
'settings.savingsRate', 'settings.savingsRate',
'SymbolProfile.comment',
'SymbolProfile.scraperConfiguration',
'SymbolProfile.symbolMapping',
'totalBalanceInBaseCurrency', 'totalBalanceInBaseCurrency',
'totalDividendInBaseCurrency', 'totalDividendInBaseCurrency',
'totalInterestInBaseCurrency', 'totalInterestInBaseCurrency',

Loading…
Cancel
Save