-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23e6798
commit 535072c
Showing
8 changed files
with
157 additions
and
1 deletion.
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
43 changes: 43 additions & 0 deletions
43
docs/source/include/pydantic/admissions_model_complex_cryptography.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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from cryptography import x509 | ||
from cryptography.x509.oid import ExtensionOID | ||
|
||
profession_info_one = x509.ProfessionInfo( | ||
naming_authority=None, | ||
profession_items=["info"], | ||
profession_oids=None, | ||
registration_number=None, | ||
add_profession_info=None, | ||
) | ||
profession_info_two = x509.ProfessionInfo( | ||
naming_authority=x509.NamingAuthority( | ||
id=x509.ObjectIdentifier("1.2.3"), | ||
url="https://sub.naming.example.com", | ||
text="naming authority for second info model", | ||
), | ||
profession_items=["info one", "info two"], | ||
profession_oids=[x509.ObjectIdentifier("1.2.4"), x509.ObjectIdentifier("1.2.5")], | ||
registration_number="abc", | ||
add_profession_info=b"\x90", | ||
) | ||
admission_one = x509.Admission( | ||
admission_authority=None, | ||
naming_authority=None, | ||
profession_infos=[profession_info_one], | ||
) | ||
admission_two = x509.Admission( | ||
admission_authority=x509.UniformResourceIdentifier("https://example.com"), | ||
naming_authority=x509.NamingAuthority( | ||
id=x509.ObjectIdentifier("1.2.3"), | ||
url="https://naming.example.com", | ||
text="some text", | ||
), | ||
profession_infos=[profession_info_one, profession_info_two], | ||
) | ||
x509.Extension( | ||
critical=False, | ||
oid=ExtensionOID.ADMISSIONS, | ||
value=x509.Admissions( | ||
authority=x509.UniformResourceIdentifier("https://example.com"), | ||
admissions=[admission_one, admission_two], | ||
), | ||
) |
41 changes: 41 additions & 0 deletions
41
docs/source/include/pydantic/admissions_model_complex_model.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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from django_ca.pydantic import ( | ||
AdmissionModel, | ||
AdmissionsModel, | ||
AdmissionsValueModel, | ||
GeneralNameModel, | ||
NamingAuthorityModel, | ||
ProfessionInfoModel, | ||
) | ||
|
||
AdmissionsModel( | ||
value=AdmissionsValueModel( | ||
authority=GeneralNameModel(type="URI", value="https://example.com"), | ||
admissions=[ | ||
AdmissionModel( | ||
profession_infos=[ProfessionInfoModel(profession_items=["info"])] | ||
), | ||
AdmissionModel( | ||
admission_authority=GeneralNameModel( | ||
type="URI", value="https://example.com" | ||
), | ||
naming_authority=NamingAuthorityModel( | ||
id="1.2.3", url="https://naming.example.com", text="some text" | ||
), | ||
profession_infos=[ | ||
ProfessionInfoModel(profession_items=["info"]), | ||
ProfessionInfoModel( | ||
naming_authority=NamingAuthorityModel( | ||
id="1.2.3", | ||
url="https://sub.naming.example.com", | ||
text="naming authority for second info model", | ||
), | ||
profession_items=["info one", "info two"], | ||
profession_oids=["1.2.4", "1.2.5"], | ||
registration_number="abc", | ||
add_profession_info="kA==", | ||
), | ||
], | ||
), | ||
], | ||
) | ||
) |
20 changes: 20 additions & 0 deletions
20
docs/source/include/pydantic/admissions_model_cryptography.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from cryptography import x509 | ||
from cryptography.x509.oid import ExtensionOID | ||
|
||
profession_info = x509.ProfessionInfo( | ||
naming_authority=None, | ||
profession_items=["info"], | ||
profession_oids=None, | ||
registration_number=None, | ||
add_profession_info=None, | ||
) | ||
admission = x509.Admission( | ||
admission_authority=None, | ||
naming_authority=None, | ||
profession_infos=[profession_info], | ||
) | ||
x509.Extension( | ||
critical=False, | ||
oid=ExtensionOID.ADMISSIONS, | ||
value=x509.Admissions(authority=None, admissions=[admission]), | ||
) |
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,17 @@ | ||
from django_ca.pydantic import ( | ||
AdmissionModel, | ||
AdmissionsModel, | ||
AdmissionsValueModel, | ||
GeneralNameModel, | ||
ProfessionInfoModel, | ||
) | ||
|
||
AdmissionsModel( | ||
value=AdmissionsValueModel( | ||
admissions=[ | ||
AdmissionModel( | ||
profession_infos=[ProfessionInfoModel(profession_items=["info"])] | ||
) | ||
], | ||
) | ||
) |
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