Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to production #3705

Merged
merged 24 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3b3ea94
hotfixes for input validations for all readings endpoints
Baalmart Oct 16, 2024
f5e7804
Update device registry staging image tag to stage-42690b37-1729375485
github-actions[bot] Oct 19, 2024
2295d07
Update AirQo exceedance production image tag to prod-c73a134b-1729375524
github-actions[bot] Oct 19, 2024
932ec80
Update KCCA exceedance production image tag to prod-c73a134b-1729375524
github-actions[bot] Oct 19, 2024
0c74a21
Update auth service production image tag to prod-c73a134b-1729375524
github-actions[bot] Oct 19, 2024
669d2c9
Update device registry production image tag to prod-c73a134b-1729375524
github-actions[bot] Oct 19, 2024
540f5f1
Update workflows prod image tag to prod-c73a134b-1729375524
github-actions[bot] Oct 19, 2024
4ab81d5
Update spatial production image tag to prod-c73a134b-1729375524
github-actions[bot] Oct 19, 2024
131d041
Update analytics production image tag to prod-c73a134b-1729375524
github-actions[bot] Oct 19, 2024
c02f824
Update predict production image tag to prod-c73a134b-1729375524
github-actions[bot] Oct 19, 2024
2ece323
enhanced validation for creating default preferences
Baalmart Oct 20, 2024
38c517f
more enhancements for selected sites validation middleware
Baalmart Oct 20, 2024
cb49581
increasing the maintanability of input validation for preferences
Baalmart Oct 20, 2024
f07953d
more enhancements to improve maintainability of preferences
Baalmart Oct 20, 2024
9d163e2
This adjustment ensures that null values do not pass the validation c…
Baalmart Oct 20, 2024
9f8b0e5
This ensures that site_id is a string containing meaningful data.
Baalmart Oct 20, 2024
d086474
Removing Unused Imports for Cleaner Code
Baalmart Oct 20, 2024
7362e4d
prevents potential issues arising from type coercion, making the code…
Baalmart Oct 20, 2024
3681482
make it easier to add or modify allowed tenants without changing the …
Baalmart Oct 20, 2024
03191d9
Merge pull request #3699 from airqo-platform/hf-input-validations
Baalmart Oct 20, 2024
7d951fa
Merge branch 'staging' into en-validation
Baalmart Oct 20, 2024
d207eae
Update auth service staging image tag to stage-03191d9c-1729435343
github-actions[bot] Oct 20, 2024
c8fa4e6
Refactor and enhance validateOptionalObjectId middleware with compreh…
Baalmart Oct 20, 2024
c9289e1
Merge pull request #3677 from airqo-platform/en-validation
Baalmart Oct 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion k8s/analytics/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ images:
celeryWorker: eu.gcr.io/airqo-250220/airqo-analytics-celery-worker
reportJob: eu.gcr.io/airqo-250220/airqo-analytics-report-job
devicesSummaryJob: eu.gcr.io/airqo-250220/airqo-analytics-devices-summary-job
tag: prod-d0d63dbd-1729340566
tag: prod-c73a134b-1729375524
api:
name: airqo-analytics-api
label: analytics-api
Expand Down
2 changes: 1 addition & 1 deletion k8s/auth-service/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app:
replicaCount: 3
image:
repository: eu.gcr.io/airqo-250220/airqo-auth-api
tag: prod-d0d63dbd-1729340566
tag: prod-c73a134b-1729375524
nameOverride: ''
fullnameOverride: ''
podAnnotations: {}
Expand Down
2 changes: 1 addition & 1 deletion k8s/auth-service/values-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app:
replicaCount: 2
image:
repository: eu.gcr.io/airqo-250220/airqo-stage-auth-api
tag: stage-6fb34054-1729313663
tag: stage-03191d9c-1729435343
nameOverride: ''
fullnameOverride: ''
podAnnotations: {}
Expand Down
2 changes: 1 addition & 1 deletion k8s/device-registry/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app:
replicaCount: 3
image:
repository: eu.gcr.io/airqo-250220/airqo-device-registry-api
tag: prod-d0d63dbd-1729340566
tag: prod-c73a134b-1729375524
nameOverride: ''
fullnameOverride: ''
podAnnotations: {}
Expand Down
2 changes: 1 addition & 1 deletion k8s/device-registry/values-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app:
replicaCount: 2
image:
repository: eu.gcr.io/airqo-250220/airqo-stage-device-registry-api
tag: stage-f5ce3fc9-1729339366
tag: stage-42690b37-1729375485
nameOverride: ''
fullnameOverride: ''
podAnnotations: {}
Expand Down
2 changes: 1 addition & 1 deletion k8s/exceedance/values-prod-airqo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ app:
configmap: env-exceedance-production
image:
repository: eu.gcr.io/airqo-250220/airqo-exceedance-job
tag: prod-d0d63dbd-1729340566
tag: prod-c73a134b-1729375524
nameOverride: ''
fullnameOverride: ''
2 changes: 1 addition & 1 deletion k8s/exceedance/values-prod-kcca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ app:
configmap: env-exceedance-production
image:
repository: eu.gcr.io/airqo-250220/kcca-exceedance-job
tag: prod-d0d63dbd-1729340566
tag: prod-c73a134b-1729375524
nameOverride: ''
fullnameOverride: ''
2 changes: 1 addition & 1 deletion k8s/predict/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ images:
predictJob: eu.gcr.io/airqo-250220/airqo-predict-job
trainJob: eu.gcr.io/airqo-250220/airqo-train-job
predictPlaces: eu.gcr.io/airqo-250220/airqo-predict-places-air-quality
tag: prod-d0d63dbd-1729340566
tag: prod-c73a134b-1729375524
api:
name: airqo-prediction-api
label: prediction-api
Expand Down
2 changes: 1 addition & 1 deletion k8s/spatial/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app:
replicaCount: 3
image:
repository: eu.gcr.io/airqo-250220/airqo-spatial-api
tag: prod-d0d63dbd-1729340566
tag: prod-c73a134b-1729375524
nameOverride: ''
fullnameOverride: ''
podAnnotations: {}
Expand Down
2 changes: 1 addition & 1 deletion k8s/workflows/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ images:
initContainer: eu.gcr.io/airqo-250220/airqo-workflows-xcom
redisContainer: eu.gcr.io/airqo-250220/airqo-redis
containers: eu.gcr.io/airqo-250220/airqo-workflows
tag: prod-d0d63dbd-1729340566
tag: prod-c73a134b-1729375524
nameOverride: ''
fullnameOverride: ''
podAnnotations: {}
Expand Down
57 changes: 57 additions & 0 deletions src/auth-service/middleware/test/ut_setDefaultTenant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
require("module-alias/register");
const { expect } = require("chai");
const sinon = require("sinon");
const setDefaultTenant = require("@middleware/setDefaultTenant");
const constants = require("@config/constants");

