Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ef3dadc
#375: first draft
basmasking Apr 6, 2025
8698695
#375: added tenant and host concept
basmasking Apr 10, 2025
eb33975
Merge branch 'main' into 375-multitenancy-support
basmasking Apr 13, 2025
d072c0b
#375: renamed host to origin
basmasking Apr 25, 2025
f2f2cb5
Merge branch 'main' into 375-multitenancy-support
basmasking Jun 20, 2025
5083072
Refactor origin domain and add creation logic with tests
basmasking Jun 20, 2025
c660607
#375: updated segment config
basmasking Jun 20, 2025
c1ebbca
#374: copyright updated (boyscout)
basmasking Jun 20, 2025
91a847c
Merge branch 'main' into 375-multitenancy-support
basmasking Jul 4, 2025
f599911
#375: first draft
basmasking Jul 18, 2025
33a315b
#375: bumped jitar for middleware execution fix
basmasking Jul 19, 2025
57c0557
#375: default tenant added to db on initialization
basmasking Jul 19, 2025
85bab70
#375: tenantId as required parameter
basmasking Jul 19, 2025
8526f2d
#375: added tests for tenant domain
basmasking Jul 19, 2025
ca63b1d
#375: updated tests for required tenant(Id)
basmasking Jul 19, 2025
e3af2bf
Merge branch 'main' into 375-multitenancy-support
basmasking Jul 19, 2025
e331c99
#375: reset dependency that got lost in merge
basmasking Jul 19, 2025
856a9d5
#375: processed feedback
basmasking Jul 22, 2025
99bb8f2
#375: required URL validation for origin
basmasking Jul 22, 2025
00263af
#375: moved bff before the gateway
basmasking Jul 22, 2025
bde9263
#375: fixed sonar issues
basmasking Jul 22, 2025
23d5422
#375: added tenant information for more bff functions
basmasking Jul 22, 2025
918ad2d
#375: SameSite to None for social logins
basmasking Jul 22, 2025
07eb225
#375: fixed invalid segment configuration
basmasking Jul 22, 2025
9340c75
#375: picked up some nitpicks
basmasking Jul 25, 2025
24714d9
#375: tenant always as first function parameter
basmasking Jul 25, 2025
2832763
#375: forgot to update the test description
basmasking Jul 25, 2025
b93be8b
#375: removed obsolete features
basmasking Jul 26, 2025
3797ad5
#375: processed feedback
basmasking Jul 26, 2025
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
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
restart: always
volumes:
- comify-mongo-data:/data/db
- "${MONGODB_INIT_PATH}:/docker-entrypoint-initdb.d"
ports:
- "${MONGODB_PORT_NUMBER:-27017}:27017"
environment:
Expand Down
9 changes: 9 additions & 0 deletions docker/mongodb/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

