-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
119748: server, lint: centralize and restrict HTTP cookie construction r=dhartunian a=dhartunian ### server: centralize cookie construction All cookie construction for session and tenant cookies is now moved to explicit constructors instead of initializing `http.Cookie{}` structs directly. This reduces the chance of error and explicitly requires setting the `secure` flag via the constructor. The constructs were created to exactly mimic all existing cookie settings. No change in flags should happen as a result of this commit. A separate commit will introduce a linter to prevent raw cookie creation. Epic: None Release note: None ### lint: add linter to reject raw http.Cookie structs We previously introduced bugs when creating HTTP cookies in new code that did not have the proper fields set. This linter aims to enforce use of cookies only through pre-generated constructors in `pkg/server/ authserver/cookie.go`. This will reduce the chance of errors in the future and keep things consistent. Epic: None Release note: None Co-authored-by: David Hartunian <[email protected]>
- Loading branch information
Showing
6 changed files
with
130 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters