agilicus 1.267.0__py3-none-any.whl → 1.267.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agilicus/agilicus_api/api_client.py +1 -1
- agilicus/agilicus_api/configuration.py +1 -1
- agilicus/agilicus_api_README.md +1 -1
- agilicus/main.py +26 -0
- agilicus/orgs.py +41 -0
- agilicus/pop_utils.py +40 -0
- agilicus/tests/test_pop_utils.py +23 -0
- {agilicus-1.267.0.dist-info → agilicus-1.267.1.dist-info}/METADATA +1 -1
- {agilicus-1.267.0.dist-info → agilicus-1.267.1.dist-info}/RECORD +12 -10
- {agilicus-1.267.0.dist-info → agilicus-1.267.1.dist-info}/LICENSE.txt +0 -0
- {agilicus-1.267.0.dist-info → agilicus-1.267.1.dist-info}/WHEEL +0 -0
- {agilicus-1.267.0.dist-info → agilicus-1.267.1.dist-info}/entry_points.txt +0 -0
@@ -77,7 +77,7 @@ class ApiClient(object):
|
|
77
77
|
self.default_headers[header_name] = header_value
|
78
78
|
self.cookie = cookie
|
79
79
|
# Set default User-Agent.
|
80
|
-
self.user_agent = 'OpenAPI-Generator/1.267.
|
80
|
+
self.user_agent = 'OpenAPI-Generator/1.267.1/python'
|
81
81
|
|
82
82
|
def __enter__(self):
|
83
83
|
return self
|
@@ -387,7 +387,7 @@ class Configuration(object):
|
|
387
387
|
"OS: {env}\n"\
|
388
388
|
"Python Version: {pyversion}\n"\
|
389
389
|
"Version of the API: 2024.09.24\n"\
|
390
|
-
"SDK Package Version: 1.267.
|
390
|
+
"SDK Package Version: 1.267.1".\
|
391
391
|
format(env=sys.platform, pyversion=sys.version)
|
392
392
|
|
393
393
|
def get_host_settings(self):
|
agilicus/agilicus_api_README.md
CHANGED
@@ -4,7 +4,7 @@ Agilicus is API-first. Modern software is controlled by other software, is open,
|
|
4
4
|
The `agilicus_api` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
5
5
|
|
6
6
|
- API version: 2024.09.24
|
7
|
-
- Package version: 1.267.
|
7
|
+
- Package version: 1.267.1
|
8
8
|
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
9
9
|
For more information, please visit [https://www.agilicus.com/api](https://www.agilicus.com/api)
|
10
10
|
|
agilicus/main.py
CHANGED
@@ -8135,6 +8135,32 @@ def update_session_challenge(ctx, token, **kwargs):
|
|
8135
8135
|
output_entry(ctx, result.to_dict())
|
8136
8136
|
|
8137
8137
|
|
8138
|
+
@cli.command(name="list-org-pops")
|
8139
|
+
@click.option("--org-id", default=None)
|
8140
|
+
@click.pass_context
|
8141
|
+
def list_org_pops(ctx, **kwargs):
|
8142
|
+
result = orgs.list_org_pops(ctx, **kwargs)
|
8143
|
+
output_entry(ctx, result)
|
8144
|
+
|
8145
|
+
|
8146
|
+
@cli.command(name="add-org-pop")
|
8147
|
+
@click.argument("pop")
|
8148
|
+
@click.option("--org-id", default=None)
|
8149
|
+
@click.pass_context
|
8150
|
+
def add_org_pop(ctx, **kwargs):
|
8151
|
+
result = orgs.add_org_pop(ctx, **kwargs)
|
8152
|
+
output_entry(ctx, result)
|
8153
|
+
|
8154
|
+
|
8155
|
+
@cli.command(name="remove-org-pop")
|
8156
|
+
@click.argument("pop")
|
8157
|
+
@click.option("--org-id", default=None)
|
8158
|
+
@click.pass_context
|
8159
|
+
def remove_org_pop(ctx, **kwargs):
|
8160
|
+
result = orgs.remove_org_pop(ctx, **kwargs)
|
8161
|
+
output_entry(ctx, result)
|
8162
|
+
|
8163
|
+
|
8138
8164
|
def switch_org(org):
|
8139
8165
|
ctx = click.get_current_context()
|
8140
8166
|
ctx.obj["ORG_ID"] = org.get("id")
|
agilicus/orgs.py
CHANGED
@@ -21,6 +21,7 @@ from .output.table import (
|
|
21
21
|
)
|
22
22
|
from . import get_many_entries
|
23
23
|
from .input_helpers import strip_none
|
24
|
+
from . import pop_utils
|
24
25
|
|
25
26
|
|
26
27
|
def get_org_by_dictionary(ctx, org_id):
|
@@ -533,3 +534,43 @@ def format_reconcile_org_policy_results(ctx, results):
|
|
533
534
|
column("failure"),
|
534
535
|
]
|
535
536
|
return format_table(ctx, results.modified, columns)
|
537
|
+
|
538
|
+
|
539
|
+
POP_TAGS_FEATURE_NAME = "pop_tags"
|
540
|
+
|
541
|
+
|
542
|
+
def list_org_pops(ctx, **kwargs):
|
543
|
+
org_id = get_org_from_input_or_ctx(ctx, **kwargs)
|
544
|
+
org = get_raw(ctx, org_id)
|
545
|
+
features = org.feature_flags or []
|
546
|
+
feature_obj = find_feature(features, POP_TAGS_FEATURE_NAME)
|
547
|
+
|
548
|
+
if not feature_obj:
|
549
|
+
feature_obj = FeatureFlag(feature=POP_TAGS_FEATURE_NAME, enabled=False)
|
550
|
+
return pop_utils.make_feature_pop_result(feature_obj)
|
551
|
+
|
552
|
+
|
553
|
+
def _update_pop_setting(ctx, pop, setting_updater: callable, **kwargs):
|
554
|
+
apiclient = context.get_apiclient(ctx)
|
555
|
+
org_id = get_org_from_input_or_ctx(ctx, **kwargs)
|
556
|
+
org = get_raw(ctx, org_id)
|
557
|
+
features = org.feature_flags or []
|
558
|
+
feature_obj = find_feature(features, POP_TAGS_FEATURE_NAME)
|
559
|
+
|
560
|
+
if not feature_obj:
|
561
|
+
feature_obj = FeatureFlag(feature=POP_TAGS_FEATURE_NAME, enabled=False)
|
562
|
+
features.append(feature_obj)
|
563
|
+
|
564
|
+
feature_obj.setting = setting_updater(feature_obj.setting, pop)
|
565
|
+
feature_obj.enabled = True
|
566
|
+
org.feature_flags = features
|
567
|
+
apiclient.org_api.replace_org(org_id=org.id, organisation=org)
|
568
|
+
return pop_utils.make_feature_pop_result(feature_obj)
|
569
|
+
|
570
|
+
|
571
|
+
def add_org_pop(ctx, pop, **kwargs):
|
572
|
+
return _update_pop_setting(ctx, pop, pop_utils.add_pop_to_str, **kwargs)
|
573
|
+
|
574
|
+
|
575
|
+
def remove_org_pop(ctx, pop, **kwargs):
|
576
|
+
return _update_pop_setting(ctx, pop, pop_utils.remove_pop_from_str, **kwargs)
|
agilicus/pop_utils.py
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
from agilicus.agilicus_api import FeatureFlag
|
2
|
+
|
3
|
+
|
4
|
+
def _make_set(pop_str: str) -> set:
|
5
|
+
if pop_str is None:
|
6
|
+
pop_str = ""
|
7
|
+
return set(sorted([pop.strip() for pop in pop_str.split(",") if pop]))
|
8
|
+
|
9
|
+
|
10
|
+
def _make_str(pop_set: set) -> str:
|
11
|
+
return ",".join(sorted(list(pop_set)))
|
12
|
+
|
13
|
+
|
14
|
+
def add_pop_to_str(pop_str: str, pop: str) -> str:
|
15
|
+
if pop_str is None:
|
16
|
+
pop_str = ""
|
17
|
+
if not pop:
|
18
|
+
return pop_str
|
19
|
+
pop_set = _make_set(pop_str)
|
20
|
+
pop_set.add(pop)
|
21
|
+
return _make_str(pop_set)
|
22
|
+
|
23
|
+
|
24
|
+
def remove_pop_from_str(pop_str: str, pop: str) -> str:
|
25
|
+
if pop_str is None:
|
26
|
+
pop_str = ""
|
27
|
+
pop_set = set([pop.strip() for pop in pop_str.split(",")])
|
28
|
+
if pop in pop_set:
|
29
|
+
pop_set.remove(pop)
|
30
|
+
return _make_str(pop_set)
|
31
|
+
|
32
|
+
|
33
|
+
def make_feature_pop_result(feature_obj: FeatureFlag) -> dict:
|
34
|
+
result = {}
|
35
|
+
result["enabled"] = False
|
36
|
+
result["pops"] = []
|
37
|
+
if feature_obj:
|
38
|
+
result["enabled"] = feature_obj.enabled
|
39
|
+
result["pops"] = list(_make_set(feature_obj.setting))
|
40
|
+
return result
|
@@ -0,0 +1,23 @@
|
|
1
|
+
from .. import pop_utils
|
2
|
+
|
3
|
+
|
4
|
+
def test_pop_utils_remove():
|
5
|
+
assert pop_utils.remove_pop_from_str(None, "") == ""
|
6
|
+
assert pop_utils.remove_pop_from_str("", "") == ""
|
7
|
+
assert pop_utils.remove_pop_from_str(" ", "") == ""
|
8
|
+
assert pop_utils.remove_pop_from_str("foobar", "") == "foobar"
|
9
|
+
assert pop_utils.remove_pop_from_str("foobar", "foobar") == ""
|
10
|
+
assert pop_utils.remove_pop_from_str("foobar,1,3", "foobar") == "1,3"
|
11
|
+
assert pop_utils.remove_pop_from_str("foobar,1,3", "foobar") == "1,3"
|
12
|
+
assert pop_utils.remove_pop_from_str("foobar,1,3", "3") == "1,foobar"
|
13
|
+
assert pop_utils.remove_pop_from_str("3,2,1", "") == "1,2,3"
|
14
|
+
assert pop_utils.remove_pop_from_str("3,2,1", "3") == "1,2"
|
15
|
+
|
16
|
+
|
17
|
+
def test_pop_utils_add():
|
18
|
+
assert pop_utils.add_pop_to_str(None, "") == ""
|
19
|
+
assert pop_utils.add_pop_to_str("", "") == ""
|
20
|
+
assert pop_utils.add_pop_to_str("1,2,3", "") == "1,2,3"
|
21
|
+
assert pop_utils.add_pop_to_str("1,2,3", "") == "1,2,3"
|
22
|
+
assert pop_utils.add_pop_to_str("1,3", "2") == "1,2,3"
|
23
|
+
assert pop_utils.add_pop_to_str("4,3,2,1", "2") == "1,2,3,4"
|
@@ -71,9 +71,9 @@ agilicus/agilicus_api/api/users_api.py,sha256=sRY1Ge_aUimbaPHoulwCVT8pSB_hpjYAdw
|
|
71
71
|
agilicus/agilicus_api/api/users_api_mock.py,sha256=wA_xiqL3Pz3KjljKlsmf5NveLZS1FpbaKJHBp7QvarY,15411
|
72
72
|
agilicus/agilicus_api/api/whoami_api.py,sha256=EuL_UM7R5vey36rjwOPsF8TqNyJKyIH5RN6k05E0jAQ,7941
|
73
73
|
agilicus/agilicus_api/api/whoami_api_mock.py,sha256=rlvZoWnMCqORMZBg7SOv6d3xp52kELdh6wXcCaIZ93w,346
|
74
|
-
agilicus/agilicus_api/api_client.py,sha256=
|
74
|
+
agilicus/agilicus_api/api_client.py,sha256=EaB1E3_AiTtNoe-vJtvU3RSeJXH1-X6K_F3vYUeQsgk,38845
|
75
75
|
agilicus/agilicus_api/apis/__init__.py,sha256=aJZD7x-umdSni6ZBr4XxzpH8pwtU9hA5LlCDxcqa1Q8,2224
|
76
|
-
agilicus/agilicus_api/configuration.py,sha256=
|
76
|
+
agilicus/agilicus_api/configuration.py,sha256=Gf10nZH5lwrsAUHZqBmFMmcSh6p6i_hPDwMOEoUP0DM,18447
|
77
77
|
agilicus/agilicus_api/docs/APIKey.md,sha256=4cKuz4_l9HcEDnUrLwYbEnn9C2WoDayrjfrY1Ixgaf4,1747
|
78
78
|
agilicus/agilicus_api/docs/APIKeyIntrospect.md,sha256=nJ-zkuFm3JMbWFDYYN_vYyQk1snGBtBvIxtCQxamhAU,1019
|
79
79
|
agilicus/agilicus_api/docs/APIKeyIntrospectAuthorizationInfo.md,sha256=7RApOOLjvWQs5sw2jb25g7i3Kta1BiEY-s8VRXfppH8,725
|
@@ -2529,7 +2529,7 @@ agilicus/agilicus_api/test/test_x509_root_certificate.py,sha256=KigehF3015P8wuGb
|
|
2529
2529
|
agilicus/agilicus_api/test/test_x509_root_certificate_spec.py,sha256=MwqrYGLWl-hTmuLtE-GZ2_LvFtoHP3Jf0Y2n8O3Q-J8,2832
|
2530
2530
|
agilicus/agilicus_api/test/test_x509_root_certificate_status.py,sha256=93ATew310qaTCB9f6FjFlW3tvjaH2hi98KypBYC5gP4,2846
|
2531
2531
|
agilicus/agilicus_api/test/test_xss_settings.py,sha256=F0VcWfvT8hXcMEWowolRCxnd7Q87mHvXOc-GeS-GpWk,2746
|
2532
|
-
agilicus/agilicus_api_README.md,sha256=
|
2532
|
+
agilicus/agilicus_api_README.md,sha256=HxUdX-op94CYuMRO_xLWxB7Q4iuhn11jQSQ0bU-fN4I,162124
|
2533
2533
|
agilicus/aliases.ini,sha256=MxqiVo2f2xdUDVF1YDkNW36AIqN8hrYjlTVfraEUZXY,455
|
2534
2534
|
agilicus/amq.py,sha256=yxi-YTbJPVl10s78Hlr1dmrQR63iaSIoROGVILzFPmE,1775
|
2535
2535
|
agilicus/apps.py,sha256=ZRPqOq9ecFTqaBce5JQW7e1zekoJbhgYKDDsxyWo5BA,53212
|
@@ -2579,10 +2579,10 @@ agilicus/labels/labels_main.py,sha256=ptJ34mf-iVaf8ezf3RWLcpeP2O0ntezS4tqJ0ks0el
|
|
2579
2579
|
agilicus/launchers.py,sha256=r4nctnVtfP-Ho_HXEfAiMaMqJI0u7pbieHSS3Vd0QBE,11361
|
2580
2580
|
agilicus/logs.py,sha256=tS8c_sdre1Dncrl59GVGQ0L3d2jtwlVjvIMl3SHJraY,766
|
2581
2581
|
agilicus/lookups.py,sha256=MNmNsKpP7Fq_poLAnL9xo_iptFilKM9ziGLyIe8VKaw,669
|
2582
|
-
agilicus/main.py,sha256=
|
2582
|
+
agilicus/main.py,sha256=PV6rx_V9TP7I_kKd-31AKahShbOF7vPfwODDWKbN-FM,272198
|
2583
2583
|
agilicus/messages.py,sha256=Ydm-VhAsK23UnYdstv_HsOybBODfui5ubKc7F8R_dsw,5187
|
2584
2584
|
agilicus/metrics.py,sha256=v4rwpvqDzeNG5GKNoZ7t34X5qUgly5IW2s-kXlS2vQM,2315
|
2585
|
-
agilicus/orgs.py,sha256=
|
2585
|
+
agilicus/orgs.py,sha256=S9v1Hnv_qGcJ90uNC3V692srcXTPv6GIHiTF_z5YC90,15902
|
2586
2586
|
agilicus/output/__init__.py,sha256=UKZbHS4t15vazJuN46FN-3HHqkxMXU0p3df2VcsSLcY,110
|
2587
2587
|
agilicus/output/column_builder.py,sha256=TWo4t8ygaTUv7qjD_moDroD1bKzzyTIao0FmLy5gs4o,4284
|
2588
2588
|
agilicus/output/console.py,sha256=xBURxlA7H1kmQ7zIKuifs_aQJq1cvmCJ5CtQVSo3_Ns,400
|
@@ -2598,6 +2598,7 @@ agilicus/policy/policy_main.py,sha256=W91CxqQP1ye9UjsiMqgZNeULMvrzMB5TiPJZW3hogP
|
|
2598
2598
|
agilicus/policy/templates.py,sha256=EUvAhOhSjDuLAe2UKIFEzBp5pNpOT5y1r7uyV_GG6uI,5638
|
2599
2599
|
agilicus/policy_config/policy_config.py,sha256=E7ApGqVKwzzf9n2dEz8LdedWhNVJvDmupCmgz66FX88,919
|
2600
2600
|
agilicus/policy_config/policy_config_main.py,sha256=wABOGTFOLyDwZhZpNqo29zjI96FIirOQBLYQc7qowsE,1283
|
2601
|
+
agilicus/pop_utils.py,sha256=e_vsdb2eZWvCyZHd6sJNYsyXgntNSJFc78c-wGoWeGE,1036
|
2601
2602
|
agilicus/products/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2602
2603
|
agilicus/products/products.py,sha256=he27jN3MUyXBdTdV2HRyvUYb0zD3W1TGsuC7NHLKngQ,5365
|
2603
2604
|
agilicus/products/products_main.py,sha256=saa2-e5oeHW6D5AWPcld99KwgQ9nBY3hoW8Jz_5nfMQ,3421
|
@@ -2613,6 +2614,7 @@ agilicus/service_token.py,sha256=YDVFeBe9Yv0qYvfUenwnpGHuj2x1J06YUe5A_C8L6L4,716
|
|
2613
2614
|
agilicus/ssh.py,sha256=mVqMlDM2zAcUphehyz9djXjrRPSIxR1qJr2Ehvl3Rvw,2925
|
2614
2615
|
agilicus/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2615
2616
|
agilicus/tests/keyring_test.py,sha256=Uwp2VS2_NffYBgHAS9bXuXnIxRoK0_VOWaaYCZKv0lg,1452
|
2617
|
+
agilicus/tests/test_pop_utils.py,sha256=gdSMOmE0pNSDA0UgUWdbLKpFzUGwfBwkFSrk1p1JdSo,1083
|
2616
2618
|
agilicus/tokens.py,sha256=mwQyxWjynR3SelPJH6ZwMbqdZy7ZiqA4xVD_crlYt_E,18592
|
2617
2619
|
agilicus/transfers.py,sha256=PYr_fW7dyXNUXzi5Wp5mUjZOvU7MbRzoN-D8Omo-YSQ,1523
|
2618
2620
|
agilicus/trusted_certs/trusted_certs.py,sha256=HCAvYxOA3ooaee2_KbYJd6Yt_dxDEn8hjhy1upVJUYE,7951
|
@@ -2620,8 +2622,8 @@ agilicus/trusted_certs/trusted_certs_main.py,sha256=6dHHWXvNIcUa_nA9ptigL4Vibe4n
|
|
2620
2622
|
agilicus/users.py,sha256=JT7TIiUOtSFXPOdxmIVFm7ygZTH1FjsIkD9j-vjLuMM,38474
|
2621
2623
|
agilicus/version.py,sha256=G9OFdL1v_4dLDfk6I6taDNypM5bbO-JHAwilsu9LYgg,23
|
2622
2624
|
agilicus/whoami.py,sha256=kqghtWMgZOd2rhKmfguDwCTm6A3gNS8Kj-S2IBxBtl0,206
|
2623
|
-
agilicus-1.267.
|
2624
|
-
agilicus-1.267.
|
2625
|
-
agilicus-1.267.
|
2626
|
-
agilicus-1.267.
|
2627
|
-
agilicus-1.267.
|
2625
|
+
agilicus-1.267.1.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
|
2626
|
+
agilicus-1.267.1.dist-info/METADATA,sha256=RWxeus02D0qPNLYlA5hh_T27yHke8h0drQBdDn23ZLE,3873
|
2627
|
+
agilicus-1.267.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
2628
|
+
agilicus-1.267.1.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
|
2629
|
+
agilicus-1.267.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|