agilicus 1.251.4__py3-none-any.whl → 1.252.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.251.4/python'
80
+ self.user_agent = 'OpenAPI-Generator/1.252.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: 2024.04.11\n"\
390
- "SDK Package Version: 1.251.4".\
390
+ "SDK Package Version: 1.252.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: 2024.04.11
7
- - Package version: 1.251.4
7
+ - Package version: 1.252.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
 
@@ -11,6 +11,7 @@ from agilicus import (
11
11
  PolicyTemplateInstance,
12
12
  PolicyTemplateInstanceSpec,
13
13
  MFAPolicyTemplate,
14
+ SourceInfoPolicyTemplate,
14
15
  )
15
16
 
16
17
  from ..output.table import (
@@ -132,3 +133,54 @@ def format_policy_templates(ctx, templates):
132
133
  ]
133
134
 
134
135
  return format_table(ctx, templates, columns)
136
+
137
+
138
+ def set_source_info_policy(
139
+ ctx,
140
+ name,
141
+ action,
142
+ source_subnet,
143
+ iso_country_code,
144
+ invert,
145
+ log_message=None,
146
+ label=None,
147
+ description=None,
148
+ **kwargs,
149
+ ):
150
+ org_id = get_org_from_input_or_ctx(ctx, **kwargs)
151
+
152
+ token = context.get_token(ctx)
153
+ apiclient = context.get_apiclient(ctx, token)
154
+
155
+ tmpl = SourceInfoPolicyTemplate(
156
+ action=action,
157
+ source_subnets=list(source_subnet or []),
158
+ iso_country_codes=list(iso_country_code or []),
159
+ invert=invert,
160
+ labels=[LabelName(la) for la in (label or [])],
161
+ template_type="source_info",
162
+ )
163
+
164
+ if log_message:
165
+ tmpl.log_message = log_message
166
+
167
+ spec = PolicyTemplateInstanceSpec(
168
+ org_id=org_id,
169
+ name=name,
170
+ template=tmpl,
171
+ )
172
+
173
+ if description is not None:
174
+ spec.description = description
175
+
176
+ tmpl = PolicyTemplateInstance(spec=spec)
177
+ templates_api = apiclient.policy_templates_api
178
+ resp, _ = create_or_update(
179
+ tmpl,
180
+ lambda obj: templates_api.create_policy_template_instance(obj),
181
+ lambda guid, obj: templates_api.replace_policy_template_instance(
182
+ guid, policy_template_instance=obj
183
+ ),
184
+ to_dict=False,
185
+ )
186
+ return resp
@@ -15,6 +15,21 @@ def cli_command_set_multifactor_policy(ctx, **kwargs):
15
15
  output_entry(ctx, policies.set_multifactor_policy(ctx, **kwargs).to_dict())
16
16
 
17
17
 
18
+ @click.command(name="set-source-info-policy")
19
+ @click.option("--name", required=True)
20
+ @click.option("--action", type=click.Choice(["allow", "deny"]), required=True)
21
+ @click.option("--label", multiple=True, type=str)
22
+ @click.option("--description", default=None)
23
+ @click.option("--org-id", default=None)
24
+ @click.option("--source-subnet", multiple=True, type=str)
25
+ @click.option("--iso-country-code", multiple=True, type=str)
26
+ @click.option("--log-message", default=None)
27
+ @click.option("--invert", type=bool, default=False)
28
+ @click.pass_context
29
+ def cli_command_set_source_info_policy(ctx, **kwargs):
30
+ output_entry(ctx, policies.set_source_info_policy(ctx, **kwargs).to_dict())
31
+
32
+
18
33
  @click.command(name="list-multifactor-policies")
19
34
  @click.option("--org-id", default=None)
20
35
  @click.pass_context
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agilicus
3
- Version: 1.251.4
3
+ Version: 1.252.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=UVNZwoYz6f400eh-3ePelA0ppFpflrzTxz
71
71
  agilicus/agilicus_api/api/users_api_mock.py,sha256=wA_xiqL3Pz3KjljKlsmf5NveLZS1FpbaKJHBp7QvarY,15411
72
72
  agilicus/agilicus_api/api/whoami_api.py,sha256=8CgAP5sfBwXuyfcyJRx7_0k7maRvzmos7hqqVWnhLio,7941
73
73
  agilicus/agilicus_api/api/whoami_api_mock.py,sha256=rlvZoWnMCqORMZBg7SOv6d3xp52kELdh6wXcCaIZ93w,346
74
- agilicus/agilicus_api/api_client.py,sha256=WHGVlVPU5h2Z7H3VIP9E1-PRbcOeVWGqcrgJbrDAmNQ,38845
74
+ agilicus/agilicus_api/api_client.py,sha256=OJILWtmUbO3AQ_SHrlb2duJeKz5CHRvmcy9fQ2bSm9Y,38845
75
75
  agilicus/agilicus_api/apis/__init__.py,sha256=aJZD7x-umdSni6ZBr4XxzpH8pwtU9hA5LlCDxcqa1Q8,2224
