agilicus 1.289.7__py3-none-any.whl → 1.290.0__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.
@@ -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.289.7/python'
80
+ self.user_agent = 'OpenAPI-Generator/1.290.0/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: 2025.05.07\n"\
390
- "SDK Package Version: 1.289.7".\
390
+ "SDK Package Version: 1.290.0".\
391
391
  format(env=sys.platform, pyversion=sys.version)
392
392
 
393
393
  def get_host_settings(self):
@@ -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: 2025.05.07
7
- - Package version: 1.289.7
7
+ - Package version: 1.290.0
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/rules/rules.py CHANGED
@@ -29,6 +29,7 @@ ConditionTypes = Enum(
29
29
  "mfa_rule_condition",
30
30
  "scope_condition",
31
31
  "network_protocol_condition",
32
+ "compound_rule_condition",
32
33
  ],
33
34
  )
34
35
 
@@ -928,27 +929,77 @@ def add_network_protocol_condition_rule(
928
929
  standalone_rule_policy_id=None,
929
930
  **kwargs,
930
931
  ):
931
- token = context.get_token(ctx)
932
- apiclient = context.get_apiclient(ctx, token)
933
- kwargs = strip_none(kwargs)
934
-
935
932
  cond = agilicus.NetworkProtocolCondition(
936
933
  condition_type=ConditionTypes.network_protocol_condition.name,
937
934
  protocol=protocol,
938
935
  )
939
- extended_cond = agilicus.RuleCondition(condition=cond, negated=False)
936
+ return add_rule(
937
+ ctx,
938
+ name,
939
+ cond,
940
+ actions,
941
+ purpose=purpose,
942
+ protocol=protocol,
943
+ standalone_rule_policy_id=standalone_rule_policy_id,
944
+ **kwargs,
945
+ )
946
+
947
+
948
+ def add_agilicus_default_expose_allow(
949
+ ctx,
950
+ label="agilicus-defaults-policy",
951
+ name="default_expose_network",
952
+ action="allow",
953
+ purpose=None,
954
+ **kwargs,
955
+ ):
956
+ add_network_protocol_condition_rule(
957
+ ctx,
958
+ name,
959
+ [action],
960
+ protocol="tcp",
961
+ **kwargs,
962
+ )
963
+ add_label(ctx, label=label, **kwargs)
964
+ add_rule_tree(ctx, name, children=[], rules=[name], **kwargs)
965
+ add_ruleset(ctx, name, trees=[name], labels=[label], **kwargs)
966
+
967
+
968
+ def add_rule(
969
+ ctx,
970
+ name,
971
+ condition,
972
+ actions,
973
+ purpose=None,
974
+ comments=None,
975
+ roles=None,
976
+ scope=None,
977
+ standalone_rule_policy_id=None,
978
+ **kwargs,
979
+ ):
980
+ token = context.get_token(ctx)
981
+ apiclient = context.get_apiclient(ctx, token)
982
+ kwargs = strip_none(kwargs)
983
+
984
+ extended_cond = agilicus.RuleCondition(condition=condition, negated=False)
940
985
 
941
986
  rule = agilicus.RuleConfig(
942
987
  name=name,
943
988
  extended_condition=extended_cond,
944
989
  actions=[agilicus.RuleAction(action=action) for action in actions],
945
990
  )
991
+ if roles is not None:
992
+ rule.roles = roles
993
+ if scope is not None:
994
+ rule.scope = agilicus.RuleScopeEnum(scope)
946
995
 
947
996
  org_id = get_org_from_input_or_ctx(ctx, **kwargs)
948
997
  kwargs["org_id"] = org_id
949
998
  spec = agilicus.StandaloneRuleSpec(org_id=org_id, rule=rule)
950
999
  if purpose is not None:
951
1000
  spec.purpose = purpose
1001
+ if comments:
1002
+ spec.comments = comments
952
1003
 
953
1004
  if standalone_rule_policy_id is not None:
954
1005
  spec.standalone_rule_policy_id = standalone_rule_policy_id
