Fix jwt-token
This commit is contained in:
@@ -26,7 +26,7 @@ describe('IP Restriction Middleware', () => {
|
|||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: false,
|
ip_restriction_enabled: false,
|
||||||
allowed_ips: '192.168.1.1,10.0.0.1'
|
ip_whitelist: '192.168.1.1,10.0.0.1'
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
@@ -45,7 +45,7 @@ describe('IP Restriction Middleware', () => {
|
|||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: '192.168.1.1,10.0.0.1,127.0.0.1'
|
ip_whitelist: '192.168.1.1,10.0.0.1,127.0.0.1'
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
@@ -64,7 +64,7 @@ describe('IP Restriction Middleware', () => {
|
|||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: '192.168.1.1,10.0.0.1'
|
ip_whitelist: '192.168.1.1,10.0.0.1'
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
@@ -101,7 +101,7 @@ describe('IP Restriction Middleware', () => {
|
|||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: '203.0.113.1'
|
ip_whitelist: '203.0.113.1'
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
@@ -121,7 +121,7 @@ describe('IP Restriction Middleware', () => {
|
|||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: '203.0.113.2'
|
ip_whitelist: '203.0.113.2'
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
@@ -141,7 +141,7 @@ describe('IP Restriction Middleware', () => {
|
|||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: '192.168.1.0/24,10.0.0.0/8'
|
ip_whitelist: '192.168.1.0/24,10.0.0.0/8'
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
@@ -160,7 +160,7 @@ describe('IP Restriction Middleware', () => {
|
|||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: '192.168.1.0/24'
|
ip_whitelist: '192.168.1.0/24'
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
@@ -179,7 +179,7 @@ describe('IP Restriction Middleware', () => {
|
|||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: '192.168.1.1'
|
ip_whitelist: '192.168.1.1'
|
||||||
});
|
});
|
||||||
|
|
||||||
const dockerIPs = ['172.17.0.1', '172.18.0.1', '172.19.0.1'];
|
const dockerIPs = ['172.17.0.1', '172.18.0.1', '172.19.0.1'];
|
||||||
@@ -224,11 +224,11 @@ describe('IP Restriction Middleware', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle empty allowed_ips list', async () => {
|
it('should handle empty ip_whitelist', async () => {
|
||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: ''
|
ip_whitelist: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
@@ -243,11 +243,11 @@ describe('IP Restriction Middleware', () => {
|
|||||||
expect(res.statusCode).to.equal(403);
|
expect(res.statusCode).to.equal(403);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle null allowed_ips', async () => {
|
it('should handle null ip_whitelist', async () => {
|
||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: null
|
ip_whitelist: null
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
@@ -268,7 +268,7 @@ describe('IP Restriction Middleware', () => {
|
|||||||
const tenant = await createTestTenant({
|
const tenant = await createTestTenant({
|
||||||
slug: 'test-tenant',
|
slug: 'test-tenant',
|
||||||
ip_restriction_enabled: true,
|
ip_restriction_enabled: true,
|
||||||
allowed_ips: '192.168.1.1'
|
ip_whitelist: '192.168.1.1'
|
||||||
});
|
});
|
||||||
|
|
||||||
const req = mockRequest({
|
const req = mockRequest({
|
||||||
|
|||||||
Reference in New Issue
Block a user