76
- agilicus/agilicus_api/configuration.py,sha256=zqtUfDap0pj3Nn8V_QBhxK25G9O_nprzqQXQ7KwsS6A,18447
76
+ agilicus/agilicus_api/configuration.py,sha256=FX6aCmPbAD_fgcgCKk3cLzZt2ldQrmkvLrHO_Q8z5is,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
@@ -2457,7 +2457,7 @@ agilicus/agilicus_api/test/test_x509_root_certificate.py,sha256=0hnwn-PQn0mBdoeS
2457
2457
  agilicus/agilicus_api/test/test_x509_root_certificate_spec.py,sha256=45tuo6GHC_4V88Zle_dFQ-0bYas412T-JRSjuBqX8Yk,2832
2458
2458
  agilicus/agilicus_api/test/test_x509_root_certificate_status.py,sha256=yY7C4F-oLokoBltUxNSUaNin3Ajjj-IexZfZtqFEmjo,2846
2459
2459
  agilicus/agilicus_api/test/test_xss_settings.py,sha256=YbRSwHp5Gbl1XK-UPKWNsbJ-bqQsFLWMWhFqrm0Ggl4,2746
2460
- agilicus/agilicus_api_README.md,sha256=TEVlJxq4uqu3MXI0gr3tbCg71ec6Krc6YAdOMqxUYtE,158240
2460
+ agilicus/agilicus_api_README.md,sha256=w5a-fG8NYUrzNlVSJTwk8YwibwgOe5MWLhDoksv3dCo,158240
2461
2461
  agilicus/aliases.ini,sha256=MxqiVo2f2xdUDVF1YDkNW36AIqN8hrYjlTVfraEUZXY,455
2462
2462
  agilicus/amq.py,sha256=yxi-YTbJPVl10s78Hlr1dmrQR63iaSIoROGVILzFPmE,1775
2463
2463
  agilicus/apps.py,sha256=8k_tGraPUVKJURksZwKR8eNGW-4CSPv54FYcApQ3Ly8,50857
@@ -2520,8 +2520,8 @@ agilicus/output/tests/column_builder_test.py,sha256=fKP4V5sqXtmEIr-Q0gWVSFdBqCUt
2520
2520
  agilicus/pagination/pagination.py,sha256=hC7eLHxXKe4Iv7LdOZK3Dh8R_fKQIr9PPiWKJVyP4Nk,1672
2521
2521
  agilicus/patches.py,sha256=qTqLOgCAcFZPcPOkgfqMnK9bnqTXMvj_0ERsjRFcZug,1384
2522
2522
  agilicus/permissions.py,sha256=uB65yuDFICp1N10m0cdUjgizx9MQzAbLbAsBSTw1Rcc,2117
2523
- agilicus/policy/policies.py,sha256=Hq4t9bhJbHxdMpZUzgA-1WB5dHLyjI0zeWj33hBRy4I,3730
2524
- agilicus/policy/policy_main.py,sha256=Zjc8gir2UbCjVZOG5-Sx8HDPJ5aPlsj6VnkuRc5yXCw,1943
2523
+ agilicus/policy/policies.py,sha256=g6nuLIXpeq0fjx6zX_aKqgv8GjFC0lHmEV8t-MF26yo,5015
2524
+ agilicus/policy/policy_main.py,sha256=fQ5W3w0WulBzuAzz4Cta5xNMT030z1Wl1Vwfjmsgc8g,2615
2525
2525
  agilicus/policy/templates.py,sha256=EUvAhOhSjDuLAe2UKIFEzBp5pNpOT5y1r7uyV_GG6uI,5638
2526
2526
  agilicus/policy_config/policy_config.py,sha256=fjiyAmZ9TEGNGHQzEtLgLT7ZnPm_KgdG24oQXObsBSM,583
2527
2527
  agilicus/policy_config/policy_config_main.py,sha256=s9wBRtGNY5l4rIES_x2hQ-BTZ5hoIZ7SQZQeFU2so24,767
@@ -2547,8 +2547,8 @@ agilicus/trusted_certs/trusted_certs_main.py,sha256=6dHHWXvNIcUa_nA9ptigL4Vibe4n
2547
2547
  agilicus/users.py,sha256=JT7TIiUOtSFXPOdxmIVFm7ygZTH1FjsIkD9j-vjLuMM,38474
2548
2548
  agilicus/version.py,sha256=G9OFdL1v_4dLDfk6I6taDNypM5bbO-JHAwilsu9LYgg,23
2549
2549
  agilicus/whoami.py,sha256=kqghtWMgZOd2rhKmfguDwCTm6A3gNS8Kj-S2IBxBtl0,206
2550
- agilicus-1.251.4.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2551
- agilicus-1.251.4.dist-info/METADATA,sha256=_-hEUFB8gzHxRbPNM-qEv47KO2g0wRR6tIl2ZHWL2g8,3822
2552
- agilicus-1.251.4.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
2553
- agilicus-1.251.4.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2554
- agilicus-1.251.4.dist-info/RECORD,,
2550
+ agilicus-1.252.0.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2551
+ agilicus-1.252.0.dist-info/METADATA,sha256=3m_Rpq9G1M584E5IEQzPu6pZPQ17RK4ANZF-fWD607k,3822
2552
+ agilicus-1.252.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
2553
+ agilicus-1.252.0.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2554
+ agilicus-1.252.0.dist-info/RECORD,,