-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from maykinmedia/feature/make-eidas-configurable
Make eIDAS LoA configurable
- Loading branch information
Showing
8 changed files
with
212 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Generated by Django 4.2.10 on 2024-03-08 08:45 | ||
|
||
from django.db import migrations, models | ||
|
||
import digid_eherkenning.choices | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
( | ||
"digid_eherkenning", | ||
"0007_eherkenningconfiguration_service_description_url", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveConstraint( | ||
model_name="eherkenningconfiguration", | ||
name="valid_loa", | ||
), | ||
migrations.RenameField( | ||
model_name="eherkenningconfiguration", | ||
old_name="loa", | ||
new_name="eh_loa", | ||
), | ||
migrations.AlterField( | ||
model_name="eherkenningconfiguration", | ||
name="eh_loa", | ||
field=models.CharField( | ||
choices=[ | ||
("urn:etoegang:core:assurance-class:loa1", "Non existent (1)"), | ||
("urn:etoegang:core:assurance-class:loa2", "Low (2)"), | ||
("urn:etoegang:core:assurance-class:loa2plus", "Low (2+)"), | ||
("urn:etoegang:core:assurance-class:loa3", "Substantial (3)"), | ||
("urn:etoegang:core:assurance-class:loa4", "High (4)"), | ||
], | ||
default="urn:etoegang:core:assurance-class:loa3", | ||
help_text="Level of Assurance (LoA) to use for the eHerkenning service.", | ||
max_length=100, | ||
verbose_name="eHerkenning LoA", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="eherkenningconfiguration", | ||
name="eidas_loa", | ||
field=models.CharField( | ||
choices=[ | ||
("urn:etoegang:core:assurance-class:loa1", "Non existent (1)"), | ||
("urn:etoegang:core:assurance-class:loa2", "Low (2)"), | ||
("urn:etoegang:core:assurance-class:loa2plus", "Low (2+)"), | ||
("urn:etoegang:core:assurance-class:loa3", "Substantial (3)"), | ||
("urn:etoegang:core:assurance-class:loa4", "High (4)"), | ||
], | ||
default="urn:etoegang:core:assurance-class:loa3", | ||
help_text="Level of Assurance (LoA) to use for the eIDAS service.", | ||
max_length=100, | ||
verbose_name="eIDAS LoA", | ||
), | ||
), | ||
migrations.AddConstraint( | ||
model_name="eherkenningconfiguration", | ||
constraint=models.CheckConstraint( | ||
check=models.Q( | ||
models.Q( | ||
("eh_loa__in", digid_eherkenning.choices.AssuranceLevels), | ||
("eidas_loa__in", digid_eherkenning.choices.AssuranceLevels), | ||
) | ||
), | ||
name="valid_loa", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
from pathlib import Path | ||
from typing import Optional, TypedDict, Union | ||
|
||
|
||
class ServiceConfig(TypedDict): | ||
service_uuid: str | ||
service_name: str | ||
attribute_consuming_service_index: str | ||
service_instance_uuid: str | ||
service_description: str | ||
service_description_url: str | ||
service_url: str | ||
loa: str | ||
privacy_policy_url: str | ||
herkenningsmakelaars_id: str | ||
requested_attributes: str | ||
service_restrictions_allowed: str | ||
entity_concerned_types_allowed: list[dict] | ||
language: str | ||
classifiers: Optional[list[str]] | ||
|
||
|
||
class EHerkenningConfig(TypedDict): | ||
base_url: str | ||
acs_path: str | ||
entity_id: str | ||
metadata_file: str | ||
cert_file: Path | ||
key_file: Path | ||
service_entity_id: str | ||
oin: str | ||
services: list[ServiceConfig] | ||
want_assertions_encrypted: str | ||
want_assertions_signed: str | ||
key_passphrase: str | ||
signature_algorithm: str | ||
digest_algorithm: str | ||
technical_contact_person_telephone: Optional[str] | ||
technical_contact_person_email: Optional[str] | ||
organization: str | ||
organization_name: str | ||
artifact_resolve_content_type: str | ||
|
||
|
||
class ServiceProviderSAMLConfig(TypedDict): | ||
entityId: str | ||
assertionConsumerService: dict | ||
singleLogoutService: dict | ||
attributeConsumingServices: list[dict] | ||
NameIDFormat: str | ||
x509cert: str | ||
privateKey: str | ||
privateKeyPassphrase: Optional[str] | ||
|
||
|
||
class IdentityProviderSAMLConfig(TypedDict): | ||
entityId: str | ||
singleSignOnService: dict | ||
singleLogoutService: dict | ||
x509cert: str | ||
|
||
|
||
class SecuritySAMLConfig(TypedDict): | ||
nameIdEncrypted: bool | ||
authnRequestsSigned: bool | ||
logoutRequestSigned: bool | ||
logoutResponseSigned: bool | ||
signMetadata: bool | ||
wantMessagesSigned: bool | ||
wantAssertionsSigned: bool | ||
wantAssertionsEncrypted: bool | ||
wantNameId: bool | ||
wantNameIdEncrypted: bool | ||
wantAttributeStatement: bool | ||
requestedAuthnContext: Union[bool, list[str]] | ||
requestedAuthnContextComparison: str | ||
failOnAuthnContextMismatch: bool | ||
metadataValidUntil: Optional[str] | ||
metadataCacheDuration: Optional[str] | ||
allowSingleLabelDomains: bool | ||
signatureAlgorithm: str | ||
digestAlgorithm: str | ||
allowRepeatAttributeName: bool | ||
rejectDeprecatedAlgorithm: bool | ||
disableSignatureWrappingProtection: bool | ||
|
||
|
||
class EHerkenningSAMLConfig(TypedDict): | ||
strict: bool | ||
debug: bool | ||
sp: ServiceProviderSAMLConfig | ||
idp: IdentityProviderSAMLConfig | ||
security: SecuritySAMLConfig | ||
contactPerson: dict | ||
organization: dict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.