fix(schemas): widen VLESS decryption/encryption to accept PQ values

The post-quantum auth blocks (ML-KEM-768, X25519) populate
`settings.decryption` / `settings.encryption` with values like
`mlkem768x25519plus.<base64>` and `xchacha20-poly1305.aead.x25519`,
but the schema pinned both fields to z.literal('none') so saving an
inbound after picking "ML-KEM-768 auth" failed with
`Invalid input: expected "none"`.

Relax both fields (inbound + outbound + outbound form) to
z.string().min(1) keeping the 'none' default. xray-core does its own
validation server-side so a string check at the form boundary is
enough.
This commit is contained in:
MHSanaei 2026-05-27 03:14:19 +02:00
parent 1752702f74
commit 87eaa79e5d
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A
3 changed files with 4 additions and 4 deletions

View file

@ -64,7 +64,7 @@ export const VlessOutboundFormSettingsSchema = z.object({
port: PortSchema.default(443),
id: z.string().default(''),
flow: z.string().default(''),
encryption: z.literal('none').default('none'),
encryption: z.string().min(1).default('none'),
reverseTag: z.string().default(''),
reverseSniffing: ReverseSniffingFormSchema.default({
enabled: false,

View file

@ -39,8 +39,8 @@ export type VlessClient = z.infer<typeof VlessClientSchema>;
export const VlessInboundSettingsSchema = z.object({
clients: z.array(VlessClientSchema).default([]),
decryption: z.literal('none').default('none'),
encryption: z.literal('none').default('none'),
decryption: z.string().min(1).default('none'),
encryption: z.string().min(1).default('none'),
fallbacks: z.array(VlessFallbackSchema).default([]),
// TODO: narrow to flow === 'xtls-rprx-vision' once a per-flow discriminator
// exists. 4-positive-int padding seed for xtls-rprx-vision; backend uses

View file

@ -7,7 +7,7 @@ export const VlessOutboundSettingsSchema = z.object({
port: z.number().int().min(1).max(65535),
id: z.uuid(),
flow: FlowSchema.default(''),
encryption: z.literal('none').default('none'),
encryption: z.string().min(1).default('none'),
reverse: z
.object({
tag: z.string(),