mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
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:
parent
1752702f74
commit
87eaa79e5d
3 changed files with 4 additions and 4 deletions
|
|
@ -64,7 +64,7 @@ export const VlessOutboundFormSettingsSchema = z.object({
|
||||||
port: PortSchema.default(443),
|
port: PortSchema.default(443),
|
||||||
id: z.string().default(''),
|
id: z.string().default(''),
|
||||||
flow: z.string().default(''),
|
flow: z.string().default(''),
|
||||||
encryption: z.literal('none').default('none'),
|
encryption: z.string().min(1).default('none'),
|
||||||
reverseTag: z.string().default(''),
|
reverseTag: z.string().default(''),
|
||||||
reverseSniffing: ReverseSniffingFormSchema.default({
|
reverseSniffing: ReverseSniffingFormSchema.default({
|
||||||
enabled: false,
|
enabled: false,
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ export type VlessClient = z.infer<typeof VlessClientSchema>;
|
||||||
|
|
||||||
export const VlessInboundSettingsSchema = z.object({
|
export const VlessInboundSettingsSchema = z.object({
|
||||||
clients: z.array(VlessClientSchema).default([]),
|
clients: z.array(VlessClientSchema).default([]),
|
||||||
decryption: z.literal('none').default('none'),
|
decryption: z.string().min(1).default('none'),
|
||||||
encryption: z.literal('none').default('none'),
|
encryption: z.string().min(1).default('none'),
|
||||||
fallbacks: z.array(VlessFallbackSchema).default([]),
|
fallbacks: z.array(VlessFallbackSchema).default([]),
|
||||||
// TODO: narrow to flow === 'xtls-rprx-vision' once a per-flow discriminator
|
// TODO: narrow to flow === 'xtls-rprx-vision' once a per-flow discriminator
|
||||||
// exists. 4-positive-int padding seed for xtls-rprx-vision; backend uses
|
// exists. 4-positive-int padding seed for xtls-rprx-vision; backend uses
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ export const VlessOutboundSettingsSchema = z.object({
|
||||||
port: z.number().int().min(1).max(65535),
|
port: z.number().int().min(1).max(65535),
|
||||||
id: z.uuid(),
|
id: z.uuid(),
|
||||||
flow: FlowSchema.default(''),
|
flow: FlowSchema.default(''),
|
||||||
encryption: z.literal('none').default('none'),
|
encryption: z.string().min(1).default('none'),
|
||||||
reverse: z
|
reverse: z
|
||||||
.object({
|
.object({
|
||||||
tag: z.string(),
|
tag: z.string(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue