Very WIP PR, I just want some feedback about my approach for now.
I am planning to go with the allowed domains approach.
Overview:
We create 2 Hashmaps, which map the Host header to either Domain or Origin.
We create a hashmap, which maps the Host header to a combination of Domain and Origin.
Limitations:
All domains have to have the same path, because otherwise we would need one web server instance for each different path.
Future: - Change JWT system to create tokens, which work for a single domain.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/dani-garcia/vaultwarden/pull/3870
**Author:** [@BlockListed](https://github.com/BlockListed)
**Created:** 9/9/2023
**Status:** 🔄 Open
**Base:** `main` ← **Head:** `multiple-domains-support`
---
### 📝 Commits (10+)
- [`80d3c61`](https://github.com/dani-garcia/vaultwarden/commit/80d3c61cc2b7098a3dd7750a4ab68590d7510dcf) add configuration support for multiple domains
- [`40edfa5`](https://github.com/dani-garcia/vaultwarden/commit/40edfa59900a828de65ec1702dbbc10bedfcc086) implement mutli domain support for auth headers
- [`303eb30`](https://github.com/dani-garcia/vaultwarden/commit/303eb30ae4fc64afbb404b05db71705701a26709) remove domain_paths hashmap, since it's no longer used
- [`17923c3`](https://github.com/dani-garcia/vaultwarden/commit/17923c3fd0ca24a1d537c3e1e0d446f847ed0609) replace domain with base_url
- [`0ebd877`](https://github.com/dani-garcia/vaultwarden/commit/0ebd877fb86741ac16019ccdddcebdd6bdda3bfa) make admin work with multi-domains
- [`2c7b739`](https://github.com/dani-garcia/vaultwarden/commit/2c7b739d497d44590525a9611935ee913b705a55) make fido app-id.json work with multi-domains
- [`e313745`](https://github.com/dani-garcia/vaultwarden/commit/e313745f7c8d90b4dc6d3c350faef8e08af2ecd3) make domain protocol validation work with multi-domains
- [`0d7e678`](https://github.com/dani-garcia/vaultwarden/commit/0d7e678c2ee415cfc47e6455cfdbb1aed8d0177d) make mail work with multi-domains
- [`5462b97`](https://github.com/dani-garcia/vaultwarden/commit/5462b97c26cd7b8426919aee5bb6d5761299d15f) make cors work with multi-domains
- [`f82a142`](https://github.com/dani-garcia/vaultwarden/commit/f82a142ceed15f425e92c877abc11b4f5b3a0294) get domain and origin with single extractor
### 📊 Changes
**17 files changed** (+354 additions, -167 deletions)
<details>
<summary>View changed files</summary>
📝 `src/api/admin.rs` (+14 -9)
📝 `src/api/core/accounts.rs` (+11 -9)
📝 `src/api/core/ciphers.rs` (+11 -11)
📝 `src/api/core/emergency_access.rs` (+1 -1)
📝 `src/api/core/mod.rs` (+2 -1)
📝 `src/api/core/organizations.rs` (+5 -5)
📝 `src/api/core/public.rs` (+5 -3)
📝 `src/api/core/sends.rs` (+3 -3)
📝 `src/api/core/two_factor/webauthn.rs` (+45 -25)
📝 `src/api/identity.rs` (+30 -9)
📝 `src/api/web.rs` (+6 -3)
📝 `src/auth.rs` (+84 -39)
📝 `src/config.rs` (+89 -15)
📝 `src/db/models/attachment.rs` (+4 -4)
📝 `src/db/models/cipher.rs` (+3 -3)
📝 `src/mail.rs` (+28 -24)
📝 `src/util.rs` (+13 -3)
</details>
### 📄 Description
Fixes #2690
Very WIP PR, I just want some feedback about my approach for now.
I am planning to go with the allowed domains approach.
Overview:
- ~~We create 2 Hashmaps, which map the Host header to either Domain or Origin.~~
- We create a hashmap, which maps the Host header to a combination of Domain and Origin.
Limitations:
- All domains have to have the same path, because otherwise we would need one web server instance for each different path.
Future:
~~- Change JWT system to create tokens, which work for a single domain.~~
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/3870
Author: @BlockListed
Created: 9/9/2023
Status: 🔄 Open
Base:
main← Head:multiple-domains-support📝 Commits (10+)
80d3c61add configuration support for multiple domains40edfa5implement mutli domain support for auth headers303eb30remove domain_paths hashmap, since it's no longer used17923c3replace domain with base_url0ebd877make admin work with multi-domains2c7b739make fido app-id.json work with multi-domainse313745make domain protocol validation work with multi-domains0d7e678make mail work with multi-domains5462b97make cors work with multi-domainsf82a142get domain and origin with single extractor📊 Changes
17 files changed (+354 additions, -167 deletions)
View changed files
📝
src/api/admin.rs(+14 -9)📝
src/api/core/accounts.rs(+11 -9)📝
src/api/core/ciphers.rs(+11 -11)📝
src/api/core/emergency_access.rs(+1 -1)📝
src/api/core/mod.rs(+2 -1)📝
src/api/core/organizations.rs(+5 -5)📝
src/api/core/public.rs(+5 -3)📝
src/api/core/sends.rs(+3 -3)📝
src/api/core/two_factor/webauthn.rs(+45 -25)📝
src/api/identity.rs(+30 -9)📝
src/api/web.rs(+6 -3)📝
src/auth.rs(+84 -39)📝
src/config.rs(+89 -15)📝
src/db/models/attachment.rs(+4 -4)📝
src/db/models/cipher.rs(+3 -3)📝
src/mail.rs(+28 -24)📝
src/util.rs(+13 -3)📄 Description
Fixes #2690
Very WIP PR, I just want some feedback about my approach for now.
I am planning to go with the allowed domains approach.
Overview:
We create 2 Hashmaps, which map the Host header to either Domain or Origin.Limitations:
Future:
- Change JWT system to create tokens, which work for a single domain.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.