Replies: 1 comment 2 replies
-
|
@aeneasr @zepatrik, let me know your thoughts. Perhaps I can contribute to the repo by adding those features. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @zepatrik / team,
Current Setup:
Upon inspection, I found 2 peculiar things regarding the setup:
CASCADE DELETEoperation. However, I didn't find any use for those foreign key references on the Ory Hydra application. Thus, I want to understand its role apart from data integrity when someone is deleting the top-level items from the row e.g.:- deleting an existing client would interactively delete the corresponding flow, code, access token, and refresh token. Attaching the following diagram for everyone's referencegraph TD subgraph "Core Tables" Client[hydra_client] JWK[hydra_jwk] end subgraph "Session Tables" AuthSession[hydra_oauth2_authentication_session] ObfuscatedSession[hydra_oauth2_obfuscated_authentication_session] end subgraph "Flow Tables" Flow[hydra_oauth2_flow] LogoutRequest[hydra_oauth2_logout_request] end subgraph "Token Tables" Access[hydra_oauth2_access] Refresh[hydra_oauth2_refresh] Code[hydra_oauth2_code] OIDC[hydra_oauth2_oidc] PKCE[hydra_oauth2_pkce] end subgraph "Other Tables" JTIBlacklist[hydra_oauth2_jti_blacklist] TrustedJWT[hydra_oauth2_trusted_jwt_bearer_issuer] end %% Dependencies with cascade Client -->|CASCADE| Flow Client -->|CASCADE| LogoutRequest Client -->|CASCADE| ObfuscatedSession Flow -->|CASCADE| Access Flow -->|CASCADE| Refresh Flow -->|CASCADE| Code Flow -->|CASCADE| OIDC Flow -->|CASCADE| PKCE JWK -->|CASCADE| TrustedJWT %% Dependencies with SET NULL AuthSession -.->|SET NULL| Flow %% Independent tables JTIBlacklistoauth2/token. I see the application uses theDELETEcommand and that too on access tokens and refresh tokens (in some corner cases). Based on the general best practice, I had seen people soft deleting (disabling) the row instead of removing it altogether (And later on, manually running a clean-up job or letting the corresponding TTL take care of clean-up as long as the DB supports TTL). Currently, I am interested in knowing the thought process behind using the restrictDELETEcommand instead of soft delete. I can see many tables have anactive(true/false) column that can be used as a soft delete column.Let me know if something can be done. Perhaps, I can contribute to some point by introducing a soft delete feature on at least these following tables:
Let me know in case of any doubts.
Beta Was this translation helpful? Give feedback.
All reactions