-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jans-cedaling-issue-10013
- Loading branch information
Showing
6 changed files
with
110 additions
and
22 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 |
---|---|---|
|
@@ -6,15 +6,16 @@ We appreciate your efforts to responsibly disclose your findings, and will make | |
|
||
## Supported versions | ||
|
||
Security updates will typically only be applied to the latest release (at least until **Janssen** reaches first stable major version). | ||
Security updates will typically only be applied to the latest release. | ||
|
||
| Version | Supported | | ||
| -------- | ------------------ | | ||
| >=0.1 | :white_check_mark: | | ||
| Version | Supported | | ||
|---------|--------------------| | ||
| <1.0.0 | :x: | | ||
| >=1.0.0 | :white_check_mark: | | ||
|
||
## Reporting a vulnerability | ||
|
||
To report a security issue, send an email to [[email protected]](mailto:[email protected]?subject=SECURITY) | ||
To report a security issue email [[email protected]](mailto:[email protected]?subject=SECURITY) | ||
|
||
The **Janssen** team will send a response indicating the next steps in handling your report. | ||
After the initial reply to your report, the team will keep you informed of the progress towards a fix and full announcement, | ||
|
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 |
---|---|---|
|
@@ -159,3 +159,51 @@ def test_random_optional_scopes(value): | |
|
||
with pytest.raises(ValidationError): | ||
ConfigmapSchema().validate_optional_scopes(value) | ||
|
||
|
||
def test_load_schema_key(tmpdir): | ||
from jans.pycloudlib.schema import load_schema_key | ||
|
||
src = tmpdir.join("configuration.key") | ||
src.write("abcd") | ||
assert load_schema_key(str(src)) == "abcd" | ||
|
||
|
||
def test_maybe_encrypted_schema_file_missing(): | ||
from jans.pycloudlib.schema import maybe_encrypted_schema | ||
|
||
_, err, _ = maybe_encrypted_schema("/path/to/schema/file", "/path/to/schema/key") | ||
assert "error" in err | ||
|
||
|
||
def test_maybe_encrypted_schema(tmpdir): | ||
from jans.pycloudlib.schema import maybe_encrypted_schema | ||
|
||
src = tmpdir.join("configuration.json") | ||
src.write("zLBGM41dAfA2JuIkVHRKa+/WwVo/8oQAdD0LUT3jGfhqp/euYdDhf+kTiKwfb1Sv28zYL12JlO+3oSl6ZlhiTw==") | ||
|
||
src_key = tmpdir.join("configuration.key") | ||
src_key.write("6Jsv61H7fbkeIkRvUpnZ98fu") | ||
|
||
out, _, _ = maybe_encrypted_schema(str(src), str(src_key)) | ||
assert out == {"_configmap": {"hostname": "example.com"}} | ||
|
||
|
||
def test_schema_exclude_configmap(tmpdir): | ||
from jans.pycloudlib.schema import load_schema_from_file | ||
|
||
src = tmpdir.join("configuration.json") | ||
src.write('{"_configmap": {}, "_secret": {"admin_password": "Test1234#"}}') | ||
|
||
out, _, code = load_schema_from_file(str(src), exclude_configmap=True) | ||
assert "_configmap" not in out and code == 0 | ||
|
||
|
||
def test_schema_exclude_secret(tmpdir): | ||
from jans.pycloudlib.schema import load_schema_from_file | ||
|
||
src = tmpdir.join("configuration.json") | ||
src.write('{"_configmap": {"city": "Austin", "country_code": "US", "admin_email": "[email protected]", "hostname": "example.com", "orgName": "Example Inc.", "state": "TX"}, "_secret": {}}') | ||
|
||
out, _, code = load_schema_from_file(str(src), exclude_secret=True) | ||
assert "_secret" not in out and code == 0 |