describe("setDefaultTenant Middleware", () => {
let req, res, next;

beforeEach(() => {
req = {
query: {},
};
res = {};
next = sinon.stub();
});

afterEach(() => {
sinon.restore(); // Restore the original functionality of stubbed methods
});

it("should set the default tenant if tenant is empty", () => {
// Set up the constant for testing
constants.DEFAULT_TENANT = "defaultTenant";

const middleware = setDefaultTenant;
middleware(req, res, next);

expect(req.query.tenant).to.equal("defaultTenant");
expect(next.calledOnce).to.be.true; // Ensure next() is called
});

it("should keep the existing tenant if provided", () => {
req.query.tenant = "customTenant";

const middleware = setDefaultTenant;
middleware(req, res, next);

expect(req.query.tenant).to.equal("customTenant");
expect(next.calledOnce).to.be.true; // Ensure next() is called
});

it("should use 'airqo' as the default tenant if no constant is defined", () => {
// Temporarily remove DEFAULT_TENANT for this test
const originalDefaultTenant = constants.DEFAULT_TENANT;
delete constants.DEFAULT_TENANT;

const middleware = setDefaultTenant;
middleware(req, res, next);

expect(req.query.tenant).to.equal("airqo");
expect(next.calledOnce).to.be.true; // Ensure next() is called

// Restore the original constant value after test
constants.DEFAULT_TENANT = originalDefaultTenant;
});
});
Loading
Loading