Skip to content

Commit 21cf02b

Browse files
committed
add migration for django-oauth-toolkit update, alter templates, pin version
1 parent 6d3f412 commit 21cf02b

File tree

4 files changed

+58
-13
lines changed

4 files changed

+58
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Django 5.0.6 on 2024-07-02 21:27
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("api", "0003_application_post_logout_redirect_uris"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="application",
15+
name="allowed_origins",
16+
field=models.TextField(
17+
blank=True,
18+
default="",
19+
help_text="Allowed origins list to enable CORS, space separated",
20+
),
21+
),
22+
migrations.AddField(
23+
model_name="application",
24+
name="hash_client_secret",
25+
field=models.BooleanField(default=True),
26+
),
27+
migrations.AlterField(
28+
model_name="accesstoken",
29+
name="token",
30+
field=models.CharField(db_index=True, max_length=255, unique=True),
31+
),
32+
migrations.AlterField(
33+
model_name="application",
34+
name="post_logout_redirect_uris",
35+
field=models.TextField(
36+
blank=True, default="", help_text="Allowed Post Logout URIs list, space separated"
37+
),
38+
),
39+
]

ephios/api/templates/oauth2_provider/application_detail.html

+17-8
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,25 @@ <h3 class="block-center-heading">{{ application.name }}</h3>
1616

1717
</div>
1818
</div>
19-
<div class="mb-3">
20-
<label for="client_secret" class="form-label">{% translate "Client secret" %}</label>
21-
<div class="input-group">
22-
<input id="client_secret" class="form-control" type="text" value="{{ application.client_secret }}"
19+
{% if application.hash_client_secret %}
20+
<div class="mb-3">
21+
<label for="client_secret" class="form-label">{% translate "Client secret" %}</label>
22+
<input id="client_secret" class="form-control" type="text" value="********"
2323
readonly>
24-
<button id="client_secret-copy-btn" class="btn btn-outline-secondary clipboard-button" type="button"
25-
data-clipboard-target="#client_secret" data-trigger="manual"
26-
title="Copied!">{% translate "Copy" %}</button>
24+
<div class="form-text">{% translate "The client secret can not be shown again. Please edit the application and set a new secret if necessary." %}</div>
2725
</div>
28-
</div>
26+
{% else %}
27+
<div class="mb-3">
28+
<label for="client_secret" class="form-label">{% translate "Client secret" %}</label>
29+
<div class="input-group">
30+
<input id="client_secret" class="form-control" type="text" value="{{ application.client_secret }}"
31+
readonly>
32+
<button id="client_secret-copy-btn" class="btn btn-outline-secondary clipboard-button" type="button"
33+
data-clipboard-target="#client_secret" data-trigger="manual"
34+
title="Copied!">{% translate "Copy" %}</button>
35+
</div>
36+
</div>
37+
{% endif %}
2938
<div class="mb-3">
3039
<label for="client_type" class="form-label">{% translate "Client type" %}</label>
3140
<input id="client_type" class="form-control" type="text" value="{{ application.client_type }}"

poetry.lock

+1-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ django-filter = "^24.0"
4040
djangorestframework-guardian = "^0.3.0"
4141
uritemplate = "^4.1.1"
4242
django-recurrence = "^1.11.1"
43-
django-oauth-toolkit = "^2.3.0"
43+
django-oauth-toolkit = "~2.4.0" # pinned because minor versions sometimes require migrations in our models
4444
urllib3 = "^1.26.0,<2.0.0" # pinned because of uberspace issues with urllib3 2.0.0
4545
pyyaml = "^6.0.1"
4646
lxml = ">=4.9.3,<6.0.0"

0 commit comments

Comments
 (0)