splent-feature-github 0.2.1__tar.gz → 0.3.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 (27) hide show
  1. {splent_feature_github-0.2.1/src/splent_feature_github.egg-info → splent_feature_github-0.3.0}/PKG-INFO +1 -1
  2. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/pyproject.toml +2 -2
  3. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0/src/splent_feature_github.egg-info}/PKG-INFO +1 -1
  4. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/hooks.py +6 -1
  5. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/templates/hooks/github_profile_row.html +9 -2
  6. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/translations/es/LC_MESSAGES/messages.mo +0 -0
  7. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/translations/es/LC_MESSAGES/messages.po +2 -0
  8. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/COPYING +0 -0
  9. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/COPYING.LESSER +0 -0
  10. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/MANIFEST.in +0 -0
  11. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/README.md +0 -0
  12. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/setup.cfg +0 -0
  13. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_feature_github.egg-info/SOURCES.txt +0 -0
  14. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_feature_github.egg-info/dependency_links.txt +0 -0
  15. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_feature_github.egg-info/top_level.txt +0 -0
  16. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/__init__.py +0 -0
  17. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/assets/css/github.css +0 -0
  18. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/config.py +0 -0
  19. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/migrations/alembic.ini +0 -0
  20. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/migrations/env.py +0 -0
  21. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/migrations/script.py.mako +0 -0
  22. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/migrations/versions/7ace6050fb3f_splent_feature_github.py +0 -0
  23. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/migrations/versions/github0002_into_ext_identity.py +0 -0
  24. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/models.py +0 -0
  25. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/routes.py +0 -0
  26. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/services.py +0 -0
  27. {splent_feature_github-0.2.1 → splent_feature_github-0.3.0}/src/splent_io/splent_feature_github/templates/hooks/github_login_button.html +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splent_feature_github
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  License-Expression: LGPL-3.0-or-later
5
5
  Requires-Python: >=3.13
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "splent_feature_github"
7
- version = "0.2.1"
7
+ version = "0.3.0"
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.13"
10
10
  license = "LGPL-3.0-or-later"
@@ -48,7 +48,7 @@ translations = ["es"]
48
48
  docker = []
49
49
 
50
50
  [tool.splent.contract.requires]
51
- features = ["auth", "identities", "profile"]
51
+ features = ["auth>=1.23.0", "identities>=0.3.0", "profile"]
52
52
  features_manual = ["profile"]
53
53
  features_optional = ["signup"]
54
54
  env_vars = ["GITHUB_CLIENT_ID", "GITHUB_CLIENT_SECRET", "GITHUB_SCOPE"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splent_feature_github
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  License-Expression: LGPL-3.0-or-later
5
5
  Requires-Python: >=3.13
6
6
  Description-Content-Type: text/markdown
@@ -37,11 +37,16 @@ def github_profile_row():
37
37
  from splent_io.splent_feature_github.services import PROVIDER, github_url
38
38
  from splent_io.splent_feature_identities.services import IdentitiesService
39
39
 
40
- identity = IdentitiesService().identity_of(current_user.id, PROVIDER)
40
+ identities = IdentitiesService()
41
+ identity = identities.identity_of(current_user.id, PROVIDER)
41
42
  return render_template(
42
43
  "hooks/github_profile_row.html",
43
44
  identity=identity,
44
45
  github_url=github_url(identity) if identity else None,
46
+ # The only way the account signs in is not disconnected: the row
47
+ # offers to set a password first.
48
+ can_disconnect=identity is not None
49
+ and identities.keeps_a_way_in(current_user, PROVIDER, identity.provider_id),
45
50
  )
46
51
 
47
52
 
@@ -1,8 +1,9 @@
1
1
  {# A section of profile's edit page (profile.edit.sections), below the
2
2
  profile form. The login links to the account on GitHub. The disconnect
3
3
  button opens identities' modal, which posts the provider and account id
4
- it carries. The colours are in assets/css/github.css, and the mark is
5
- drawn in currentColor. #}
4
+ it carries; for the only way the account signs in, a link to set a
5
+ password comes first. The colours are in assets/css/github.css, and the
6
+ mark is drawn in currentColor. #}
6
7
  {% if identity %}
7
8
  <div class="mb-4 profile-identity" data-identity="github">
8
9
  <label class="form-label fw-semibold">GitHub</label>
@@ -15,12 +16,18 @@
15
16
  {% else %}
16
17
  <span class="github-identity__value">{{ identity.provider_id }}</span>
17
18
  {% endif %}
19
+ {% if can_disconnect %}
18
20
  <button type="button" class="btn btn-sm p-0 github-identity__disconnect" title="{{ _('Disconnect') }}" aria-label="{{ _('Disconnect') }}" data-bs-toggle="modal" data-bs-target="#disconnectModal" data-provider="github" data-provider-id="{{ identity.provider_id }}">
19
21
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
20
22
  <line x1="18" y1="6" x2="6" y2="18"></line>
21
23
  <line x1="6" y1="6" x2="18" y2="18"></line>
22
24
  </svg>
23
25
  </button>
26
+ {% else %}
27
+ {# The only way the account signs in: a password of its own comes
28
+ first, on My account, and then it can be disconnected. #}
29
+ <a class="ms-auto small github-identity__set-password" href="{{ url_for('auth.my_account', _anchor='password') }}" data-set-password-first>{{ _('Set a password to disconnect it') }}</a>
30
+ {% endif %}
24
31
  </div>
25
32
  </div>
26
33
  {% else %}
@@ -31,3 +31,5 @@ msgstr "Desconectar"
31
31
  msgid "Connect GitHub"
32
32
  msgstr "Conectar GitHub"
33
33
 
34
+ msgid "Set a password to disconnect it"
35
+ msgstr "Establece una contraseña para desconectarla"