@@ -964,24 +1015,47 @@ def add_network_protocol_condition_rule(
964
1015
  return result
965
1016
 
966
1017
 
967
- def add_agilicus_default_expose_allow(
1018
+ def make_compound_condition(
1019
+ conditions,
1020
+ list_type="cnf",
1021
+ ):
1022
+ return agilicus.CompoundRuleCondition(
1023
+ condition_type=ConditionTypes.compound_rule_condition.name,
1024
+ condition_list=conditions,
1025
+ list_type=list_type,
1026
+ )
1027
+
1028
+
1029
+ def add_agilicus_default_database_allow(
968
1030
  ctx,
969
1031
  label="agilicus-defaults-policy",
970
- name="default_expose_network",
1032
+ name="default_database",
971
1033
  action="allow",
972
- purpose=None,
973
1034
  **kwargs,
974
1035
  ):
975
- add_network_protocol_condition_rule(
1036
+ # The database rule uses an empty cnf compound condition to match everything,
1037
+ # subject to the scope and roles
1038
+ condition = make_compound_condition([], list_type="cnf")
1039
+ add_rule(
976
1040
  ctx,
977
1041
  name,
978
- [action],
979
- protocol="tcp",
1042
+ condition=condition,
1043
+ actions=[action],
1044
+ roles=["owner"],
1045
+ scope="assigned_to_user",
980
1046
  **kwargs,
981
1047
  )
982
1048
  add_label(ctx, label=label, **kwargs)
983
1049
  add_rule_tree(ctx, name, children=[], rules=[name], **kwargs)
984
- add_ruleset(ctx, name, trees=[name], labels=[label], **kwargs)
1050
+ # The scope here ensures this entire set of rules only applies to databases
1051
+ add_ruleset(
1052
+ ctx,
1053
+ name,
1054
+ trees=[name],
1055
+ labels=[label],
1056
+ scopes=["urn:agilicus:database:*"],
1057
+ **kwargs,
1058
+ )
985
1059
 
986
1060
 
987
1061
  def add_agilicus_default_policy(
@@ -989,3 +1063,4 @@ def add_agilicus_default_policy(
989
1063
  **kwargs,
990
1064
  ):
991
1065
  add_agilicus_default_expose_allow(ctx)
1066
+ add_agilicus_default_database_allow(ctx)
@@ -388,6 +388,13 @@ def cli_command_add_agilicus_default_expose_allow(ctx, **kwargs):
388
388
  rules.add_agilicus_default_expose_allow(ctx, **kwargs)
389
389
 
390
390
 
391
+ @click.command(name="add-agilicus-default-policy")
392
+ @click.option("--org-id", default=None)
393
+ @click.pass_context
394
+ def cli_command_add_agilicus_default_policy(ctx, **kwargs):
395
+ rules.add_agilicus_default_policy(ctx, **kwargs)
396
+
397
+
391
398
  @click.command(name="add-scope-condition-rule")
392
399
  @click.option("--name", required=True)
393
400
  @click.option("--action", required=True, multiple=True, type=click.Choice(rules.ACTIONS))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agilicus
3
- Version: 1.289.7
3
+ Version: 1.290.0
4
4
  Summary: Agilicus SDK
5
5
  Home-page: https://www.agilicus.com/
6
6
  License: MIT
@@ -71,9 +71,9 @@ agilicus/agilicus_api/api/users_api.py,sha256=JzmgKStE-ZWvm4KR2Q7Vaa_UTj40LoWrnY
71
71
  agilicus/agilicus_api/api/users_api_mock.py,sha256=aMSUc12JQAo1O9rp2YnyQldANFGlfi57fMnQyCIrJuE,17209
72
72
  agilicus/agilicus_api/api/whoami_api.py,sha256=8gizWCB2aF8XWhwbR5z4DVF0QBcqyGEy0Pera9kArAo,7941
73
73
  agilicus/agilicus_api/api/whoami_api_mock.py,sha256=rlvZoWnMCqORMZBg7SOv6d3xp52kELdh6wXcCaIZ93w,346
74
- agilicus/agilicus_api/api_client.py,sha256=mrUmgkIZA9_3Bnol-hcnvIeZPOkS3a2WG3DCjS2NU0c,38845
74
+ agilicus/agilicus_api/api_client.py,sha256=qNXZWzqzS0_zzowlXKPFANfAgkQHAHVUw6gU0SY6ITQ,38845
75
75
  agilicus/agilicus_api/apis/__init__.py,sha256=aJZD7x-umdSni6ZBr4XxzpH8pwtU9hA5LlCDxcqa1Q8,2224
76
- agilicus/agilicus_api/configuration.py,sha256=N2u-BpTRcj6D1rB_HpahXBkIK31nGhgeXirhb08A1nU,18447
76
+ agilicus/agilicus_api/configuration.py,sha256=LMKuraou4lcmt_fUFYHUXkd9_G2zOFWjN1OD8x0zlpY,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
@@ -2703,7 +2703,7 @@ agilicus/agilicus_api/test/test_x509_root_certificate.py,sha256=AJLLjTwkZtUXFa1H
2703
2703
  agilicus/agilicus_api/test/test_x509_root_certificate_spec.py,sha256=qLPux35AzYJaHTQVQjMxhaP-Razu5aH4nC_fcQo7K6U,2832
2704
2704
  agilicus/agilicus_api/test/test_x509_root_certificate_status.py,sha256=zoA2F3LoHJ6mJ64_Xg_ekZwzW0fCb1-33A_5u9YVdFo,2846
2705
2705
  agilicus/agilicus_api/test/test_xss_settings.py,sha256=JRiq6WszL24ZNAAqGvT1FTV60D2rbQt_oe4F8pnue3k,2746
2706
- agilicus/agilicus_api_README.md,sha256=Nys2-cdl-DmsQe7rFSgnF81T_I-VxY4M_neaW9I6Ul8,173709
2706
+ agilicus/agilicus_api_README.md,sha256=35fMIodPAPTaU_BKEOnIZac7_obKkW-HMXQXXDXCbDA,173709
2707
2707
  agilicus/aliases.ini,sha256=MxqiVo2f2xdUDVF1YDkNW36AIqN8hrYjlTVfraEUZXY,455
2708
2708
  agilicus/amq.py,sha256=yxi-YTbJPVl10s78Hlr1dmrQR63iaSIoROGVILzFPmE,1775
2709
2709
  agilicus/apps.py,sha256=Mdc_pRXyfa-IvIFH7gNbx0Ob64gUHggZyeSyLUDpjMs,54048
@@ -2790,8 +2790,8 @@ agilicus/regions.py,sha256=P2VqBXtNQ0G2uY69niIuLcVTynugyZgox_EaNEGuGUs,13067
2790
2790
  agilicus/resource_helpers.py,sha256=rATvmW5AN6rt_BIKtJnENyU9QEwujyWaIZV2ou6PPck,1271
2791
2791
  agilicus/resources.py,sha256=PnJwLMSWVQgxSAzjreY-zcyNB2aWM7gtlqUSgrYvb3Y,10605
2792
2792
  agilicus/response.py,sha256=tI2-dAJwhBuuDplSsouuMmCmKHSwR_Mx71af8tgsuYo,468
2793
- agilicus/rules/rules.py,sha256=ALaWcePTAqFXqB9zuXapG4QV0jjZdvDX3a4hYlstL0M,29201
2794
- agilicus/rules/rules_main.py,sha256=3mawQd0C8py7r7MSjXymapskaLw-O-VG1G-Zy3U1i2I,14800
2793
+ agilicus/rules/rules.py,sha256=gpu7g308fTlE0LVuBcUXikho6TBx4-kdPUM6mPmawdY,30980
2794
+ agilicus/rules/rules_main.py,sha256=aOH4mcxb4-_azgzcz5kuOSzI-CvLhCwq1rZxDvaoHe4,15026
2795
2795
  agilicus/scopes.py,sha256=OgPUksJSOSaJ3XcHPP8WJQ3e_p8B9wVmRXr-oZDfZP0,1344
2796
2796
  agilicus/service_configuration.py,sha256=WlsvTKA_bkle1PthJK0S96lpPK7GNr-BWWp8a_-MgtM,490
2797
2797
  agilicus/service_token.py,sha256=YDVFeBe9Yv0qYvfUenwnpGHuj2x1J06YUe5A_C8L6L4,7162
@@ -2806,8 +2806,8 @@ agilicus/trusted_certs/trusted_certs_main.py,sha256=6dHHWXvNIcUa_nA9ptigL4Vibe4n
2806
2806
  agilicus/users.py,sha256=bUFtVlTjUeEoQlzsQcfS8ChN0X9mbHs8v0xbkK-cldQ,41772
2807
2807
  agilicus/version.py,sha256=G9OFdL1v_4dLDfk6I6taDNypM5bbO-JHAwilsu9LYgg,23
2808
2808
  agilicus/whoami.py,sha256=kqghtWMgZOd2rhKmfguDwCTm6A3gNS8Kj-S2IBxBtl0,206
2809
- agilicus-1.289.7.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2810
- agilicus-1.289.7.dist-info/METADATA,sha256=PoRXdzPz_f_eLV9sBK5HuzfsmClK2WKIVHUSXSPZ0Ww,3878
2811
- agilicus-1.289.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
2812
- agilicus-1.289.7.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2813
- agilicus-1.289.7.dist-info/RECORD,,
2809
+ agilicus-1.290.0.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2810
+ agilicus-1.290.0.dist-info/METADATA,sha256=Hi0x24_PpBpLZwsA35XKrPYmrt3XzXVW2GxzL6qdQQ4,3878
2811
+ agilicus-1.290.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
2812
+ agilicus-1.290.0.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2813
+ agilicus-1.290.0.dist-info/RECORD,,