agilicus 1.261.2__py3-none-any.whl → 1.261.3__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.261.2/python'
80
+ self.user_agent = 'OpenAPI-Generator/1.261.3/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.06.21\n"\
390
- "SDK Package Version: 1.261.2".\
390
+ "SDK Package Version: 1.261.3".\
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: 2024.06.21
7
- - Package version: 1.261.2
7
+ - Package version: 1.261.3
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
@@ -6020,7 +6020,7 @@ def update_resource(ctx, id, resource_member, remove_resource_member, **kwargs):
6020
6020
  @click.pass_context
6021
6021
  def reconcile_default_policy(ctx, **kwargs):
6022
6022
  result = resources.reconcile_default_policy(ctx, **kwargs)
6023
- output_entry(ctx, result)
6023
+ output_entry(ctx, result.to_dict())
6024
6024
 
6025
6025
 
6026
6026
  @cli.command(name="list-org-user-roles")
@@ -253,23 +253,36 @@ def migrate_resource(ctx, resource, dump_dir=None):
253
253
  )
254
254
 
255
255
  # ensure the resource has been reconciled
256
- reconcile_default_policy(ctx, resource.metadata.id, org_id=resource.spec.org_id)
256
+ resource = reconcile_default_policy(
257
+ ctx, resource.metadata.id, org_id=resource.spec.org_id
258
+ )
257
259
 
258
260
  token = context.get_token(ctx)
259
261
  apiclient = context.get_apiclient(ctx, token)
260
262
  templates_api = apiclient.policy_templates_api
261
263
 
264
+ def do_update(guid, obj):
265
+ return templates_api.replace_policy_template_instance(
266
+ guid, policy_template_instance=obj
267
+ )
268
+
269
+ updater = do_update
270
+ # If there are no rules, don't blow away any previously create config. This allows us
271
+ # to reapply the policy from scratch using a new config if needed, but at the same
272
+ # time, ensures we don't blow away config if we run the same migration twice (since
273
+ # the first migration will clear the rules, meaning the second will set an empty
274
+ # policy. )
275
+ if not rules:
276
+ updater = None
262
277
  resp, _ = create_or_update(
263
278
  tmpl,
264
279
  lambda obj: templates_api.create_policy_template_instance(obj),
265
- lambda guid, obj: templates_api.replace_policy_template_instance(
266
- guid, policy_template_instance=obj
267
- ),
280
+ updater,
268
281
  to_dict=False,
269
282
  )
270
283
 
271
- _clear_old_rules(apiclient, resource, dump_dir)
272
-
284
+ if rules:
285
+ _clear_old_rules(apiclient, resource, dump_dir)
273
286
  return resp
274
287
 
275
288
 
@@ -43,6 +43,7 @@ def cli_command_list_multifactor_policies(ctx, **kwargs):
43
43
  @click.option("--org-id", default=None)
44
44
  @click.option("--template-type", default=None)
45
45
  @click.option("--include-invalid", type=bool, default=None)
46
+ @click.option("--object-id", type=str, default=None)
46
47
  @click.option("--name", default=None)
47
48
  @click.pass_context
48
49
  def cli_command_list_policy_templates(ctx, **kwargs):
agilicus/resources.py CHANGED
@@ -204,8 +204,8 @@ def reconcile_default_policy(ctx, resource_id, org_id=None):
204
204
  if exc.status != 409:
205
205
  # If there was already a default, nothing for us to do
206
206
  raise
207
- return handle_api_409(exc)
208
- return resource.to_dict()
207
+ return handle_api_409(exc, klass=agilicus.Resource)
208
+ return resource
209
209
 
210
210
 
