| | | 1 | | /// <summary> |
| | | 2 | | /// Specifies that a method or class binds to a form with specific options. |
| | | 3 | | /// </summary> |
| | | 4 | | [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false, Inherited = false)] |
| | | 5 | | public sealed class KrBindFormAttribute : KestrunAnnotation |
| | | 6 | | { |
| | | 7 | | /// <summary> |
| | | 8 | | /// Gets or sets the form option template name to use for binding. |
| | | 9 | | /// </summary> |
| | 0 | 10 | | public string? Template { get; set; } |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Optional override: default upload path. |
| | | 14 | | /// </summary> |
| | 7 | 15 | | public string? DefaultUploadPath { get; set; } |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// Optional override: compute SHA-256 for file parts. |
| | | 19 | | /// </summary> |
| | 6 | 20 | | public bool ComputeSha256 { get; set; } |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Optional override: enable per-part decompression. |
| | | 24 | | /// </summary> |
| | 6 | 25 | | public bool EnablePartDecompression { get; set; } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Optional override: max decompressed bytes per part. |
| | | 29 | | /// </summary> |
| | 7 | 30 | | public long MaxDecompressedBytesPerPart { get; set; } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Optional override: allowed request content types. |
| | | 34 | | /// </summary> |
| | 35 | 35 | | public bool RejectUnknownRequestContentType { get; set; } = true; |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Optional override: allowed part content encodings for decompression. |
| | | 39 | | /// </summary> |
| | 7 | 40 | | public string[]? AllowedPartContentEncodings { get; set; } |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// Optional override: reject unknown part content encodings. |
| | | 44 | | /// </summary> |
| | 35 | 45 | | public bool RejectUnknownContentEncoding { get; set; } = true; |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// Gets or sets the maximum allowed request body size in bytes. |
| | | 49 | | /// </summary> |
| | 7 | 50 | | public long MaxRequestBodyBytes { get; set; } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Gets or sets the maximum allowed part body size in bytes. |
| | | 54 | | /// </summary> |
| | 7 | 55 | | public long MaxPartBodyBytes { get; set; } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Gets or sets the maximum number of parts allowed. |
| | | 59 | | /// </summary> |
| | 7 | 60 | | public int MaxParts { get; set; } |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// Gets or sets the maximum header bytes per part. |
| | | 64 | | /// </summary> |
| | 7 | 65 | | public int MaxHeaderBytesPerPart { get; set; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Gets or sets the maximum field value size in bytes. |
| | | 69 | | /// </summary> |
| | 7 | 70 | | public long MaxFieldValueBytes { get; set; } |
| | | 71 | | |
| | | 72 | | /// <summary> |
| | | 73 | | /// Gets or sets the maximum nesting depth for multipart bodies. |
| | | 74 | | /// </summary> |
| | 45 | 75 | | public int MaxNestingDepth { get; set; } |
| | | 76 | | } |