This repository was archived by the owner on Dec 12, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Add IP pinning option #16
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
224c7f4
Add IP pinning flag to the session options
Voltra 919bceb
Document IP pinning in the README
Voltra 469b24c
Add initial draft for IP pinning logic
Voltra 0e9ddfa
Add argon2 dependency for secure hashing of IP addresses stored in th…
Voltra 7be0310
Replace placeholder hashing logic with argon2 implementation
Voltra 1320b82
Change the way sessions are deleted to avoid deleting on storage-jack…
Voltra 885fe83
Improve IP address resolution, add more documentation in README
Voltra 4037d5a
Update illegal keys detection in PATCH & POST endpoints, fix session …
Voltra e402eb4
Add warning about trusting IP-forwarding headers
Voltra e19160f
Publish changes in lockfile
Voltra 5d9a9b6
Move IP pinning logic to a separate file
Voltra 067e11e
Change way of getting the IP hash when creating a new session
Voltra 70d5936
Refactor session checks into seperate functions that may throw on error
Voltra 91cd1c5
Move conditional inside the checks themselves
Voltra ab85ea4
Refactor ipPinning API to allow users to configure trusted headers
Voltra c13b01c
Rename IP mismatch error class
Voltra cc4f588
Move session IP processing in the IP pinning file
Voltra 6c23fc6
Move conditionals outside of checks
Voltra b0be701
Merge upstream
Voltra 7c01cfd
Change way session are cleaned up
Voltra 107c699
Remove unnecessary ts-ignore comments
Voltra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export class IpMismatch extends Error { | ||
constructor (message = 'User IP doesn\'t match the one in session') { | ||
super(message) | ||
} | ||
} | ||
|
||
export class IpMissingFromSession extends Error { | ||
constructor (message = 'No IP in session even though ipPinning is enabled') { | ||
super(message) | ||
} | ||
} | ||
|
||
export class SessionExpired extends Error { | ||
constructor (message = 'Session expired') { | ||
super(message) | ||
} | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.