DSD-DBS / capella-collab-manager

A web app for collaboration on Capella (MBSE) projects
https://dsd-dbs.github.io/capella-collab-manager/
Apache License 2.0
20 stars 3 forks source link

feat: Add abstraction for OIDCProvider and add identification field #1653

Closed dominik003 closed 3 weeks ago

dominik003 commented 1 month ago

This PR refactors the OIDC configuration and flow by introducing proper interfaces and classes instead of using simple functions. This approach follows the Dependency Inversion Principle, which seems appropriate here. In addition to the general points mentioned there, this approach makes it really easy to create mock OIDC configuration and flow classes that can be used in tests, and allows us or a third party to easily integrate additional implementations as needed. For example, if a user has a requirement to use the asymmetric variant of OAuth/OIDC instead of a client id and client secret, an additional provider can be integrated. Another example would be the case where an OIDC provider does not support the wellk-known endpoint, or a company requires this to be set statically in the configuration. In both cases, we would only need to add another concrete implementation, and only the injection mechanism would need to be adjusted.

However, removing the abstraction is also easy and fast to do, and I can also see the point of not introducing it. Let's quickly discuss it next Monday, @MoritzWeber0 but other than that and the open TODOs below this PR can be reviewed.

MoritzWeber0 commented 1 month ago

Fixes the identification parts of https://github.com/DSD-DBS/capella-collab-manager/issues/1645

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud