plain.oauth 0.26.0__tar.gz → 0.27.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.
Files changed (40) hide show
  1. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/PKG-INFO +1 -1
  2. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/CHANGELOG.md +13 -0
  3. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/models.py +6 -13
  4. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/pyproject.toml +1 -1
  5. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/test_checks.py +4 -4
  6. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/.gitignore +0 -0
  7. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/LICENSE +0 -0
  8. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/README.md +0 -0
  9. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/README.md +0 -0
  10. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/__init__.py +0 -0
  11. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/admin.py +0 -0
  12. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/config.py +0 -0
  13. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/default_settings.py +0 -0
  14. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/exceptions.py +0 -0
  15. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/migrations/0001_initial.py +0 -0
  16. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/migrations/__init__.py +0 -0
  17. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/providers.py +0 -0
  18. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/templates/oauth/callback.html +0 -0
  19. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/urls.py +0 -0
  20. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/plain/oauth/views.py +0 -0
  21. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/provider_examples/__init__.py +0 -0
  22. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/provider_examples/bitbucket.py +0 -0
  23. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/provider_examples/github.py +0 -0
  24. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/provider_examples/gitlab.py +0 -0
  25. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/app/settings.py +0 -0
  26. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/app/templates/base.html +0 -0
  27. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/app/templates/index.html +0 -0
  28. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/app/templates/login.html +0 -0
  29. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/app/urls.py +0 -0
  30. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/app/users/migrations/0001_initial.py +0 -0
  31. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/app/users/migrations/__init__.py +0 -0
  32. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/app/users/models.py +0 -0
  33. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/provider_tests/__init__.py +0 -0
  34. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/provider_tests/test_github.py +0 -0
  35. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/providers/__init__.py +0 -0
  36. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/providers/bitbucket.py +0 -0
  37. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/providers/github.py +0 -0
  38. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/providers/gitlab.py +0 -0
  39. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/test_backends.py +0 -0
  40. {plain_oauth-0.26.0 → plain_oauth-0.27.0}/tests/test_providers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.oauth
3
- Version: 0.26.0
3
+ Version: 0.27.0
4
4
  Summary: Let users log in with OAuth providers.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -1,5 +1,18 @@
1
1
  # plain-oauth changelog
2
2
 
3
+ ## [0.27.0](https://github.com/dropseed/plain/releases/plain-oauth@0.27.0) (2025-09-25)
4
+
5
+ ### What's changed
6
+
7
+ - The `OAuthConnection.check()` method has been replaced with `OAuthConnection.preflight()` as part of the new preflight system ([b0b610d](https://github.com/dropseed/plain/commit/b0b610d461))
8
+ - Preflight check IDs have been renamed from numeric format (e.g., `plain.oauth.E001`) to descriptive names (e.g., `oauth.provider_in_db_not_in_settings`) ([cd96c97](https://github.com/dropseed/plain/commit/cd96c97b25))
9
+ - Preflight messages now provide clearer fix instructions directly in the `fix` attribute ([c7cde12](https://github.com/dropseed/plain/commit/c7cde12149))
10
+
11
+ ### Upgrade instructions
12
+
13
+ - If you have custom code that calls `OAuthConnection.check()`, update it to use `OAuthConnection.preflight()` instead
14
+ - If you have code that references specific preflight check IDs (e.g., `plain.oauth.E001`), update them to use the new descriptive format (e.g., `oauth.provider_in_db_not_in_settings`)
15
+
3
16
  ## [0.26.0](https://github.com/dropseed/plain/releases/plain-oauth@0.26.0) (2025-09-12)
4
17
 
5
18
  ### What's changed
@@ -5,7 +5,7 @@ from plain.auth import get_user_model
5
5
  from plain.exceptions import ValidationError
6
6
  from plain.models import transaction
7
7
  from plain.models.db import IntegrityError, OperationalError, ProgrammingError
8
- from plain.preflight import Error
8
+ from plain.preflight import PreflightResult
9
9
  from plain.runtime import SettingsReference
10
10
  from plain.utils import timezone
11
11
 
@@ -155,18 +155,11 @@ class OAuthConnection(models.Model):
155
155
  return connection
156
156
 
157
157
  @classmethod
158
- def check(cls, **kwargs):
158
+ def preflight(cls):
159
159
  """
160
160
  A system check for ensuring that provider_keys in the database are also present in settings.
161
-
162
- Note that the --database flag is required for this to work:
163
- plain check --database default
164
161
  """
165
- errors = super().check(**kwargs)
166
-
167
- database = kwargs.get("database", False)
168
- if not database:
169
- return errors
162
+ errors = super().preflight()
170
163
 
171
164
  from .providers import get_provider_keys
172
165
 
@@ -183,11 +176,11 @@ class OAuthConnection(models.Model):
183
176
 
184
177
  if keys_in_db - keys_in_settings:
185
178
  errors.append(
186
- Error(
187
- "The following OAuth providers are in the database but not in the settings: {}".format(
179
+ PreflightResult(
180
+ fix="The following OAuth providers are in the database but not in the settings: {}. Add these providers to your OAUTH_LOGIN_PROVIDERS setting or remove the corresponding OAuthConnection records.".format(
188
181
  ", ".join(keys_in_db - keys_in_settings)
189
182
  ),
190
- id="plain.oauth.E001",
183
+ id="oauth.provider_in_db_not_in_settings",
191
184
  )
192
185
  )
193
186
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "plain.oauth"
3
- version = "0.26.0"
3
+ version = "0.27.0"
4
4
  description = "Let users log in with OAuth providers."
5
5
  authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
6
6
  license = "BSD-3-Clause"
@@ -23,7 +23,7 @@ def test_oauth_provider_keys_check_pass(db, settings):
23
23
  access_token="test",
24
24
  )
25
25
 
26
- errors = OAuthConnection.check(database=True)
26
+ errors = OAuthConnection.preflight()
27
27
  assert len(errors) == 0
28
28
 
29
29
 
@@ -54,9 +54,9 @@ def test_oauth_provider_keys_check_fail(db, settings):
54
54
  access_token="test",
55
55
  )
56
56
 
57
- errors = OAuthConnection.check(database=True)
57
+ errors = OAuthConnection.preflight()
58
58
  assert len(errors) == 1
59
59
  assert (
60
- errors[0].msg
61
- == "The following OAuth providers are in the database but not in the settings: bar"
60
+ errors[0].fix
61
+ == "The following OAuth providers are in the database but not in the settings: bar. Add these providers to your OAUTH_LOGIN_PROVIDERS setting or remove the corresponding OAuthConnection records."
62
62
  )
File without changes
File without changes
File without changes