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),
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue