Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### [2.2.3-stage.2](https://github.com/aziontech/lib/compare/v2.2.3-stage.1...v2.2.3-stage.2) (2025-11-06)


### Bug Fixes

* implement custom WASM loader for Nuxt SSR builds (#307) ([3fec9d8](https://github.com/aziontech/lib/commit/3fec9d8919e52d2df983f35676d5af7a6e2156a9))

### [2.2.3-stage.1](https://github.com/aziontech/lib/compare/v2.2.2...v2.2.3-stage.1) (2025-11-06)


### Bug Fixes

* update mtls attribute in workload configuration (#306) ([f6bc044](https://github.com/aziontech/lib/commit/f6bc044344b1c5e9919b48576125b816183d75ee))

### [2.2.2](https://github.com/aziontech/lib/compare/v2.2.1...v2.2.2) (2025-10-29)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azion",
"version": "2.2.2",
"version": "2.2.3-stage.2",
"description": "Azion Packages for Edge Computing.",
"scripts": {
"prepare": "husky",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,12 @@ const config: AzionConfig = {
},
},
mtls: {
verification: 'enforce' as WorkloadMTLSVerification,
certificate: 67890,
crl: [1, 2, 3],
enabled: true,
config: {
verification: 'enforce' as WorkloadMTLSVerification,
certificate: 67890,
crl: [1, 2, 3],
},
},
deployments: [
{
Expand Down
35 changes: 22 additions & 13 deletions packages/config/src/configProcessor/helpers/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -987,22 +987,31 @@ const azionConfigSchema = {
mtls: {
type: 'object',
properties: {
verification: {
type: 'string',
enum: WORKLOAD_MTLS_VERIFICATION,
default: 'enforce',
enabled: {
type: 'boolean',
default: false,
},
certificate: {
type: ['integer', 'null'],
minimum: 1,
},
crl: {
type: ['array', 'null'],
items: { type: 'integer' },
maxItems: 100,
config: {
type: 'object',
properties: {
verification: {
type: 'string',
enum: WORKLOAD_MTLS_VERIFICATION,
default: 'enforce',
},
certificate: {
type: ['integer', 'null'],
minimum: 1,
},
crl: {
type: ['array', 'null'],
items: { type: 'integer' },
maxItems: 100,
},
},
additionalProperties: false,
},
},
required: ['verification'],
additionalProperties: false,
},
deployments: {
Expand Down
35 changes: 22 additions & 13 deletions packages/config/src/configProcessor/helpers/schemaManifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1309,22 +1309,31 @@ const schemaWorkloadManifest = {
mtls: {
type: 'object',
properties: {
verification: {
type: 'string',
enum: WORKLOAD_MTLS_VERIFICATION,
default: 'enforce',
},
certificate: {
type: ['integer', 'null'],
minimum: 1,
enabled: {
type: 'boolean',
default: false,
},
crl: {
type: ['array', 'null'],
items: { type: 'integer' },
maxItems: 100,
config: {
type: 'object',
properties: {
verification: {
type: 'string',
enum: WORKLOAD_MTLS_VERIFICATION,
default: 'enforce',
},
certificate: {
type: ['integer', 'null'],
minimum: 1,
},
crl: {
type: ['array', 'null'],
items: { type: 'integer' },
maxItems: 100,
},
},
additionalProperties: false,
},
},
required: ['verification'],
additionalProperties: false,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ describe('WorkloadProcessConfigStrategy', () => {
},
},
mtls: {
verification: 'permissive',
certificate: 456,
crl: [789],
enabled: true,
config: {
verification: 'permissive',
certificate: 456,
crl: [789],
},
},
},
],
Expand Down Expand Up @@ -112,9 +115,12 @@ describe('WorkloadProcessConfigStrategy', () => {
},
},
mtls: {
verification: 'permissive',
certificate: 456,
crl: [789],
enabled: true,
config: {
verification: 'permissive',
certificate: 456,
crl: [789],
},
},
}),
]);
Expand Down Expand Up @@ -232,9 +238,12 @@ describe('WorkloadProcessConfigStrategy', () => {
},
},
mtls: {
verification: 'permissive',
certificate: 456,
crl: [789],
enabled: true,
config: {
verification: 'permissive',
certificate: 456,
crl: [789],
},
},
},
],
Expand Down Expand Up @@ -264,9 +273,12 @@ describe('WorkloadProcessConfigStrategy', () => {
},
},
mtls: {
verification: 'permissive',
certificate: 456,
crl: [789],
enabled: true,
config: {
verification: 'permissive',
certificate: 456,
crl: [789],
},
},
}),
],
Expand Down Expand Up @@ -352,7 +364,7 @@ describe('WorkloadProcessConfigStrategy', () => {
};

const result = strategy.transformToConfig(payload) as {
workloads: Array<{ mtls?: { verification: string; certificate?: number | null; crl?: number[] | null } }>;
workloads: Array<{ mtls?: { enabled?: false; config?: { verification: string; certificate?: number | null; crl?: number[] | null } } }>;
};

expect(result.workloads[0].mtls).toBeUndefined();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ class WorkloadProcessConfigStrategy extends ProcessConfigStrategy {
},
mtls: workload.mtls
? {
verification: workload.mtls.verification || 'enforce',
certificate: workload.mtls.certificate,
crl: workload.mtls.crl,
enabled: workload.mtls.enabled || false,
config: {
verification: workload.mtls.config.verification || 'enforce',
certificate: workload.mtls.config.certificate,
crl: workload.mtls.config.crl,
},
}
: undefined,
}));
Expand Down Expand Up @@ -68,9 +71,12 @@ class WorkloadProcessConfigStrategy extends ProcessConfigStrategy {
},
mtls: workload.mtls
? {
verification: workload.mtls.verification,
certificate: workload.mtls.certificate,
crl: workload.mtls.crl,
enabled: workload.mtls.enabled || false,
config: {
verification: workload.mtls.config.verification || 'enforce',
certificate: workload.mtls.config.certificate,
crl: workload.mtls.config.crl,
},
}
: undefined,
}));
Expand Down
9 changes: 6 additions & 3 deletions packages/config/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,12 @@ export type AzionWorkloadProtocols = {
};

