core-services-sdk 1.3.43 → 1.3.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -21,7 +21,10 @@ const generateMsgId = () => `rbt_${ulid()}`
|
|
|
21
21
|
*/
|
|
22
22
|
export const connectQueueService = async ({ host, log }) => {
|
|
23
23
|
const t0 = Date.now()
|
|
24
|
-
const logger = log.child({
|
|
24
|
+
const logger = log.child({
|
|
25
|
+
op: 'connectQueueService',
|
|
26
|
+
host: mask(host, '.', 3),
|
|
27
|
+
})
|
|
25
28
|
|
|
26
29
|
try {
|
|
27
30
|
logger.debug('start')
|
|
@@ -50,7 +53,7 @@ export const connectQueueService = async ({ host, log }) => {
|
|
|
50
53
|
*/
|
|
51
54
|
export const createChannel = async ({ host, log }) => {
|
|
52
55
|
const t0 = Date.now()
|
|
53
|
-
const logger = log.child({ op: 'createChannel', host: mask(host) })
|
|
56
|
+
const logger = log.child({ op: 'createChannel', host: mask(host, '.', 3) })
|
|
54
57
|
|
|
55
58
|
try {
|
|
56
59
|
logger.debug('start')
|
|
@@ -175,7 +178,7 @@ export const subscribeToQueue = async ({
|
|
|
175
178
|
*/
|
|
176
179
|
export const initializeQueue = async ({ host, log }) => {
|
|
177
180
|
const { channel, connection } = await createChannel({ host, log })
|
|
178
|
-
const logger = log.child({ op: 'initializeQueue', host: mask(host) })
|
|
181
|
+
const logger = log.child({ op: 'initializeQueue', host: mask(host, '.', 3) })
|
|
179
182
|
|
|
180
183
|
/**
|
|
181
184
|
* Publishes a message to a queue with a generated `rbt_<ulid>` ID.
|
|
@@ -87,4 +87,13 @@ describe('mask', () => {
|
|
|
87
87
|
const value = mask(input, '*', 5)
|
|
88
88
|
expect(value).toEqual(expected)
|
|
89
89
|
})
|
|
90
|
+
|
|
91
|
+
it('mask long string with maskLen in recursive calls', () => {
|
|
92
|
+
const input = {
|
|
93
|
+
val: 'abcdsdkljhfjksdhgfjksdghkhsdkjfhasldkjjhskjfgsdkjhgfhskdgfefgh',
|
|
94
|
+
}
|
|
95
|
+
const expected = { val: 'ab***gh' }
|
|
96
|
+
const value = mask(input, '*', 3)
|
|
97
|
+
expect(value).toEqual(expected)
|
|
98
|
+
})
|
|
90
99
|
})
|