Skip to content

Commit c9abb46

Browse files
author
Lasim
committed
feat(all): implement storage-first architecture in BasicInfoStepEdit component
1 parent a501fc8 commit c9abb46

File tree

27 files changed

+1263
-559
lines changed

27 files changed

+1263
-559
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/backend/src/global-settings/global.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ export const globalSettings: GlobalSettingsModule = {
7272
description: 'Send welcome email to users when they verify their email or login via OAuth flows (GitHub, etc.)',
7373
encrypted: false,
7474
required: false
75+
},
76+
{
77+
key: 'global.show_mcp_catalog_banner',
78+
defaultValue: false,
79+
type: 'boolean',
80+
description: 'Show banner during MCP installation to inform users that adding new servers to the DeployStack catalog requires submitting a pull request to the awesome-mcp-server repository',
81+
encrypted: false,
82+
required: false
7583
}
7684
]
7785
};

services/backend/src/routes/users/me/devices/delete.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type FastifyInstance } from 'fastify';
22
import { DeviceService } from '../../../../services/deviceService';
3+
import { getDb } from '../../../../db';
34
import { requireAuthentication } from '../../../../middleware/roleMiddleware';
45
import {
56
SUCCESS_RESPONSE_SCHEMA,
@@ -11,7 +12,8 @@ import {
1112
} from './schemas';
1213

1314
export default async function deleteDeviceRoute(server: FastifyInstance) {
14-
const deviceService = new DeviceService(server.db);
15+
const db = getDb();
16+
const deviceService = new DeviceService(db);
1517

1618
server.delete('/users/me/devices/:deviceId', {
1719
preValidation: requireAuthentication(),

services/backend/src/routes/users/me/devices/get.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type FastifyInstance } from 'fastify';
22
import { DeviceService } from '../../../../services/deviceService';
3+
import { getDb } from '../../../../db';
34
import { requireAuthentication } from '../../../../middleware/roleMiddleware';
45
import {
56
DEVICE_DETAIL_RESPONSE_SCHEMA,
@@ -11,7 +12,8 @@ import {
1112
} from './schemas';
1213

1314
export default async function getDeviceRoute(server: FastifyInstance) {
14-
const deviceService = new DeviceService(server.db);
15+
const db = getDb();
16+
const deviceService = new DeviceService(db);
1517

1618
server.get('/users/me/devices/:deviceId', {
1719
preValidation: requireAuthentication(),

services/backend/src/routes/users/me/devices/list.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type FastifyInstance } from 'fastify';
22
import { DeviceService } from '../../../../services/deviceService';
3+
import { getDb } from '../../../../db';
34
import { requireAuthentication } from '../../../../middleware/roleMiddleware';
45
import {
56
DEVICES_LIST_RESPONSE_SCHEMA,
@@ -9,7 +10,8 @@ import {
910
} from './schemas';
1011

1112
export default async function listDevicesRoute(server: FastifyInstance) {
12-
const deviceService = new DeviceService(server.db);
13+
const db = getDb();
14+
const deviceService = new DeviceService(db);
1315

1416
server.get('/users/me/devices', {
1517
preValidation: requireAuthentication(),

services/backend/src/routes/users/me/devices/update.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type FastifyInstance } from 'fastify';
22
import { DeviceService } from '../../../../services/deviceService';
3+
import { getDb } from '../../../../db';
34
import { requireAuthentication } from '../../../../middleware/roleMiddleware';
45
import {
56
UPDATE_DEVICE_SCHEMA,
@@ -13,7 +14,8 @@ import {
1314
} from './schemas';
1415

1516
export default async function updateDeviceRoute(server: FastifyInstance) {
16-
const deviceService = new DeviceService(server.db);
17+
const db = getDb();
18+
const deviceService = new DeviceService(db);
1719

1820
server.put('/users/me/devices/:deviceId', {
1921
preValidation: requireAuthentication(),

services/backend/tests/unit/utils/encryption.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,18 @@ describe('encryption.ts', () => {
188188

189189
it('should throw error for tampered encrypted data', () => {
190190
process.env.DEPLOYSTACK_ENCRYPTION_SECRET = 'test-secret-key';
191-
const plaintext = 'Original message';
191+
const plaintext = 'Original message that is longer to ensure meaningful encrypted data';
192192
const encrypted = encrypt(plaintext);
193193

194-
// Tamper with the encrypted data
194+
// Get the components
195195
const [iv, authTag, encryptedData] = encrypted.split(':');
196-
const tamperedData = iv + ':' + authTag + ':' + encryptedData.slice(0, -2) + '00';
196+
197+
// Ensure we have sufficient encrypted data to tamper with
198+
expect(encryptedData.length).toBeGreaterThan(4);
199+
200+
// Method 1: Tamper with encrypted data by changing bytes in the middle
201+
const tamperedEncrypted = encryptedData.substring(0, 4) + 'ff' + encryptedData.substring(6);
202+
const tamperedData = iv + ':' + authTag + ':' + tamperedEncrypted;
197203

198204
expect(() => decrypt(tamperedData)).toThrow('Decryption failed');
199205
});

services/frontend/src/components/DashboardLayout.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ const sidebarStyle = computed(() => ({
3838
</div>
3939
</header>
4040

41-
<Separator class="my-6" />
41+
<Separator class="my-6 max-w-7xl" />
4242

4343
<!-- Content area -->
44-
<div class="flex flex-1 flex-col gap-4 p-4 pt-0">
44+
<div class="flex flex-1 flex-col gap-4 p-4 pt-0 max-w-7xl">
4545
<slot />
4646
</div>
4747
</SidebarInset>

0 commit comments

Comments
 (0)