-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add cookieless server hash mode #25915
Draft
robbie-c
wants to merge
47
commits into
master
Choose a base branch
from
feature/cookieless-tracking
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
aca1c00
Use ip address for the partitioning key
robbie-c a1ce236
Add uuidv7 code
robbie-c 8caaebc
WIP
robbie-c 6213985
Handle repeat ids better
robbie-c 153ef1b
WIP
robbie-c 98701d7
Update plugin-server/src/utils/db/db.ts
robbie-c 4a137ed
WIP
robbie-c b524488
WIP
robbie-c 90f8e0c
Typing
robbie-c af1d8f9
Fix
robbie-c e134d2c
Comment
robbie-c 45e65e2
Do redis in a transaction
robbie-c 8272fbf
Use UTC if timezone is invalid
robbie-c a04e563
Vendor the siphash npm library
robbie-c a8ca51b
Unvendor
robbie-c 011cad2
Change naming of sentinel value
robbie-c 4514a7a
Delete expired salts
robbie-c 4f33d47
Make abortController optional
robbie-c db93cf7
Use $cklsh property
robbie-c 1b81625
Add setting for opt in to cklsh
robbie-c f6224a0
Add simple mode of operation
robbie-c 5b03a25
Make the cookieless mode an enum so we can disable staeful mode as a …
robbie-c d7ecd39
Store and load the session state as binary
robbie-c 63cc285
Improve comment, strip PII, as $cklsh_extra
robbie-c 67fca63
Update query snapshots
github-actions[bot] 5ff0218
Fix
robbie-c 10c48b5
Use correct sentinel value
robbie-c eafd127
Update query snapshots
github-actions[bot] 02892e8
Update UI snapshots for `chromium` (1)
github-actions[bot] 646f317
Update query snapshots
github-actions[bot] 7702f48
Still randomly partition when overflowing
robbie-c 0d5f20f
Modify capture.rs
robbie-c 3ef22b9
Use npm version of siphash
robbie-c 567d19f
Fix label
robbie-c 5d404a7
Use ??
robbie-c ad3755d
Use env var
robbie-c 563b883
Make clippy happy
robbie-c 2a29b1a
Remove my irrelevant device id changes in capture.py
robbie-c 2dc40f0
Only store true values for is_cookieless_mode
robbie-c 00e5c96
tsc
robbie-c 523a62b
Update UI snapshots for `chromium` (1)
github-actions[bot] 7de87be
Fix runner tests
robbie-c b9f3cb7
Fix db tests
robbie-c 456275f
Add tests for some DB functions
robbie-c cc511a0
Fix migration
robbie-c a5ce66f
Add test for redisScard
robbie-c 164b6ff
Update query snapshots
github-actions[bot] 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
Binary file modified
BIN
+77 Bytes
(100%)
frontend/__snapshots__/scenes-other-settings--settings-project--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+286 Bytes
(100%)
frontend/__snapshots__/scenes-other-settings--settings-project--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-662 Bytes
(100%)
...pshots__/scenes-other-settings--settings-project-with-replay-features--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-746 Bytes
(100%)
...shots__/scenes-other-settings--settings-project-with-replay-features--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+77 Bytes
(100%)
...apshots__/scenes-other-settings--settings-session-timeout-all-options--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+286 Bytes
(100%)
...pshots__/scenes-other-settings--settings-session-timeout-all-options--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+77 Bytes
(100%)
...shots__/scenes-other-settings--settings-session-timeout-password-only--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+286 Bytes
(100%)
...hots__/scenes-other-settings--settings-session-timeout-password-only--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+77 Bytes
(100%)
..._/scenes-other-settings--settings-session-timeout-sso-enforced-github--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+286 Bytes
(100%)
.../scenes-other-settings--settings-session-timeout-sso-enforced-github--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+77 Bytes
(100%)
..._/scenes-other-settings--settings-session-timeout-sso-enforced-google--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+286 Bytes
(100%)
.../scenes-other-settings--settings-session-timeout-sso-enforced-google--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+77 Bytes
(100%)
...s__/scenes-other-settings--settings-session-timeout-sso-enforced-saml--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+286 Bytes
(100%)
...__/scenes-other-settings--settings-session-timeout-sso-enforced-saml--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+77 Bytes
(100%)
..._snapshots__/scenes-other-settings--settings-session-timeout-sso-only--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+286 Bytes
(100%)
...snapshots__/scenes-other-settings--settings-session-timeout-sso-only--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
65 changes: 65 additions & 0 deletions
65
frontend/src/scenes/settings/environment/CookielessServerHashMode.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { useActions, useValues } from 'kea' | ||
import { LemonButton } from 'lib/lemon-ui/LemonButton' | ||
import { LemonRadio, LemonRadioOption } from 'lib/lemon-ui/LemonRadio' | ||
import { useState } from 'react' | ||
import { teamLogic } from 'scenes/teamLogic' | ||
|
||
import { CookielessServerHashMode } from '~/types' | ||
|
||
const options: LemonRadioOption<CookielessServerHashMode>[] = [ | ||
{ | ||
value: CookielessServerHashMode.Stateful, | ||
label: ( | ||
<> | ||
<div>Stateful</div> | ||
</> | ||
), | ||
}, | ||
{ | ||
value: CookielessServerHashMode.Stateless, | ||
label: ( | ||
<> | ||
<div>Stateless</div> | ||
</> | ||
), | ||
}, | ||
{ | ||
value: CookielessServerHashMode.Disabled, | ||
label: ( | ||
<> | ||
<div>Disabled</div> | ||
</> | ||
), | ||
}, | ||
] | ||
|
||
export function CookielessServerHashModeSetting(): JSX.Element { | ||
const { updateCurrentTeam } = useActions(teamLogic) | ||
const { currentTeam } = useValues(teamLogic) | ||
|
||
const savedSetting = currentTeam?.cookieless_server_hash_mode ?? CookielessServerHashMode.Disabled | ||
const [setting, setSetting] = useState<CookielessServerHashMode>(savedSetting) | ||
|
||
const handleChange = (newSetting: CookielessServerHashMode): void => { | ||
updateCurrentTeam({ cookieless_server_hash_mode: newSetting }) | ||
} | ||
|
||
return ( | ||
<> | ||
<p> | ||
Use a cookieless server-side hash mode to hash user data. This is an experimental feature preview and | ||
may result in dropped events. | ||
</p> | ||
<LemonRadio value={setting} onChange={setSetting} options={options} /> | ||
<div className="mt-4"> | ||
<LemonButton | ||
type="primary" | ||
onClick={() => handleChange(setting)} | ||
disabledReason={setting === savedSetting ? 'No changes to save' : undefined} | ||
> | ||
Save | ||
</LemonButton> | ||
</div> | ||
</> | ||
) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We eventually need to explain this slightly better, it definitely won't be clear by this message what "cookieless server-side hash mode" means
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't ever be seen by a customer, only us