Skip to content

Commit dd31a97

Browse files
authored
Revert HeaderSecurity constraints (#2359)
to allow that kind of `Security` without opt-in for `headers` as input source.
1 parent cda3609 commit dd31a97

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
### v23.0.0
66

7-
- Publicly exposed interface `CustomHeaderSecurity` is renamed to `HeaderSecurity`;
8-
- Restrictions have been placed between header names in the middleware `security` declaration and in `input` properties.
7+
- Publicly exposed interface `CustomHeaderSecurity` is renamed to `HeaderSecurity`.
98

109
## Version 22
1110

src/security.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export interface InputSecurity<K extends string> {
1212
name: K;
1313
}
1414

15-
export interface HeaderSecurity<K extends string> {
15+
export interface HeaderSecurity {
1616
type: "header";
17-
name: K;
17+
name: string;
1818
}
1919

2020
export interface CookieSecurity {
@@ -89,7 +89,7 @@ export type Security<K extends string = string, S extends string = string> =
8989
| BasicSecurity
9090
| BearerSecurity
9191
| InputSecurity<K>
92-
| HeaderSecurity<K>
92+
| HeaderSecurity
9393
| CookieSecurity
9494
| OpenIdSecurity
9595
| OAuth2Security<S>;

tests/unit/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe("Index Entrypoint", () => {
7474
expectTypeOf<{
7575
type: "header";
7676
name: "some";
77-
}>().toMatchTypeOf<HeaderSecurity<string>>();
77+
}>().toMatchTypeOf<HeaderSecurity>();
7878
expectTypeOf<{ type: "input"; name: "some" }>().toMatchTypeOf<
7979
InputSecurity<string>
8080
>();

0 commit comments

Comments
 (0)