Skip to content

Commit

Permalink
Merge pull request #227 from italia/dev
Browse files Browse the repository at this point in the history
chore: [RP] removed unused fileds in Authz
  • Loading branch information
peppelinux authored Apr 10, 2022
2 parents 680ab9a + 221a9ea commit 12d91e0
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
trust-anchor.org:
image: spid-cie-oidc-django:v0.6.6
image: spid-cie-oidc-django:latest
build:
context: .
dockerfile: ./Dockerfile
Expand All @@ -19,7 +19,7 @@ services:
python3 manage.py runserver 0.0.0.0:8000"
cie-provider.org:
image: spid-cie-oidc-django:v0.6.6
image: spid-cie-oidc-django:latest
build:
context: .
dockerfile: ./Dockerfile
Expand All @@ -40,7 +40,7 @@ services:
python3 manage.py runserver 0.0.0.0:8002"
relying-party.org:
image: spid-cie-oidc-django:v0.6.6
image: spid-cie-oidc-django:latest
build:
context: .
dockerfile: ./Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion spid_cie_oidc/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.6"
__version__ = "0.6.7"
3 changes: 2 additions & 1 deletion spid_cie_oidc/authority/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def fetch(request):
return JsonResponse(conf.entity_configuration_as_dict, safe=False)
else:
return HttpResponse(
conf.entity_configuration_as_jws, content_type="application/entity-statement+jwt"
conf.entity_configuration_as_jws,
content_type="application/entity-statement+jwt"
)

sub = FederationDescendant.objects.filter(
Expand Down
1 change: 0 additions & 1 deletion spid_cie_oidc/relying_party/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class OidcAuthenticationAdmin(admin.ModelAdmin):
list_filter = ("created", "endpoint")
inlines = (OidcAuthenticationTokenInline,)
readonly_fields = (
"provider",
"client_id",
"state",
"endpoint",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.0.3 on 2022-04-10 19:36

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('spid_cie_oidc_relying_party', '0007_alter_oidcauthentication_provider_jwks'),
]

operations = [
migrations.RemoveField(
model_name='oidcauthentication',
name='provider',
),
migrations.RemoveField(
model_name='oidcauthentication',
name='provider_jwks',
),
]
2 changes: 0 additions & 2 deletions spid_cie_oidc/relying_party/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ class OidcAuthentication(models.Model):
data = models.TextField(blank=True, null=True)
successful = models.BooleanField(default=False)

provider = models.CharField(max_length=255, blank=True, null=True)
provider_id = models.CharField(max_length=255, blank=True, null=True)
provider_jwks = models.JSONField(blank=True, null=True, default=dict)
provider_configuration = models.JSONField(
blank=True, null=True, default=dict
)
Expand Down
1 change: 0 additions & 1 deletion spid_cie_oidc/relying_party/tests/test_04_rp_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def setUp(self):
self.rp_config = deepcopy(rp_conf)
authz_entry = dict(
client_id=self.rp_config["metadata"]["openid_relying_party"]["client_id"],
provider=op_conf["sub"],
provider_id=op_conf["sub"],
data=json.dumps(data),
state=STATE,
Expand Down
2 changes: 0 additions & 2 deletions spid_cie_oidc/relying_party/views/rp_begin.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,8 @@ def get(self, request, *args, **kwargs):
state=authz_data["state"],
endpoint=authz_endpoint,
# TODO: better have here an organization name
provider=tc.sub,
provider_id=tc.sub,
data=json.dumps(authz_data),
provider_jwks=json.dumps(jwks_dict),
provider_configuration=provider_metadata,
)

Expand Down
1 change: 1 addition & 0 deletions spid_cie_oidc/relying_party/views/rp_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def get(self, request, *args, **kwargs):
"error_description": _("Relay party not found"),
}
return render(request, self.error_template, context, status=400)

authz_data = json.loads(authz.data)
token_response = self.access_token_request(
redirect_uri=authz_data["redirect_uri"],
Expand Down

0 comments on commit 12d91e0

Please sign in to comment.