Skip to content

Commit

Permalink
move OF-specific code back into OF
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Jun 12, 2024
1 parent e509a1f commit eafb265
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import warnings
from collections.abc import Collection

from django.conf import settings
from django.utils.functional import classproperty
Expand All @@ -10,6 +11,7 @@
EHerkenningBewindvoeringConfig,
EHerkenningConfig,
)
from mozilla_django_oidc_db.typing import ClaimPath


def get_callback_view(self):
Expand Down Expand Up @@ -55,6 +57,18 @@ def oidc_authentication_callback_url(cls) -> str: # type: ignore
return "digid_machtigen_oidc:callback"
return "oidc_authentication_callback"

@property
def mandate_claims(self) -> dict[str, ClaimPath]:
return {
"representee": self.representee_bsn_claim,
"authorizee": self.authorizee_bsn_claim,
"service_id": self.mandate_service_id_claim,
}

@property
def oidcdb_sensitive_claims(self) -> Collection[ClaimPath]:
return list(self.mandate_claims.values())


class OFEHerkenningConfig(EHerkenningConfig):
class Meta:
Expand Down Expand Up @@ -92,3 +106,19 @@ def oidc_authentication_callback_url(cls) -> str: # type: ignore
)
return "eherkenning_bewindvoering_oidc:callback"
return "oidc_authentication_callback"

@property
def mandate_claims(self) -> dict[str, ClaimPath]:
return {
"representee": self.representee_claim,
# "authorizee_legal_subject_type": self.identifier_type_claim,
"authorizee_legal_subject": self.legal_subject_claim,
"authorizee_acting_subject": self.acting_subject_claim,
# "authorizee_branch_number": self.branch_number_claim,
# "service_id": self.mandate_service_id_claim,
# "service_uuid": self.mandate_service_uuid_claim,
}

@property
def oidcdb_sensitive_claims(self) -> Collection[ClaimPath]:
return list(self.mandate_claims.values())

0 comments on commit eafb265

Please sign in to comment.