[BUG] Don't remove builtin OAuth2 applications

- When the database consistency is being run it would check for any
OAuth2 applications that don't have an existing user. However there are
few special OAuth2 applications that don't have an user set, because
they are global applications.
- This was not taken into account by the database consistency checker
and were removed if the database consistency check was being run with
autofix enabled.
- Take into account to ignore these global OAuth2 applications when
running the database consistency check.
- Add unit tests.
- Ref: https://codeberg.org/Codeberg/Community/issues/1530

(cherry picked from commit 6af8f3a3f2)
This commit is contained in:
Gusted 2024-04-06 00:52:39 +02:00 committed by GitHub
parent 7e5fed7e29
commit 2236574d50
4 changed files with 93 additions and 3 deletions

View file

@ -0,0 +1,25 @@
-
id: 1000
uid: 0
name: "Git Credential Manager"
client_id: "e90ee53c-94e2-48ac-9358-a874fb9e0662"
redirect_uris: '["http://127.0.0.1", "https://127.0.0.1"]'
created_unix: 1712358091
updated_unix: 1712358091
-
id: 1001
uid: 0
name: "git-credential-oauth"
client_id: "a4792ccc-144e-407e-86c9-5e7d8d9c3269"
redirect_uris: '["http://127.0.0.1", "https://127.0.0.1"]'
created_unix: 1712358091
updated_unix: 1712358091
-
id: 1002
uid: 1234567890
name: "Should be removed"
client_id: "deadc0de-badd-dd11-fee1-deaddecafbad"
redirect_uris: '["http://127.0.0.1", "https://127.0.0.1"]'
created_unix: 1712358091
updated_unix: 1712358091