211
211
  def update_resource(
agilicus/rules/rules.py CHANGED
@@ -267,7 +267,7 @@ def replace_hostprefix_rule(
267
267
  def get_rule(ctx, rule_id, org_id, **kwargs):
268
268
  token = context.get_token(ctx)
269
269
  apiclient = context.get_apiclient(ctx, token)
270
- org_id = get_org_from_input_or_ctx(ctx, **kwargs)
270
+ org_id = get_org_from_input_or_ctx(ctx, org_id=org_id)
271
271
  return apiclient.rules_api.get_standalone_rule(rule_id=rule_id, org_id=org_id)
272
272
 
273
273
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agilicus
3
- Version: 1.261.2
3
+ Version: 1.261.3
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=xhcIheRgjfMpQ3RbekgnOp3ODUUm6deY1H
71
71
  agilicus/agilicus_api/api/users_api_mock.py,sha256=wA_xiqL3Pz3KjljKlsmf5NveLZS1FpbaKJHBp7QvarY,15411
72
72
  agilicus/agilicus_api/api/whoami_api.py,sha256=c95A5Rfll7idVIb09yTzUjqAVDpyVlRugUjprI5JBbo,7941
73
73
  agilicus/agilicus_api/api/whoami_api_mock.py,sha256=rlvZoWnMCqORMZBg7SOv6d3xp52kELdh6wXcCaIZ93w,346
74
- agilicus/agilicus_api/api_client.py,sha256=z1MwieEt3Koda-vktrLnSGZDBPHvYw335UkGGQKqBPA,38845
74
+ agilicus/agilicus_api/api_client.py,sha256=UuFjACj66J2j5gfEcvD_yt-uweu47eb5q5c_LULWWo0,38845
75
75
  agilicus/agilicus_api/apis/__init__.py,sha256=aJZD7x-umdSni6ZBr4XxzpH8pwtU9hA5LlCDxcqa1Q8,2224
76
- agilicus/agilicus_api/configuration.py,sha256=8s0RODgWPdGq7mb5oo6xjlgYElHWb5ePJ69EYOFKsgA,18447
76
+ agilicus/agilicus_api/configuration.py,sha256=5gC0MFtWiWa1YtuiBDYEClqqN3nwiCw_Me24-gaMnkM,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
@@ -2508,7 +2508,7 @@ agilicus/agilicus_api/test/test_x509_root_certificate.py,sha256=H82JE5XkABLdxrdI
2508
2508
  agilicus/agilicus_api/test/test_x509_root_certificate_spec.py,sha256=Avjjv9atO5hYlSmAJU1CzS7M0l-0bPs6q4N5iXSoMcs,2832
2509
2509
  agilicus/agilicus_api/test/test_x509_root_certificate_status.py,sha256=6Iw5aUxT4lNJnOHK0ehotwh-niT9tuSCJIjRe1DKlRg,2846
2510
2510
  agilicus/agilicus_api/test/test_xss_settings.py,sha256=Stf0gqkOTrsfpeYF22QDlz85_Nny56SSwv5dpFZoNQU,2746
2511
- agilicus/agilicus_api_README.md,sha256=XInfUyrtvSQ_gF-GDXva4K-e3mj1MiiGtPl4Z6B_6Xo,161008
2511
+ agilicus/agilicus_api_README.md,sha256=GMj5bNAEYTLwHhLRD_CB1Ea8hlEW3-wYxT9viwbiRXM,161008
2512
2512
  agilicus/aliases.ini,sha256=MxqiVo2f2xdUDVF1YDkNW36AIqN8hrYjlTVfraEUZXY,455
2513
2513
  agilicus/amq.py,sha256=yxi-YTbJPVl10s78Hlr1dmrQR63iaSIoROGVILzFPmE,1775
2514
2514
  agilicus/apps.py,sha256=uYNUNy5rCYjx90KnR_X_aESof9xzSuLYT5w8myN_VVE,52091
@@ -2558,7 +2558,7 @@ agilicus/labels/labels_main.py,sha256=ptJ34mf-iVaf8ezf3RWLcpeP2O0ntezS4tqJ0ks0el
2558
2558
  agilicus/launchers.py,sha256=r4nctnVtfP-Ho_HXEfAiMaMqJI0u7pbieHSS3Vd0QBE,11361
2559
2559
  agilicus/logs.py,sha256=tS8c_sdre1Dncrl59GVGQ0L3d2jtwlVjvIMl3SHJraY,766
2560
2560
  agilicus/lookups.py,sha256=MNmNsKpP7Fq_poLAnL9xo_iptFilKM9ziGLyIe8VKaw,669
2561
- agilicus/main.py,sha256=SvAbc6FXAKb38YdfQaBe9Az7qZnUcv_iPSdpPAqzvaU,269933
2561
+ agilicus/main.py,sha256=WhIw44SlHC-bOxAv58jAJIxTWtcjsit7_S9EvB3XmcE,269943
2562
2562
  agilicus/messages.py,sha256=Ydm-VhAsK23UnYdstv_HsOybBODfui5ubKc7F8R_dsw,5187
2563
2563
  agilicus/metrics.py,sha256=v4rwpvqDzeNG5GKNoZ7t34X5qUgly5IW2s-kXlS2vQM,2315
2564
2564
  agilicus/orgs.py,sha256=THcm1Me58PJ7Lai4LHptBitaymH0TXVXapFd7WZ3Mpg,14399
@@ -2572,8 +2572,8 @@ agilicus/output/tests/column_builder_test.py,sha256=fKP4V5sqXtmEIr-Q0gWVSFdBqCUt
2572
2572
  agilicus/pagination/pagination.py,sha256=hC7eLHxXKe4Iv7LdOZK3Dh8R_fKQIr9PPiWKJVyP4Nk,1672
2573
2573
  agilicus/patches.py,sha256=qTqLOgCAcFZPcPOkgfqMnK9bnqTXMvj_0ERsjRFcZug,1384
2574
2574
  agilicus/permissions.py,sha256=uB65yuDFICp1N10m0cdUjgizx9MQzAbLbAsBSTw1Rcc,2117
2575
- agilicus/policy/policies.py,sha256=LrteEsXjou_RyW_PcqijBhtN2jaIomXFXQIfNArUP6I,9625
2576
- agilicus/policy/policy_main.py,sha256=CSg7cFHlZo12eu9T-ugTM1U_sp7QWOXtQN14jbe7KyQ,3878
2575
+ agilicus/policy/policies.py,sha256=30lo6JwfXvxTYdBFLoQoOjFGvazx0kto5AgfVWpyP2g,10134
2576
+ agilicus/policy/policy_main.py,sha256=gbCFCDzCMa9M1tpkquY6fZWsjcdglRBRRLcaYKiAi4c,3931
2577
2577
  agilicus/policy/templates.py,sha256=EUvAhOhSjDuLAe2UKIFEzBp5pNpOT5y1r7uyV_GG6uI,5638
2578
2578
  agilicus/policy_config/policy_config.py,sha256=s1GwbBI5wuLINcViTKE8NdfcntLEegwpUEi7pqmdKkY,627
2579
2579
  agilicus/policy_config/policy_config_main.py,sha256=ReiOziCvPShjunCt3ohrEMGq0IaP0eNyIXEvEg_WD1M,788
@@ -2582,9 +2582,9 @@ agilicus/products/products.py,sha256=he27jN3MUyXBdTdV2HRyvUYb0zD3W1TGsuC7NHLKngQ
2582
2582
  agilicus/products/products_main.py,sha256=saa2-e5oeHW6D5AWPcld99KwgQ9nBY3hoW8Jz_5nfMQ,3421
2583
2583
  agilicus/regions.py,sha256=21SzUJ9_hC8DiWLSLJ-vtSb1tWLhlcPXH9JhmXD_ypU,3343
2584
2584
  agilicus/resource_helpers.py,sha256=fyfqAxjfnIth1KlHNALlLtYYXIZzlWEJmSZNLdj2JV0,380
2585
- agilicus/resources.py,sha256=U7kxKlXKYOfGakiQxCF3KSx-848HtA_gJC818SCEqgg,10440
2585
+ agilicus/resources.py,sha256=SkLkXsX3IOvuAcbQAEMPK0tV3BLfgl1MJEF2eoK498U,10455
2586
2586
  agilicus/response.py,sha256=tI2-dAJwhBuuDplSsouuMmCmKHSwR_Mx71af8tgsuYo,468
2587
- agilicus/rules/rules.py,sha256=7BQRv-S15NpiOmebHpr1l9bCJJhsO82avVwXjzVkD_w,24986
2587
+ agilicus/rules/rules.py,sha256=ixfMro-l30Pt1r_wyypWL8vhSWccdCoRv8mPJynhR2o,24991
2588
2588
  agilicus/rules/rules_main.py,sha256=kQ0g86Xjp5PXERb7AlHWZha4wZGV7pEYGWEIXggH9Kg,13639
2589
2589
  agilicus/scopes.py,sha256=OgPUksJSOSaJ3XcHPP8WJQ3e_p8B9wVmRXr-oZDfZP0,1344
2590
2590
  agilicus/service_configuration.py,sha256=WlsvTKA_bkle1PthJK0S96lpPK7GNr-BWWp8a_-MgtM,490
@@ -2599,8 +2599,8 @@ agilicus/trusted_certs/trusted_certs_main.py,sha256=6dHHWXvNIcUa_nA9ptigL4Vibe4n
2599
2599
  agilicus/users.py,sha256=JT7TIiUOtSFXPOdxmIVFm7ygZTH1FjsIkD9j-vjLuMM,38474
2600
2600
  agilicus/version.py,sha256=G9OFdL1v_4dLDfk6I6taDNypM5bbO-JHAwilsu9LYgg,23
2601
2601
  agilicus/whoami.py,sha256=kqghtWMgZOd2rhKmfguDwCTm6A3gNS8Kj-S2IBxBtl0,206
2602
- agilicus-1.261.2.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2603
- agilicus-1.261.2.dist-info/METADATA,sha256=MbjA8D7PGpkDYIwfXPqNT7xXa9iJq6pmMO4DoM9Ybw0,3822
2604
- agilicus-1.261.2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
2605
- agilicus-1.261.2.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2606
- agilicus-1.261.2.dist-info/RECORD,,
2602
+ agilicus-1.261.3.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2603
+ agilicus-1.261.3.dist-info/METADATA,sha256=icXtw9kbr9TuPogTBJvR2KoVltPPLIFM8zpWKF_Pc8w,3822
2604
+ agilicus-1.261.3.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
2605
+ agilicus-1.261.3.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2606
+ agilicus-1.261.3.dist-info/RECORD,,