Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: typos, uniform ctype in userinfo, jwt ES stored in TextField #291

Merged
merged 6 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/provider/provider/settingslocal.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ APPEND_SLASH = False
# required for onboarding checks and also for all the leafs
OIDCFED_DEFAULT_TRUST_ANCHOR = "http://127.0.0.1:8000"
OIDCFED_TRUST_ANCHORS = [OIDCFED_DEFAULT_TRUST_ANCHOR]
OIDCFED_PROVIDER_PROFILE = "spid"
OIDCFED_PROVIDER_PROFILE = "cie"
#OIDCFED_PROVIDER_MAX_REFRESH = 10 #used in SPID
OIDCFED_PROVIDER_MAX_CONSENT_TIMEFRAME = 3600 #used in CIE (seconds)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
PKG_NAME = 'spid_cie_oidc'

INSTALL_REQUIRES = [
"Django>=4.0",
"Django>=4.0,<5.0",
"cryptojwt>=1.8.2",
"pydantic>=1.8.2,<2.0",
"pytz>=2021.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.3 on 2023-12-13 14:27

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
(
"spid_cie_oidc_entity",
"0031_alter_federationentityconfiguration_entity_type",
),
]

operations = [
migrations.AlterField(
model_name="fetchedentitystatement",
name="jwt",
field=models.TextField(blank=False, null=False),
),
]
2 changes: 1 addition & 1 deletion spid_cie_oidc/entity/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class FetchedEntityStatement(TimeStampedModel):
statement = models.JSONField(
blank=False, null=False, help_text=_("Entity statement"), default=dict
)
jwt = models.CharField(max_length=2048)
jwt = models.TextField(null=False, blank=False)

class Meta:
verbose_name = "Fetched Entity Statement"
Expand Down
6 changes: 3 additions & 3 deletions spid_cie_oidc/onboarding/tests/test_01_onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def test_onboarding_registration(self, mocked):
self.assertEqual(res.status_code, 200)
jwk = serialize_rsa_key(new_rsa_key().pub_key)
self.data["public_jwks"] = json.dumps(jwk)
res = client.post(url, self.data)
# self.assertEqual(res.status_code, 302)
# res = client.get(res.url)
# res = client.post(url, self.data)
# self.assertEqual(res.status_code, 200)
# res = client.get(url)
# self.assertEqual(res.status_code, 200)
# self.assertIn(self.data["organization_name"], res.content.decode())
# self.assertIn("acquired", res.content.decode())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.3 on 2023-12-13 14:27

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
(
"spid_cie_oidc_provider",
"0007_alter_issuedtoken_options_alter_oidcsession_options",
),
]

operations = [
migrations.AlterField(
model_name="oidcsession",
name="authz_request",
field=models.JSONField(max_length=65536),
),
]
2 changes: 1 addition & 1 deletion spid_cie_oidc/provider/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OidcSession(TimeStampedModel):
help_text=_("django session key")
)
nonce = models.CharField(max_length=2048, blank=False, null=False)
authz_request = models.JSONField(max_length=2048, blank=False, null=False)
authz_request = models.JSONField(max_length=65536, blank=False, null=False)

revoked = models.BooleanField(default=False)
auth_code = models.CharField(max_length=2048, blank=False, null=False)
Expand Down
3 changes: 2 additions & 1 deletion spid_cie_oidc/provider/views/userinfo_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
create_jwe,
unpad_jwt_payload
)

from spid_cie_oidc.entity.models import (
TrustChain
)
Expand Down Expand Up @@ -102,4 +103,4 @@ def get(self, request, *args, **kwargs):
client_jwk,
cty="JWT"
)
return HttpResponse(jwe, content_type="application/jose")
return HttpResponse(jwe, content_type="application/jwt")
Loading