Skip to content
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: Experimental FedCM compatibility #441

Merged
merged 48 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f40a335
add `EXPERIMENTAL_FED_CM_ENABLE` config var for opt-in
sebadob May 20, 2024
289ae10
define FedCM endpoints with `todo!()` + check for enabled
sebadob May 20, 2024
ecf42ce
list FedCM endpoitns in OpenAPI under new `fed_cm` tag
sebadob May 20, 2024
ef61c62
add `disconnect` endpoint to the definitions
sebadob May 20, 2024
56419d4
`web-identity` endpoint
sebadob May 20, 2024
8a72716
`FedCMIdPConfig` endpoint
sebadob May 20, 2024
693c408
change the `background_color` for `FedCMIdPBranding`
sebadob May 20, 2024
62df41a
`FedCMAccounts` endpoint
sebadob May 20, 2024
cf540f1
assertion endpoint
sebadob May 20, 2024
57b6913
restructure code and remove disconnect for now
sebadob May 20, 2024
d58daa2
clippy
sebadob May 20, 2024
39839c5
use the `account` page as login url for now
sebadob May 20, 2024
cf06b56
small improvements, cleanup and TODOs / open questions
sebadob May 20, 2024
ad812c6
new config var `USER_COOKIE_LIFETIME`
sebadob May 23, 2024
4365ad3
make it possible to build `SameSite=None` cookies for FedCM
sebadob May 23, 2024
46f6d06
set the last logged in `user_id` in cookie for FedCM
sebadob May 23, 2024
d06a62a
add`SESSION_LIFETIME_FED_CM` + `SESSION_TIMEOUT_FED_CM`
sebadob May 23, 2024
41477df
set additional FedCM session cookie on login
sebadob May 23, 2024
9a450fb
FedCM should be happy now
sebadob May 23, 2024
f502fcc
fix `SameSite` for RauthyUser cookie
sebadob May 23, 2024
2a37206
return current `PUB_URL` with `domain_hints`
sebadob May 24, 2024
4e8c0e5
update deps and bump nightly version
sebadob May 24, 2024
7024ed9
merge from main
sebadob May 24, 2024
a74eb63
fix paste error
sebadob May 24, 2024
b8362aa
bump nightly version
sebadob May 24, 2024
e1ef73d
visibility bugfix for `User::insert()`
sebadob May 24, 2024
980bf20
additional debug logging
sebadob May 24, 2024
4cc2a10
test-ui for fedcm client
sebadob May 24, 2024
406bb4f
rebuild docs
sebadob May 24, 2024
57a0d7d
serve the fedcm testing html
sebadob May 24, 2024
83fce86
more information and logging in the ui
sebadob May 25, 2024
4585a30
return login status on each fedcm endpoint + switch to `Client::find_…
sebadob May 25, 2024
d21d029
cleanup
sebadob May 25, 2024
cce5e34
fetch and set the current fedcm login status in the UI
sebadob May 25, 2024
5a1dc73
return a client config json for testing with ephemeral clients
sebadob May 25, 2024
294e87d
return `Set-Login` header in other locations to keep the FedCM login …
sebadob May 25, 2024
6507e00
update origin validation for ephemeral clients
sebadob May 25, 2024
7f7660d
remove signin context
sebadob May 25, 2024
b9dad72
delete the FedCM session on logout
sebadob May 25, 2024
3fc686f
clippy + update OpenAPI spec
sebadob May 25, 2024
2721bea
remove test var from account-link and refer to SSR value again
sebadob May 25, 2024
22751ee
fix auth provider json parsing
sebadob May 25, 2024
2ef809d
remove now obsolete rauthy user cookie
sebadob May 25, 2024
48ce0ca
fix bug in FedCM session removal on logout
sebadob May 25, 2024
7b400d1
make `EphemeralClientRequest.grant_types` and `Option<_>`
sebadob May 25, 2024
aa80642
UI: fix JSON deserialization bug
sebadob May 25, 2024
0bd7503
cleanup
sebadob May 25, 2024
6787339
update notes
sebadob May 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 124 additions & 102 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ members = [
exclude = ["rauthy-client"]

[workspace.package]
version = "0.23.1"
version = "0.23.2-20240524"
edition = "2021"
authors = ["Sebastian Dobe <sebastiandobe@mailbox.org>"]
license = "Apache-2.0"
Expand Down
5 changes: 0 additions & 5 deletions dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

## CURRENT WORK

- bug when setting attribute - after set -> undefined instead of ''

## Stage 1 - essentials

[x] finished

## Stage 2 - features - do before v1.0.0

- migrate from `rusty_s3` to `s3_simple` to get rid of presigned URLs
- prettify the UI
- check out the possibility to include SCIM
- update the book with all the new features
Expand All @@ -24,8 +21,6 @@

### `rauthy-client` TODO's

- automatic `refresh_token` handler for `device_code` grant flow
- add `fetch_userinfo()` for a `PrincipalOidc`
- when implementing userinfo lookup, add an fn to validate the `at_hash` as well

## Stage 3 - Possible nice to haves
Expand Down
10 changes: 5 additions & 5 deletions docs/config/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -760,20 +760,20 @@ <h1 id="reference-config"><a class="header" href="#reference-config">Reference C
# for more information:
# https://sebadob.github.io/rauthy/config/argon2.html
# M_COST should never be below 32768 in production
ARGON2_M_COST=32768
ARGON2_M_COST=131072
# T_COST should never be below 1 in production
ARGON2_T_COST=3
ARGON2_T_COST=4
# P_COST should never be below 2 in production
ARGON2_P_COST=2
ARGON2_P_COST=8

# Limits the maximum amount of parallel password hashes at
# the exact same time to never exceed system memory while
# still allowing a good amount of memory for the argon2id
# algorithm (default: 2)
#
# CAUTION: You must make sure, that you have at least
# (MAX_HASH_THREADS * ARGON2_M_COST / 1024) + ~30 MB of memory
# available.
# (MAX_HASH_THREADS * ARGON2_M_COST / 1024) + idle memory
# of your deployment available
MAX_HASH_THREADS=1

# The time in ms when to log a warning, if a request waited
Expand Down
14 changes: 6 additions & 8 deletions docs/getting_started/k8s.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,17 @@ <h3 id="create-and-apply-secrets"><a class="header" href="#create-and-apply-secr
# The CACHE_AUTH_TOKEN is only needed for a deployment with HA_MODE == true
# Secret token, which is used to authenticate the cache members
#CACHE_AUTH_TOKEN:

# The database driver will be chosen at runtime depending on the given DATABASE_URL format. Examples:
# Sqlite: 'sqlite:data/rauthy.db' or 'sqlite::memory:'
# Postgres: 'postgresql://User:PasswordWithoutSpecialCharacters@localhost:5432/DatabaseName'
DATABASE_URL:
DATABASE_URL:

# Format: "key_id/enc_key another_key_id/another_enc_key" - the enc_key itself must be exactly 32 characters long and
# and should not contain special characters.
# The ID must match '[a-zA-Z0-9]{2,20}'
ENC_KEYS:

# Needed for sending E-Mails for password resets and so on
SMTP_PASSWORD:
</code></pre>
Expand Down Expand Up @@ -384,10 +384,8 @@ <h3 id="create-and-apply-the-stateful-set"><a class="header" href="#create-and-a
requests:
# Tune the memory requests value carefully. Make sure, that the
# pods request at least:
# `ARGON2_M_COST` / 1024 * `MAX_HASH_THREADS` Mi
# With SQLite: for small deployments, add additional ~20-30Mi for
# "the rest", for larger ones ~50-70 Mi should be enough.
memory: 64Mi
# `ARGON2_M_COST` / 1024 * `MAX_HASH_THREADS` Mi + idle memory
memory: 164Mi
# The CPU needs to be adjusted during runtime. This heavily
# depends on your use case.
cpu: 100m
Expand Down
24 changes: 11 additions & 13 deletions docs/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -573,17 +573,17 @@ <h3 id="create-and-apply-secrets"><a class="header" href="#create-and-apply-secr
# The CACHE_AUTH_TOKEN is only needed for a deployment with HA_MODE == true
# Secret token, which is used to authenticate the cache members
#CACHE_AUTH_TOKEN:

# The database driver will be chosen at runtime depending on the given DATABASE_URL format. Examples:
# Sqlite: 'sqlite:data/rauthy.db' or 'sqlite::memory:'
# Postgres: 'postgresql://User:PasswordWithoutSpecialCharacters@localhost:5432/DatabaseName'
DATABASE_URL:
DATABASE_URL:

# Format: "key_id/enc_key another_key_id/another_enc_key" - the enc_key itself must be exactly 32 characters long and
# and should not contain special characters.
# The ID must match '[a-zA-Z0-9]{2,20}'
ENC_KEYS:

# Needed for sending E-Mails for password resets and so on
SMTP_PASSWORD:
</code></pre>
Expand Down Expand Up @@ -722,10 +722,8 @@ <h3 id="create-and-apply-the-stateful-set"><a class="header" href="#create-and-a
requests:
# Tune the memory requests value carefully. Make sure, that the
# pods request at least:
# `ARGON2_M_COST` / 1024 * `MAX_HASH_THREADS` Mi
# With SQLite: for small deployments, add additional ~20-30Mi for
# "the rest", for larger ones ~50-70 Mi should be enough.
memory: 64Mi
# `ARGON2_M_COST` / 1024 * `MAX_HASH_THREADS` Mi + idle memory
memory: 164Mi
# The CPU needs to be adjusted during runtime. This heavily
# depends on your use case.
cpu: 100m
Expand Down Expand Up @@ -2072,20 +2070,20 @@ <h2 id="finish"><a class="header" href="#finish">Finish</a></h2>
# for more information:
# https://sebadob.github.io/rauthy/config/argon2.html
# M_COST should never be below 32768 in production
ARGON2_M_COST=32768
ARGON2_M_COST=131072
# T_COST should never be below 1 in production
ARGON2_T_COST=3
ARGON2_T_COST=4
# P_COST should never be below 2 in production
ARGON2_P_COST=2
ARGON2_P_COST=8

# Limits the maximum amount of parallel password hashes at
# the exact same time to never exceed system memory while
# still allowing a good amount of memory for the argon2id
# algorithm (default: 2)
#
# CAUTION: You must make sure, that you have at least
# (MAX_HASH_THREADS * ARGON2_M_COST / 1024) + ~30 MB of memory
# available.
# (MAX_HASH_THREADS * ARGON2_M_COST / 1024) + idle memory
# of your deployment available
MAX_HASH_THREADS=1

# The time in ms when to log a warning, if a request waited
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.json

Large diffs are not rendered by default.

Loading