Compare commits

..
Author SHA1 Message Date
Victor Radael 09c7cc79ee FIX: Nimbus URL Strategy 2022-05-16 12:04:13 -03:00
5 changed files with 27 additions and 12 deletions
+1
View File
@@ -38,6 +38,7 @@ jobs:
with:
semantic_version: 16
extra_plugins: |
@saithodev/semantic-release-backmerge
conventional-changelog-eslint
branches: |
[
+12
View File
@@ -26,6 +26,18 @@
"preset": "eslint"
}
],
[
"@saithodev/semantic-release-backmerge",
{
"branches": [
{ "from": "main", "to": "alpha" },
{ "from": "main", "to": "beta" }
],
"backmergeStrategy": "merge",
"clearWorkspace": true,
"restoreWorkspace": true
}
],
"@semantic-release/npm",
"@semantic-release/github"
]
+1 -1
View File
@@ -31,7 +31,7 @@
"@nestjs/platform-express": "^8.4.3",
"@nestjs/schedule": "^1.1.0",
"@nestjs/swagger": "^5.2.1",
"@victorradael/protospack": "1.7.4",
"@victorradael/protospack": "^1.7.4",
"axios": "^0.25.0",
"dotenv": "^14.2.0",
"helmet": "^5.0.2",
+7 -2
View File
@@ -31,6 +31,7 @@ export class LoggerMiddleware implements NestMiddleware {
const jwtDecoded: any = decode(idToken);
const permissions = jwtDecoded.user.permissions;
const clienId = jwtDecoded.user.customerId;
const customer = jwtDecoded.user.customer;
const userId = jwtDecoded.user.id;
@@ -38,16 +39,20 @@ export class LoggerMiddleware implements NestMiddleware {
await verifyToken(accessToken);
let havePermission = false;
permissions.forEach((permission) => {
const permission = permissions.find((permission) => {
permission = permission.split('/');
const method = permission[0].trim();
const route = permission[1].trim();
if (method === requiredMethod && route === requiredRoute) {
havePermission = true;
return permission;
}
});
if (permission) {
havePermission = true;
}
if (havePermission) {
request.body.info = {
customer_id: clienId,
+6 -9
View File
@@ -2,15 +2,12 @@ import axios from 'axios';
class CatalogService {
async catalogAll(body) {
const customer =
body.info.customer.toLowerCase() === 'dadosfera'
? ``
: `-${body.info.customer.toLowerCase()}`;
const nimbusUrl =
process.env.ENV === 'prd'
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
if (process.env.ENV !== 'prd') {
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
process.env.ENV
}.dadosfera.ai`;
}
const { data } = await axios.get(`${nimbusUrl}/api/catalog/all/`);