db = db.getSiblingDB('comify');
db.tenant.insertOne({
_id: 'localhost',
origins: [
'http://localhost:3000',
'http://localhost:5173'
]
});
2 changes: 1 addition & 1 deletion docs/integrations/AUTHENTICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ In case of OpenID, additional configuration is required.
OPENID_ISSUER="http://localhost:8080/realms/comify"
OPENID_CLIENT_ID="openid"
OPENID_CLIENT_SECRET=""
OPENID_REDIRECT_URI="http://localhost:3000/rpc/domain/authentication/login"
OPENID_REDIRECT_PATH="/rpc/domain/authentication/login"
OPENID_ALLOW_INSECURE_REQUESTS=true
```

Expand Down
3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default tseslint.config(
"**/dist/**/*",
"**/node_modules/**/*",
"**/coverage/**/*",
"**/*config*"
"**/*config*",
"docker"
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ MINIO_ACCESS_KEY="development"
MINIO_SECRET_KEY="development"

# AUTHENTICATION (openid)
AUTHENTICATION_CLIENT_URI="http://localhost:5173/identify"
AUTHENTICATION_CLIENT_PATH="/identify"
AUTHENTICATION_IMPLEMENTATION="openid"
OPENID_ISSUER="http://localhost:8080/realms/comify"
OPENID_CLIENT_ID="openid"
OPENID_CLIENT_SECRET=""
OPENID_REDIRECT_URI="http://localhost:3000/rpc/domain/authentication/login"
OPENID_REDIRECT_PATH="/rpc/domain/authentication/login"
OPENID_ALLOW_INSECURE_REQUESTS=false

# HTTP (fetch)
Expand Down Expand Up @@ -58,6 +58,7 @@ VALIDATION_IMPLEMENTATION="zod"
MONGODB_PORT_NUMBER=27017
MONGODB_ROOT_USERNAME="development"
MONGODB_ROOT_PASSWORD="development"
MONGODB_INIT_PATH="./docker/mongodb"

# MONGO EXPRESS
MONGO_EXPRESS_PORT_NUMBER=8081
Expand Down
86 changes: 43 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
],
"dependencies": {
"dayjs": "^1.11.13",
"jitar": "^0.9.3",
"jitar": "^0.10.0",
"minio": "^8.0.5",
"mongodb": "^6.17.0",
"openid-client": "^6.5.1",
Expand All @@ -51,7 +51,7 @@
},
"devDependencies": {
"@eslint/js": "^9.30.1",
"@jitar/plugin-vite": "^0.9.3",
"@jitar/plugin-vite": "^0.10.0",
"@types/node": "24.0.10",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
Expand Down
14 changes: 10 additions & 4 deletions segments/bff.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"./domain/authentication/login": { "default": { "access": "public" } },
"./domain/authentication/logout": { "default": { "access": "public" } },

"./domain/creator/aggregate": { "default": { "access": "private" }},
"./domain/creator/getByIdAggregated": { "default": { "access": "private" } },
"./domain/creator/getByNicknameAggregated": { "default": { "access": "public" } },
"./domain/creator/getMeAggregated": { "default": { "access": "public" } },
"./domain/creator/updateFullName": { "default": { "access": "public" } },
Expand All @@ -13,18 +15,19 @@
"./domain/creator.metrics/updateFollowing": { "subscriptions": { "access": "private" } },
"./domain/creator.metrics/updatePosts": { "subscriptions": { "access": "private" } },

"./domain/notification/aggregate": { "default": { "access": "private" } },
"./domain/notification/notify": { "subscriptions": { "access": "private" } },
"./domain/notification/getRecentAggregated": { "default": { "access": "public" } },
"./domain/notification/getByIdAggregated": { "default": { "access": "public" } },

"./domain/post/aggregate": { "default": { "access": "private" } },
"./domain/post/create": { "default": { "access": "private" }, "subscribe": { "access": "private" } },
"./domain/post/createWithComic": { "default": { "access": "public" } },
"./domain/post/createWithComment": { "default": { "access": "public" } },
"./domain/post/getByCreatorAggregated": { "default": { "access": "public" } },
"./domain/post/getByFollowingAggregated": { "default": { "access": "public" } },
"./domain/post/exploreAggregated": { "default": { "access": "public" } },
"./domain/post/getByIdAggregated": { "default": { "access": "public" } },
"./domain/post/getByParentAggregated": { "default": { "access": "public" } },
"./domain/post/getByCreatorAggregated": { "default": { "access": "public" } },
"./domain/post/getByFollowingAggregated": { "default": { "access": "public" } },
"./domain/post/getRecommendedAggregated": { "default": { "access": "public"}},
"./domain/post/remove": { "default": { "access": "public" }, "subscribe": { "access": "private" } },

Expand All @@ -34,9 +37,12 @@

"./domain/rating/toggle": { "default": { "access": "public" }, "subscribe": { "access": "private" } },

"./domain/relation/aggregate": { "default": { "access": "private" }},
"./domain/relation/exploreAggregated": { "default": { "access": "public" } },
"./domain/relation/establish": { "default": { "access": "public" }, "subscribe": { "access": "private" } },
"./domain/relation/getAggregated": { "default": { "access": "public" } },
"./domain/relation/getFollowersAggregated": { "default": { "access": "public" } },
"./domain/relation/getFollowingAggregated": { "default": { "access": "public" } }
"./domain/relation/getFollowingAggregated": { "default": { "access": "public" } },

"./domain/tenant/getByOriginConverted": { "default": { "access": "public" } }
}
1 change: 0 additions & 1 deletion segments/notification.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"./domain/notification/create": { "default": { "access": "protected" } },
"./domain/notification/getById": { "default": { "access": "protected" } },
"./domain/notification/getByPostId": { "default": { "access": "protected" } },
"./domain/notification/getRecent": { "default": { "access": "protected" } },
"./domain/notification/remove": { "default": { "access": "protected" } }
Expand Down
10 changes: 8 additions & 2 deletions segments/reads.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@

"./domain/comment/getById": { "default": { "access": "protected" } },

"./domain/creator/getById": { "default": { "access": "protected" } },
"./domain/creator/generateNickname/retrieveByNickname": { "default": { "access": "protected" } },
"./domain/creator/generateNickname/retrieveByStartNickname": { "default": { "access": "protected" } },
"./domain/creator/getByEmail": { "default": { "access": "protected" } },
"./domain/creator/getById": { "default": { "access": "protected" } },
"./domain/creator/getByNickname": { "default": { "access": "protected" } },
"./domain/creator/getMe": { "default": { "access": "protected" } },
"./domain/creator/getOthers": { "default": { "access": "private" }},
"./domain/creator/updateNickname/retrieveByNickname": { "default": { "access": "protected" } },

"./domain/creator.metrics/getByCreator": { "default": { "access": "protected" } },

Expand All @@ -28,5 +32,7 @@
"./domain/relation/explore": { "default": { "access": "protected" } },
"./domain/relation/get": { "default": { "access": "protected" } },
"./domain/relation/getFollowers": { "default": { "access": "protected" } },
"./domain/relation/getFollowing": { "default": { "access": "protected" } }
"./domain/relation/getFollowing": { "default": { "access": "protected" } },

"./domain/tenant/getByOrigin": { "default": { "access": "protected" }, "TenantNotFound": { } }
}
4 changes: 3 additions & 1 deletion segments/writes.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
"./domain/comment/erase": { "default": { "access": "protected" } },

"./domain/creator/create": { "default": { "access": "protected" } },
"./domain/creator/erase": { "default": { "access": "protected" } },
"./domain/creator/update": { "default": { "access": "protected" } },

"./domain/creator.metrics/create/insertData": { "default": { "access": "protected" } },
"./domain/creator.metrics/update": { "default": { "access": "protected" } },

"./domain/image/save": { "default": { "access": "protected" } },
"./domain/image/erase": { "default": { "access": "protected" } },
"./domain/image/save": { "default": { "access": "protected" } },

"./domain/post/create/insertData": { "default": { "access": "protected" } },
"./domain/post/erase": { "default": { "access": "protected" } },
"./domain/post/remove/deleteData": { "default": { "access": "protected" }},
"./domain/post/remove/undeleteData": { "default": { "access": "protected" }},
"./domain/post/update": { "default": { "access": "protected" } },

"./domain/post.metrics/create/insertData": { "default": { "access": "protected" } },
Expand Down
5 changes: 5 additions & 0 deletions services/bff.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"tearDown": [
"./integrations/runtime/tearDownBff"
],
"middleware": [
"./integrations/runtime/originMiddleware",
"./integrations/runtime/authenticationMiddleware",
"./integrations/runtime/tenantMiddleware"
],
"worker":
{
"gateway": "http://127.0.0.1:2000",
Expand Down
9 changes: 0 additions & 9 deletions services/gateway.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
{
"url": "http://127.0.0.1:2000",
"setUp": [
"./integrations/runtime/setUpGateway"
],
"tearDown": [
"./integrations/runtime/tearDownGateway"
],
"middleware": [
"./integrations/runtime/authenticationMiddleware"
],
"gateway":
{
"trustKey": "${JITAR_TRUST_KEY}"
Expand Down
Loading