@telia-ace/alliance-internal-node-utilities 1.0.3-next.2 → 1.0.3-next.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @telia-ace/alliance-internal-node-utilities
2
2
 
3
+ ## 1.0.3-next.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 0f20a09: Change to unformatted JSON logs.
8
+
9
+ ## 1.0.3-next.3
10
+
11
+ ### Patch Changes
12
+
13
+ - c9b1488: Add `REDIS_PASSWORD` environment variable.
14
+
3
15
  ## 1.0.3-next.2
4
16
 
5
17
  ### Patch Changes
@@ -5,5 +5,6 @@ export declare enum SharedConfigKeys {
5
5
  JwtPrivateKey = "JWT_PRIVATE_KEY",
6
6
  ServiceLogLevel = "SERVICE_LOG_LEVEL",
7
7
  ServicePort = "SERVICE_PORT",
8
- RedisHost = "REDIS_HOST"
8
+ RedisHost = "REDIS_HOST",
9
+ RedisPassword = "REDIS_PASSWORD"
9
10
  }
package/dist/index.cjs CHANGED
@@ -27,6 +27,7 @@ var SharedConfigKeys = /* @__PURE__ */ ((SharedConfigKeys2) => {
27
27
  SharedConfigKeys2["ServiceLogLevel"] = "SERVICE_LOG_LEVEL";
28
28
  SharedConfigKeys2["ServicePort"] = "SERVICE_PORT";
29
29
  SharedConfigKeys2["RedisHost"] = "REDIS_HOST";
30
+ SharedConfigKeys2["RedisPassword"] = "REDIS_PASSWORD";
30
31
  return SharedConfigKeys2;
31
32
  })(SharedConfigKeys || {});
32
33
 
@@ -47,7 +48,8 @@ function authMiddleware(configService, {
47
48
  issuerBaseURL = "https://127.0.0.1"
48
49
  } = {}) {
49
50
  const redisClient = redis.createClient({
50
- url: configService.getOrThrow(SharedConfigKeys.RedisHost)
51
+ url: configService.getOrThrow(SharedConfigKeys.RedisHost),
52
+ password: configService.get(SharedConfigKeys.RedisPassword)
51
53
  });
52
54
  redisClient.connect().catch(console.error);
53
55
  const redisStore = new RedisStore__default({
@@ -749,14 +751,12 @@ exports.LoggerModule = class LoggerModule {
749
751
  useFactory: async (configService) => ({
750
752
  pinoHttp: {
751
753
  level: logLevel || configService.get(SharedConfigKeys.ServiceLogLevel) || "silent",
752
- redact: redact ? ["authorization", "headers.authorization", "req", "res"] : [],
753
- transport: {
754
- target: "pino-pretty",
755
- options: {
756
- colorize: true,
757
- colorizeObjects: true
758
- }
759
- }
754
+ redact: redact ? [
755
+ "authorization",
756
+ "headers.authorization",
757
+ "req.headers.authorization",
758
+ "res.headers.authorization"
759
+ ] : []
760
760
  }
761
761
  })
762
762
  })
package/dist/index.mjs CHANGED
@@ -21,6 +21,7 @@ var SharedConfigKeys = /* @__PURE__ */ ((SharedConfigKeys2) => {
21
21
  SharedConfigKeys2["ServiceLogLevel"] = "SERVICE_LOG_LEVEL";
22
22
  SharedConfigKeys2["ServicePort"] = "SERVICE_PORT";
23
23
  SharedConfigKeys2["RedisHost"] = "REDIS_HOST";
24
+ SharedConfigKeys2["RedisPassword"] = "REDIS_PASSWORD";
24
25
  return SharedConfigKeys2;
25
26
  })(SharedConfigKeys || {});
26
27
 
@@ -41,7 +42,8 @@ function authMiddleware(configService, {
41
42
  issuerBaseURL = "https://127.0.0.1"
42
43
  } = {}) {
43
44
  const redisClient = createClient({
44
- url: configService.getOrThrow(SharedConfigKeys.RedisHost)
45
+ url: configService.getOrThrow(SharedConfigKeys.RedisHost),
46
+ password: configService.get(SharedConfigKeys.RedisPassword)
45
47
  });
46
48
  redisClient.connect().catch(console.error);
47
49
  const redisStore = new RedisStore({
@@ -743,14 +745,12 @@ let LoggerModule = class {
743
745
  useFactory: async (configService) => ({
744
746
  pinoHttp: {
745
747
  level: logLevel || configService.get(SharedConfigKeys.ServiceLogLevel) || "silent",
746
- redact: redact ? ["authorization", "headers.authorization", "req", "res"] : [],
747
- transport: {
748
- target: "pino-pretty",
749
- options: {
750
- colorize: true,
751
- colorizeObjects: true
752
- }
753
- }
748
+ redact: redact ? [
749
+ "authorization",
750
+ "headers.authorization",
751
+ "req.headers.authorization",
752
+ "res.headers.authorization"
753
+ ] : []
754
754
  }
755
755
  })
756
756
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/alliance-internal-node-utilities",
3
- "version": "1.0.3-next.2",
3
+ "version": "1.0.3-next.4",
4
4
  "description": "Utilities used internally by packages developed by team Alliance.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",
@@ -23,8 +23,6 @@
23
23
  "jsonschema": "^1.4.1",
24
24
  "jsonwebtoken": "^9.0.1",
25
25
  "nestjs-pino": "^3.3.0",
26
- "pino-http": "^8.3.3",
27
- "pino-pretty": "^10.1.0",
28
26
  "redis": "^4.6.8",
29
27
  "slugify": "^1.6.6"
30
28
  },