-
Notifications
You must be signed in to change notification settings - Fork 26
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 #3494 from open-formulieren/chore/move-certificate…
…-factory Move certificate and zgw_consumers.Service factory
- Loading branch information
Showing
44 changed files
with
177 additions
and
294 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
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
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 |
---|---|---|
@@ -1,20 +1,3 @@ | ||
from pathlib import Path | ||
|
||
from django.core.files import File | ||
|
||
from simple_certmanager.constants import CertificateTypes | ||
from simple_certmanager.models import Certificate | ||
|
||
TEST_FILES = Path(__file__).parent.resolve() / "data" | ||
|
||
|
||
def make_certificate(key_pem: Path, certificate_pem: Path, label="DigiD"): | ||
with key_pem.open("rb") as key_file, certificate_pem.open("rb") as cert_file: | ||
cert = Certificate( | ||
label=label, | ||
type=CertificateTypes.key_pair, | ||
private_key=File(key_file, key_pem.name), | ||
public_certificate=File(cert_file, certificate_pem.name), | ||
) | ||
cert.save() | ||
return cert |
26 changes: 26 additions & 0 deletions
26
src/openforms/authentication/contrib/eherkenning/tests/data/README.md
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,26 @@ | ||
# Test files for EHerkenning | ||
|
||
## Certificate and key | ||
|
||
The test.certificate and the test.key were generated using the following command: | ||
|
||
```bash | ||
openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out test.certificate -keyout test.key | ||
``` | ||
|
||
The tests making use of these certificates are: | ||
|
||
- `src/openforms/authentication/contrib/eherkenning/tests/test_migrations.py` | ||
|
||
These tests will potentially start failing once the test certificate expires. | ||
|
||
## Signicat integration tests | ||
|
||
The `our_certificate.pem` and `our_keys.pem` files are used by: | ||
|
||
- `src/openforms/authentication/contrib/eherkenning/tests/test_signicat_integration.py` | ||
|
||
These must be uploaded with Signicat for live (non-VCR) network communication. | ||
|
||
`signicat_metadata.xml` is used by | ||
`src/openforms/authentication/contrib/eherkenning/tests/test_signicat_integration.py`. |
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
17 changes: 0 additions & 17 deletions
17
src/openforms/authentication/contrib/eherkenning/tests/utils.py
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 |
---|---|---|
@@ -1,20 +1,3 @@ | ||
from pathlib import Path | ||
|
||
from django.core.files import File | ||
|
||
from simple_certmanager.constants import CertificateTypes | ||
from simple_certmanager.models import Certificate | ||
|
||
TEST_FILES = Path(__file__).parent.resolve() / "data" | ||
|
||
|
||
def make_certificate(key_pem: Path, certificate_pem: Path, label="EHerkenning"): | ||
with key_pem.open("rb") as key_file, certificate_pem.open("rb") as cert_file: | ||
cert = Certificate( | ||
label=label, | ||
type=CertificateTypes.key_pair, | ||
private_key=File(key_file, key_pem.name), | ||
public_certificate=File(cert_file, certificate_pem.name), | ||
) | ||
cert.save() | ||
return cert |
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
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
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.