export type AzionWorkloadMTLS = {
verification: WorkloadMTLSVerification;
certificate?: number | null;
crl?: number[] | null;
enabled: boolean;
config: {
verification: WorkloadMTLSVerification;
certificate?: number | null;
crl?: number[] | null;
};
};

/**
Expand Down
22 changes: 22 additions & 0 deletions packages/presets/docs/preset-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,28 @@ export default defineNuxtConfig({
});
```

### Using nuxt-og-image with SSR

If you're using `nuxt-og-image` in your project with SSR, you need to add the following configuration to your `nuxt.config.ts`:

```typescript
export default defineNuxtConfig({
modules: ['nuxt-og-image'],
nitro: {
preset: require.resolve('azion/preset/nuxt/ssr'),
},
ogImage: {
compatibility: {
runtime: {
resvg: 'wasm',
},
},
},
});
```

This configuration ensures that the `resvg` library uses the WASM runtime, which is compatible with the Azion edge environment.

## Configuration SSG

Configure your `nuxt.config.ts` to use the Azion SSG preset:
Expand Down
13 changes: 10 additions & 3 deletions packages/presets/src/presets/nuxt/nitro/ssr/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { writeFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { resolve } from 'pathe';
import rollupWasmLoader from './plugins/rollup-wasm-loader';

export default {
extends: 'base-worker',
Expand All @@ -18,10 +19,16 @@ export default {
},
},
wasm: {
lazy: false,
esmImport: true,
lazy: true,
},
hooks: {
'build:before': (nitro) => {
nitro.options.rollupConfig.plugins.push(
rollupWasmLoader({
outputDir: `${nitro.options.output.dir}/public`,
}),
);
},
async compiled(nitro) {
await writeFile(
resolve(nitro.options.output.dir, 'package.json'),
Expand Down
Loading