Skip to content

Commit 7fdfd0f

Browse files
committed
Adjust the sourcehut_token field and documentation #348
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent b6036ba commit 7fdfd0f

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.2.4 on 2025-08-11 14:51
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('dje', '0011_dataspaceconfiguration_forgejo_token_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='dataspaceconfiguration',
15+
name='sourcehut_token',
16+
field=models.CharField(blank=True, help_text='Access token used to authenticate API requests for the SourceHut integration. This token must have permissions to create and update tickets. Keep this token secure.', max_length=2048, verbose_name='SourceHut token'),
17+
),
18+
]

dje/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ class DataspaceConfiguration(models.Model):
572572

573573
sourcehut_token = models.CharField(
574574
_("SourceHut token"),
575-
max_length=255,
575+
max_length=2048, # The length of this token depends on the selected permissions
576576
blank=True,
577577
help_text=_(
578578
"Access token used to authenticate API requests for the SourceHut integration. "

docs/integrations-sourcehut.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ To enable integration, you need a SourceHut **API token**.
2424
- Go to https://meta.sr.ht/oauth2
2525
- Under **Personal Access Tokens**, click **"Generate new token"**
2626
- Set a clear description like ``DejaCode Integration`` in the "Comment" field
27-
- Select only the ``todo.sr.ht`` > ``TICKETS`` scope
28-
- **Generate token** and copy the token
27+
- Select **both** the ``todo.sr.ht`` > ``TRACKERS`` AND ``TICKETS`` scopes
28+
- **Generate token** and copy the **entire token string**
2929

3030
.. note::
3131

0 commit comments

Comments
 (0)