You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Realm |`string`| Realm is a string to define the realm attribute of BasicAuth. The realm identifies the system to authenticate against and can be used by clients to save credentials. |`"Restricted"`|
81
92
| Charset |`string`| Charset sent in the `WWW-Authenticate` header, so clients know how credentials are encoded. |`"UTF-8"`|
82
93
| HeaderLimit |`int`| Maximum allowed length of the `Authorization` header. Requests exceeding this limit are rejected. |`8192`|
Copy file name to clipboardExpand all lines: docs/whats_new.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1054,7 +1054,7 @@ The adaptor middleware has been significantly optimized for performance and effi
1054
1054
1055
1055
### BasicAuth
1056
1056
1057
-
The BasicAuth middleware now validates the `Authorization` header more rigorously and sets security-focused response headers. The default challenge includes the `charset="UTF-8"` parameter and disables caching. Passwords are no longer stored in the request context by default; use the new `StorePassword` option to retain them. A `Charset` option controls the value used in the challenge header.
1057
+
The BasicAuth middleware now validates the `Authorization` header more rigorously and sets security-focused response headers. Passwords must be provided in **hashed** form (e.g. SHA-256 or bcrypt) rather than plaintext. The default challenge includes the `charset="UTF-8"` parameter and disables caching. Passwords are no longer stored in the request context by default; use the new `StorePassword` option to retain them. A `Charset` option controls the value used in the challenge header.
1058
1058
A new `HeaderLimit` option restricts the maximum length of the `Authorization` header (default: `8192` bytes).
1059
1059
The `Authorizer` function now receives the current `fiber.Ctx` as a third argument, allowing credential checks to incorporate request context.
Passwords configured for BasicAuth must now be pre-hashed. If no prefix is supplied the middleware expects a SHA-256 digest encoded in hex. Common prefixes like `{SHA256}`, `{SHA}`, `{SHA512}`, `{MD5}` and bcrypt strings are also supported. Plaintext passwords are no longer accepted.
1951
+
1950
1952
You can also set the optional `HeaderLimit`, `StorePassword`, and `Charset`
1951
1953
options to further control authentication behavior.
0 commit comments