corebasic 1.0.106 → 1.0.107

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/libs/features.js CHANGED
@@ -161,6 +161,8 @@ export const start = async (app, url, file) => {
161
161
  // Subscribe to each topic
162
162
  for (let topic of kafkaTopics) {
163
163
  Kafka.receive(`Features.${topic}`, async (topic, message) => {
164
+ if (Utils.isEmpty(message.meta.company))
165
+ message.meta = { ...message.meta, company: "GLOBAL", outlet: "GLOBAL" }
164
166
 
165
167
  const timer = ms => new Promise(res => setTimeout(res, ms)) // A promise that resolves after "ms" Milliseconds
166
168
  topic = topic.replace(/^.*Features./,'')
package/libs/session.js CHANGED
@@ -22,6 +22,8 @@ export const start = (expressApp, allowedUrls) => {
22
22
 
23
23
  // return next() // Disable session
24
24
 
25
+ let allowedDefaults = req.url === '/features' || req.url.startsWith('/messages/')
26
+
25
27
  if (urlsAllowed.includes(req.path))
26
28
  return next()
27
29
 
@@ -30,7 +32,7 @@ export const start = (expressApp, allowedUrls) => {
30
32
  const service = req.header('SERVICE'); // Case insensitive search
31
33
  if (service && jwt.verify(token, DEPLOY_TOKEN_SECRET))
32
34
  return next()
33
- else if (jwt.verify(token, ACCESS_TOKEN_SECRET) && (process.env.GRANT_FULL_ACCESS || await Privilege.checkRequest(req)))
35
+ else if (jwt.verify(token, ACCESS_TOKEN_SECRET) && (process.env.GRANT_FULL_ACCESS || allowedDefaults || await Privilege.checkRequest(req)))
34
36
  return next()
35
37
  throw null;
36
38
  } catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.106",
4
+ "version": "1.0.107",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {