plain.oauth 0.21.0__tar.gz → 0.22.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/PKG-INFO +1 -1
- plain_oauth-0.22.0/plain/oauth/CHANGELOG.md +11 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/models.py +21 -24
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/pyproject.toml +1 -1
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/app/settings.py +3 -5
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/test_checks.py +2 -2
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/.gitignore +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/LICENSE +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/README.md +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/README.md +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/__init__.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/admin.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/config.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/default_settings.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/exceptions.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/migrations/0001_initial.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/migrations/0002_alter_oauthconnection_options_and_more.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/migrations/0003_alter_oauthconnection_access_token_and_more.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/migrations/0004_alter_oauthconnection_access_token_and_more.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/migrations/0005_alter_oauthconnection_unique_together_and_more.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/migrations/0006_remove_oauthconnection_unique_oauth_provider_user_id_and_more.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/migrations/0007_alter_oauthconnection_provider_key_and_more.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/migrations/__init__.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/providers.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/templates/oauth/callback.html +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/urls.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/plain/oauth/views.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/provider_examples/__init__.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/provider_examples/bitbucket.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/provider_examples/github.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/provider_examples/gitlab.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/app/templates/base.html +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/app/templates/index.html +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/app/templates/login.html +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/app/urls.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/app/users/migrations/0001_initial.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/app/users/migrations/__init__.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/app/users/models.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/provider_tests/__init__.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/provider_tests/test_github.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/providers/__init__.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/providers/bitbucket.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/providers/github.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/providers/gitlab.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/test_backends.py +0 -0
- {plain_oauth-0.21.0 → plain_oauth-0.22.0}/tests/test_providers.py +0 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
# plain-oauth changelog
|
2
|
+
|
3
|
+
## [0.22.0](https://github.com/dropseed/plain/releases/plain-oauth@0.22.0) (2025-06-23)
|
4
|
+
|
5
|
+
### What's changed
|
6
|
+
|
7
|
+
- Updated `OAuthConnection.check()` to accept a single `database` argument instead of the older `databases` list, matching the new single `DATABASE` setting used across the Plain stack ([d346d81](https://github.com/dropseed/plain/commit/d346d81))
|
8
|
+
|
9
|
+
### Upgrade instructions
|
10
|
+
|
11
|
+
- No changes required.
|
@@ -164,34 +164,31 @@ class OAuthConnection(models.Model):
|
|
164
164
|
"""
|
165
165
|
errors = super().check(**kwargs)
|
166
166
|
|
167
|
-
|
168
|
-
if not
|
167
|
+
database = kwargs.get("database", False)
|
168
|
+
if not database:
|
169
169
|
return errors
|
170
170
|
|
171
171
|
from .providers import get_provider_keys
|
172
172
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
", ".join(keys_in_db - keys_in_settings)
|
192
|
-
),
|
193
|
-
id="plain.oauth.E001",
|
194
|
-
)
|
173
|
+
try:
|
174
|
+
keys_in_db = set(
|
175
|
+
cls.objects.values_list("provider_key", flat=True).distinct()
|
176
|
+
)
|
177
|
+
except (OperationalError, ProgrammingError):
|
178
|
+
# Check runs on manage.py migrate, and the table may not exist yet
|
179
|
+
# or it may not be installed on the particular database intentionally
|
180
|
+
return errors
|
181
|
+
|
182
|
+
keys_in_settings = set(get_provider_keys())
|
183
|
+
|
184
|
+
if keys_in_db - keys_in_settings:
|
185
|
+
errors.append(
|
186
|
+
Error(
|
187
|
+
"The following OAuth providers are in the database but not in the settings: {}".format(
|
188
|
+
", ".join(keys_in_db - keys_in_settings)
|
189
|
+
),
|
190
|
+
id="plain.oauth.E001",
|
195
191
|
)
|
192
|
+
)
|
196
193
|
|
197
194
|
return errors
|
@@ -9,11 +9,9 @@ INSTALLED_PACKAGES = [
|
|
9
9
|
"plain.oauth",
|
10
10
|
"app.users",
|
11
11
|
]
|
12
|
-
|
13
|
-
"
|
14
|
-
|
15
|
-
"NAME": ":memory:",
|
16
|
-
}
|
12
|
+
DATABASE = {
|
13
|
+
"ENGINE": "plain.models.backends.sqlite3",
|
14
|
+
"NAME": ":memory:",
|
17
15
|
}
|
18
16
|
MIDDLEWARE = [
|
19
17
|
"plain.sessions.middleware.SessionMiddleware",
|
@@ -25,7 +25,7 @@ def test_oauth_provider_keys_check_pass(db, settings):
|
|
25
25
|
access_token="test",
|
26
26
|
)
|
27
27
|
|
28
|
-
errors = OAuthConnection.check(
|
28
|
+
errors = OAuthConnection.check(database=True)
|
29
29
|
assert len(errors) == 0
|
30
30
|
|
31
31
|
|
@@ -58,7 +58,7 @@ def test_oauth_provider_keys_check_fail(db, settings):
|
|
58
58
|
access_token="test",
|
59
59
|
)
|
60
60
|
|
61
|
-
errors = OAuthConnection.check(
|
61
|
+
errors = OAuthConnection.check(database=True)
|
62
62
|
assert len(errors) == 1
|
63
63
|
assert (
|
64
64
|
errors[0].msg
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|