okdata-cli 5.0.1__tar.gz → 6.1.0__tar.gz

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.
Files changed (56) hide show
  1. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/LICENSE +1 -1
  2. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/PKG-INFO +4 -4
  3. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/__main__.py +6 -1
  4. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/datasets/datasets.py +10 -5
  5. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/datasets/questions.py +1 -1
  6. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/pubs/clients.py +16 -4
  7. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/pubs/pubs.py +39 -15
  8. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/pubs/questions.py +17 -3
  9. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/pubs/wizards.py +26 -4
  10. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/teams/teams.py +4 -4
  11. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/validators.py +2 -2
  12. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata_cli.egg-info/PKG-INFO +4 -4
  13. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata_cli.egg-info/requires.txt +1 -1
  14. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/setup.py +4 -4
  15. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/README.md +0 -0
  16. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/__init__.py +0 -0
  17. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/__init__.py +0 -0
  18. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/command.py +0 -0
  19. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/__init__.py +0 -0
  20. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/datasets/__init__.py +0 -0
  21. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/datasets/wizards.py +0 -0
  22. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/permissions.py +0 -0
  23. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/pubs/__init__.py +0 -0
  24. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/status.py +0 -0
  25. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/teams/questions.py +0 -0
  26. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/teams/util.py +0 -0
  27. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/teams/wizards.py +0 -0
  28. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/commands/wizard.py +0 -0
  29. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/datasets_config.json +0 -0
  30. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/datasets_config_verbose.json +0 -0
  31. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/datasets_copy_file_config.json +0 -0
  32. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/datasets_copy_file_config_2.json +0 -0
  33. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/datasets_dataset_config.json +0 -0
  34. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/datasets_dataset_version_config.json +0 -0
  35. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/datasets_dataset_version_edition_config.json +0 -0
  36. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/datasets_dataset_version_edition_distributions_config.json +0 -0
  37. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/datasets_dataset_versions_config.json +0 -0
  38. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/my_permissions_config.json +0 -0
  39. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/permissions_config.json +0 -0
  40. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/pubs_audit_log_config.json +0 -0
  41. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/pubs_clients_config.json +0 -0
  42. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/pubs_multiple_client_keys_config.json +0 -0
  43. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/pubs_single_client_keys_config.json +0 -0
  44. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/status_config.json +0 -0
  45. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/status_history_config.json +0 -0
  46. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/team_members_config.json +0 -0
  47. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/data/output-format/teams_config.json +0 -0
  48. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/io.py +0 -0
  49. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata/cli/output.py +0 -0
  50. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata_cli.egg-info/SOURCES.txt +0 -0
  51. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata_cli.egg-info/dependency_links.txt +0 -0
  52. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata_cli.egg-info/entry_points.txt +0 -0
  53. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata_cli.egg-info/namespace_packages.txt +0 -0
  54. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/okdata_cli.egg-info/top_level.txt +0 -0
  55. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/pyproject.toml +0 -0
  56. {okdata_cli-5.0.1 → okdata_cli-6.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019-2024 Oslo Origo
3
+ Copyright (c) 2019-2026 Oslo kommune
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -1,24 +1,24 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: okdata-cli
3
- Version: 5.0.1
3
+ Version: 6.1.0
4
4
  Summary: CLI for services provided by Oslo Origo
5
5
  Home-page: https://github.com/oslokommune/okdata-cli/
6
6
  Author: Oslo Origo
7
7
  Author-email: dataspeilet@oslo.kommune.no
8
8
  License: MIT
9
9
  Classifier: Development Status :: 5 - Production/Stable
10
- Classifier: Programming Language :: Python :: 3.9
11
10
  Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: Programming Language :: Python :: 3.12
14
13
  Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: Operating System :: OS Independent
17
- Requires-Python: >=3.9
17
+ Requires-Python: >=3.10
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
20
  Requires-Dist: docopt
21
- Requires-Dist: okdata-sdk<4,>=3.4
21
+ Requires-Dist: okdata-sdk<5,>=4.1
22
22
  Requires-Dist: PrettyTable
23
23
  Requires-Dist: questionary<2.0.0,>=1.10.0
24
24
  Requires-Dist: prompt-toolkit<3.0.52
@@ -4,7 +4,7 @@ import sys
4
4
 
5
5
  from keycloak.exceptions import KeycloakGetError, KeycloakPostError
6
6
  from okdata.sdk.exceptions import ApiAuthenticateError
7
- from requests.exceptions import RequestException
7
+ from requests.exceptions import ConnectTimeout, RequestException
8
8
 
9
9
  from okdata.cli import MAINTAINER
10
10
  from okdata.cli.command import BaseCommand
@@ -37,6 +37,11 @@ def main():
37
37
  # Flush output here to force SIGPIPE to be triggered while inside
38
38
  # this try block.
39
39
  sys.stdout.flush()
40
+ except ConnectTimeout as e:
41
+ instance.print(
42
+ f"Connection to '{e.request.url}' timed out. Please try again, "
43
+ f"or contact {MAINTAINER} if the problem persists.",
44
+ )
40
45
  except RequestException as e:
41
46
  if hasattr(e.response, "json"):
42
47
  instance.print_error_response(e.response.json())
@@ -1,7 +1,7 @@
1
1
  import sys
2
2
 
3
3
  from okdata.sdk.data.dataset import Dataset
4
- from okdata.sdk.data.download import Download
4
+ from okdata.sdk.data.download import Download, DownloadURLAssertionError
5
5
  from okdata.sdk.data.upload import Upload
6
6
  from requests.exceptions import HTTPError
7
7
 
@@ -123,7 +123,7 @@ Options:{BASE_COMMAND_OPTIONS}
123
123
  return
124
124
 
125
125
  config = (
126
- "datasets_config_verbose"
126
+ "datasets_config_verbose.json"
127
127
  if self.opt("verbose")
128
128
  else "datasets_dataset_config.json"
129
129
  )
@@ -421,9 +421,14 @@ Options:{BASE_COMMAND_OPTIONS}
421
421
  def download_files(self, source, target):
422
422
  download = Download(env=self.opt("env"))
423
423
  dataset_id, version, edition = self._dataset_components_from_uri(source)
424
- downloaded_files = download.download(
425
- dataset_id, version, edition, resolve_output_filepath(target)
426
- )
424
+
425
+ try:
426
+ downloaded_files = download.download(
427
+ dataset_id, version, edition, resolve_output_filepath(target)
428
+ )
429
+ except DownloadURLAssertionError as e:
430
+ sys.exit(e)
431
+
427
432
  self.log.info(f"Download returned: {downloaded_files}")
428
433
  out = create_output(self.opt("format"), "datasets_copy_file_config_2.json")
429
434
  out.output_singular_object = True
@@ -63,7 +63,7 @@ def qs_create_dataset():
63
63
  "message": "Tilgangsnivå",
64
64
  "choices": [
65
65
  Choice("Eksplisitt tilgangskontroll", "non-public"),
66
- Choice("Internt til Origo", "restricted"),
66
+ Choice("Internt til kommunen", "restricted"),
67
67
  Choice("Offentlig", "public"),
68
68
  ],
69
69
  },
@@ -13,13 +13,16 @@ class PubsClient(SDK):
13
13
  "-dev" if self.config.config["env"] == "dev" else ""
14
14
  )
15
15
 
16
- def create_maskinporten_client(self, team_id, provider, integration, scopes, env):
16
+ def create_maskinporten_client(
17
+ self, team_id, provider, integration, scopes, org, env
18
+ ):
17
19
  data = {
18
20
  "client_type": "maskinporten",
19
21
  "team_id": team_id,
20
22
  "provider": provider,
21
23
  "integration": integration,
22
24
  "scopes": scopes,
25
+ "org": org,
23
26
  "env": env,
24
27
  }
25
28
  log.info(f"Creating Maskinporten client with payload: {data}")
@@ -33,6 +36,7 @@ class PubsClient(SDK):
33
36
  frontchannel_logout_uri,
34
37
  redirect_uris,
35
38
  post_logout_redirect_uris,
39
+ org,
36
40
  env,
37
41
  ):
38
42
  data = {
@@ -44,17 +48,22 @@ class PubsClient(SDK):
44
48
  "frontchannel_logout_uri": frontchannel_logout_uri,
45
49
  "redirect_uris": redirect_uris,
46
50
  "post_logout_redirect_uris": post_logout_redirect_uris,
51
+ "org": org,
47
52
  "env": env,
48
53
  }
49
54
  log.info(f"Creating ID-porten client with payload: {data}")
50
55
  return self.post(f"{self.api_url}/clients", data=data).json()
51
56
 
52
- def get_clients(self, env):
53
- url = f"{self.api_url}/clients/{env}"
57
+ def get_clients(self, env, org=None):
58
+ url = "{}/clients/{}{}".format(
59
+ self.api_url,
60
+ env,
61
+ f"?org={org}" if org else "",
62
+ )
54
63
  log.info(f"Listing clients from: {url}")
55
64
  return self.get(url).json()
56
65
 
57
- def delete_client(self, env, client_id, aws_account, aws_region):
66
+ def delete_client(self, org, env, client_id, aws_account, aws_region):
58
67
  url = f"{self.api_url}/clients/{env}/{client_id}/delete"
59
68
  log.info(f"Deleting client for: {url}")
60
69
  return self.post(
@@ -62,11 +71,13 @@ class PubsClient(SDK):
62
71
  data={
63
72
  "aws_account": aws_account,
64
73
  "aws_region": aws_region,
74
+ "org": org,
65
75
  },
66
76
  ).json()
67
77
 
68
78
  def create_key(
69
79
  self,
80
+ org,
70
81
  env,
71
82
  client_id,
72
83
  aws_account,
@@ -81,6 +92,7 @@ class PubsClient(SDK):
81
92
  "destination_aws_account": aws_account,
82
93
  "destination_aws_region": aws_region,
83
94
  "enable_auto_rotate": enable_auto_rotate,
95
+ "org": org,
84
96
  },
85
97
  ).json()
86
98
 
@@ -84,7 +84,7 @@ Options:{BASE_COMMAND_OPTIONS}
84
84
  )
85
85
  except NoTeamError:
86
86
  self.print(
87
- "We haven't yet registered you as member of any Origo team. "
87
+ "You are not yet registered as a member of a team. "
88
88
  f"Please contact {MAINTAINER} to get it done."
89
89
  )
90
90
  return
@@ -94,6 +94,7 @@ Options:{BASE_COMMAND_OPTIONS}
94
94
  provider_id = config["provider_id"]
95
95
  integration = config["integration"]
96
96
  scopes = config["scopes"]
97
+ org = config["org"]
97
98
  env = config["env"]
98
99
 
99
100
  confirm_to_continue(
@@ -108,7 +109,7 @@ Options:{BASE_COMMAND_OPTIONS}
108
109
  self.print("Creating client...")
109
110
  if client_type_id == "maskinporten":
110
111
  response = self.pubs_client.create_maskinporten_client(
111
- team_id, provider_id, integration, scopes, env
112
+ team_id, provider_id, integration, scopes, org, env
112
113
  )
113
114
  else:
114
115
  response = self.pubs_client.create_idporten_client(
@@ -118,27 +119,34 @@ Options:{BASE_COMMAND_OPTIONS}
118
119
  config["frontchannel_logout_uri"],
119
120
  config["redirect_uris"],
120
121
  config["post_logout_redirect_uris"],
122
+ org,
121
123
  env,
122
124
  )
123
125
  client_name = response["client_name"]
124
- self.print(
125
- f"""
126
+ self.print(f"""
126
127
  Done! Created a new client '{client_name}'.
127
128
  You may now go ahead and create a key for it by running:
128
129
 
129
- okdata pubs create-key"""
130
- )
130
+ okdata pubs create-key""")
131
131
 
132
132
  def list_clients(self):
133
133
  config = list_clients_wizard()
134
+ org = config["org"]
134
135
  env = config["env"]
135
- clients = self.pubs_client.get_clients(env)
136
+
137
+ clients = self.pubs_client.get_clients(env, org)
136
138
  out = create_output(self.opt("format"), "pubs_clients_config.json")
137
139
  out.add_rows(sorted(clients, key=itemgetter("client_name")))
138
140
  self.print(f"Clients in {env}:", out)
139
141
 
140
142
  def delete_client(self):
141
- choices = delete_client_wizard(self.pubs_client)
143
+ try:
144
+ choices = delete_client_wizard(self.pubs_client)
145
+ except NoClientsError:
146
+ self.print("No clients in the given environment.")
147
+ return
148
+
149
+ org = choices["org"]
142
150
  env = choices["env"]
143
151
  client_id = choices["client_id"]
144
152
  client_name = choices["client_name"]
@@ -162,7 +170,9 @@ You may now go ahead and create a key for it by running:
162
170
  )
163
171
 
164
172
  self.print(f"Deleting client '{client_name}' [{env}]...")
165
- res = self.pubs_client.delete_client(env, client_id, aws_account, aws_region)
173
+ res = self.pubs_client.delete_client(
174
+ org, env, client_id, aws_account, aws_region
175
+ )
166
176
  deleted_ssm_params = res["deleted_ssm_params"]
167
177
 
168
178
  self.print("\nDone! The client is deleted and will no longer work.")
@@ -209,8 +219,8 @@ You may now go ahead and create a key for it by running:
209
219
  f"please contact {MAINTAINER}!"
210
220
  )
211
221
 
212
- def _handle_new_key_local(self, key, client_name, env):
213
- outfile = f"{client_name}-{env}-{key['kid']}.p12"
222
+ def _handle_new_key_local(self, key, client_id, env):
223
+ outfile = f"{client_id}-{env}-{key['kid']}.p12"
214
224
 
215
225
  with open(outfile, "wb") as f:
216
226
  f.write(base64.b64decode(key["keystore"]))
@@ -241,6 +251,7 @@ You may now go ahead and create a key for it by running:
241
251
  )
242
252
  return
243
253
 
254
+ org = config["org"]
244
255
  env = config["env"]
245
256
  client_id = config["client_id"]
246
257
  client_name = config["client_name"]
@@ -276,13 +287,13 @@ You may now go ahead and create a key for it by running:
276
287
  self.print("Creating key for '{}' [{}]...".format(client_name, env))
277
288
 
278
289
  key = self.pubs_client.create_key(
279
- env, client_id, aws_account, aws_region, enable_auto_rotate
290
+ org, env, client_id, aws_account, aws_region, enable_auto_rotate
280
291
  )
281
292
 
282
293
  if key.get("ssm_params") is not None:
283
294
  self._handle_new_key_aws(key, enable_auto_rotate)
284
295
  elif key.get("keystore") and key.get("key_password"):
285
- self._handle_new_key_local(key, client_name, env)
296
+ self._handle_new_key_local(key, client_id, env)
286
297
  else:
287
298
  self.print(
288
299
  "The key was neither added to AWS nor returned to the "
@@ -313,7 +324,12 @@ You may now go ahead and create a key for it by running:
313
324
  self.print(f"All client keys [{env}]:", out)
314
325
 
315
326
  def list_client_keys(self):
316
- choices = list_keys_wizard(self.pubs_client)
327
+ try:
328
+ choices = list_keys_wizard(self.pubs_client)
329
+ except NoClientsError:
330
+ self.print("No clients in the given environment.")
331
+ return
332
+
317
333
  env = choices["env"]
318
334
 
319
335
  if "clients" in choices:
@@ -326,6 +342,9 @@ You may now go ahead and create a key for it by running:
326
342
  def delete_client_key(self):
327
343
  try:
328
344
  choices = delete_key_wizard(self.pubs_client)
345
+ except NoClientsError:
346
+ self.print("No clients in the given environment.")
347
+ return
329
348
  except NoKeysError:
330
349
  self.print("The selected client doesn't have any keys.")
331
350
  return
@@ -342,7 +361,12 @@ You may now go ahead and create a key for it by running:
342
361
  self.print("Done! The key is deleted and will no longer work.")
343
362
 
344
363
  def audit_log(self):
345
- choices = audit_log_wizard(self.pubs_client)
364
+ try:
365
+ choices = audit_log_wizard(self.pubs_client)
366
+ except NoClientsError:
367
+ self.print("No clients in the given environment.")
368
+ return
369
+
346
370
  env = choices["env"]
347
371
  client_id = choices["client_id"]
348
372
  client_name = choices["client_name"]
@@ -15,6 +15,10 @@ client_types = {
15
15
  "maskinporten": "Maskinporten",
16
16
  }
17
17
 
18
+ _organizations = [
19
+ "dig",
20
+ ]
21
+
18
22
  _environments = [
19
23
  "test",
20
24
  "prod",
@@ -35,6 +39,16 @@ class NoKeysError(Exception):
35
39
  pass
36
40
 
37
41
 
42
+ def q_org():
43
+ return {
44
+ **required_style,
45
+ "type": "select",
46
+ "name": "org",
47
+ "message": "Organization",
48
+ "choices": _organizations,
49
+ }
50
+
51
+
38
52
  def q_env():
39
53
  return {
40
54
  **required_style,
@@ -143,8 +157,8 @@ def q_client_uri():
143
157
 
144
158
 
145
159
  def q_client(pubs_client, allow_all=False):
146
- def _client_choices(env):
147
- clients = pubs_client.get_clients(env)
160
+ def _client_choices(org, env):
161
+ clients = pubs_client.get_clients(env, org)
148
162
 
149
163
  if not clients:
150
164
  raise NoClientsError
@@ -165,7 +179,7 @@ def q_client(pubs_client, allow_all=False):
165
179
  "type": "select",
166
180
  "name": "client",
167
181
  "message": "Client",
168
- "choices": lambda x: _client_choices(x["env"]),
182
+ "choices": lambda x: _client_choices(x["org"], x["env"]),
169
183
  }
170
184
 
171
185
 
@@ -11,6 +11,7 @@ from okdata.cli.commands.pubs.questions import (
11
11
  q_integration,
12
12
  q_key,
13
13
  q_key_destination,
14
+ q_org,
14
15
  q_post_logout_redirect_uris,
15
16
  q_provider,
16
17
  q_redirect_uris,
@@ -22,6 +23,7 @@ from okdata.cli.commands.wizard import run_questionnaire
22
23
 
23
24
  def create_client_wizard(team_client, providers, scopes):
24
25
  choices = run_questionnaire(
26
+ q_org(),
25
27
  q_env(),
26
28
  q_team(team_client),
27
29
  q_client_type(),
@@ -34,6 +36,7 @@ def create_client_wizard(team_client, providers, scopes):
34
36
  q_client_uri(),
35
37
  )
36
38
  return {
39
+ "org": choices["org"],
37
40
  "env": choices["env"],
38
41
  "team_id": choices.get("team_id"),
39
42
  "client_type_id": choices["client_type_id"],
@@ -48,12 +51,16 @@ def create_client_wizard(team_client, providers, scopes):
48
51
 
49
52
 
50
53
  def list_clients_wizard():
51
- choices = run_questionnaire(q_env())
52
- return {"env": choices["env"]}
54
+ choices = run_questionnaire(q_org(), q_env())
55
+ return {
56
+ "org": choices["org"],
57
+ "env": choices["env"],
58
+ }
53
59
 
54
60
 
55
61
  def delete_client_wizard(pubs_client):
56
62
  choices = run_questionnaire(
63
+ q_org(),
57
64
  q_env(),
58
65
  q_client(pubs_client),
59
66
  q_delete_from_aws(),
@@ -61,6 +68,7 @@ def delete_client_wizard(pubs_client):
61
68
  q_aws_region(),
62
69
  )
63
70
  return {
71
+ "org": choices["org"],
64
72
  "env": choices["env"],
65
73
  "client_id": choices["client"]["id"],
66
74
  "client_name": choices["client"]["name"],
@@ -72,6 +80,7 @@ def delete_client_wizard(pubs_client):
72
80
 
73
81
  def create_key_wizard(pubs_client):
74
82
  choices = run_questionnaire(
83
+ q_org(),
75
84
  q_env(),
76
85
  q_client(pubs_client),
77
86
  q_key_destination(),
@@ -80,6 +89,7 @@ def create_key_wizard(pubs_client):
80
89
  q_enable_auto_rotate(),
81
90
  )
82
91
  return {
92
+ "org": choices["org"],
83
93
  "env": choices["env"],
84
94
  "client_id": choices["client"]["id"],
85
95
  "client_name": choices["client"]["name"],
@@ -91,8 +101,13 @@ def create_key_wizard(pubs_client):
91
101
 
92
102
 
93
103
  def list_keys_wizard(pubs_client):
94
- choices = run_questionnaire(q_env(), q_client(pubs_client, True))
104
+ choices = run_questionnaire(
105
+ q_org(),
106
+ q_env(),
107
+ q_client(pubs_client, True),
108
+ )
95
109
  return {
110
+ "org": choices["org"],
96
111
  "env": choices["env"],
97
112
  **(
98
113
  {
@@ -109,11 +124,13 @@ def list_keys_wizard(pubs_client):
109
124
 
110
125
  def delete_key_wizard(pubs_client):
111
126
  choices = run_questionnaire(
127
+ q_org(),
112
128
  q_env(),
113
129
  q_client(pubs_client),
114
130
  q_key(pubs_client),
115
131
  )
116
132
  return {
133
+ "org": choices["org"],
117
134
  "env": choices["env"],
118
135
  "client_id": choices["client"]["id"],
119
136
  "client_name": choices["client"]["name"],
@@ -122,8 +139,13 @@ def delete_key_wizard(pubs_client):
122
139
 
123
140
 
124
141
  def audit_log_wizard(pubs_client):
125
- choices = run_questionnaire(q_env(), q_client(pubs_client))
142
+ choices = run_questionnaire(
143
+ q_org(),
144
+ q_env(),
145
+ q_client(pubs_client),
146
+ )
126
147
  return {
148
+ "org": choices["org"],
127
149
  "env": choices["env"],
128
150
  "client_id": choices["client"]["id"],
129
151
  "client_name": choices["client"]["name"],
@@ -68,7 +68,7 @@ Options:{BASE_COMMAND_OPTIONS}
68
68
  config = edit_team_wizard(self.client)
69
69
  except NoTeamError:
70
70
  self.print(
71
- "We haven't yet registered you as member of any Origo team. "
71
+ "You are not yet registered as a member of a team. "
72
72
  f"Please contact {MAINTAINER} to get it done."
73
73
  )
74
74
  return
@@ -87,7 +87,7 @@ Options:{BASE_COMMAND_OPTIONS}
87
87
  members = self.client.get_team_members(config["team_id"])
88
88
  except NoTeamError:
89
89
  self.print(
90
- "We haven't yet registered you as member of any Origo team. "
90
+ "You are not yet registered as a member of a team. "
91
91
  f"Please contact {MAINTAINER} to get it done."
92
92
  if my
93
93
  else "No teams exist yet."
@@ -104,7 +104,7 @@ Options:{BASE_COMMAND_OPTIONS}
104
104
  config = add_member_wizard(self.client)
105
105
  except NoTeamError:
106
106
  self.print(
107
- "We haven't yet registered you as member of any Origo team. "
107
+ "You are not yet registered as a member of a team. "
108
108
  f"Please contact {MAINTAINER} to get it done."
109
109
  )
110
110
  return
@@ -134,7 +134,7 @@ Options:{BASE_COMMAND_OPTIONS}
134
134
  config = remove_member_wizard(self.client)
135
135
  except NoTeamError:
136
136
  self.print(
137
- "We haven't yet registered you as member of any Origo team. "
137
+ "You are not yet registered as a member of a team. "
138
138
  f"Please contact {MAINTAINER} to get it done."
139
139
  )
140
140
  return
@@ -67,9 +67,9 @@ class IntegrationValidator(Validator):
67
67
  raise ValidationError(
68
68
  message="Too long!", cursor_position=len(document.text)
69
69
  )
70
- if not re.fullmatch("[0-9a-z-]+", document.text):
70
+ if not re.fullmatch("[0-9a-zA-Z -]+", document.text):
71
71
  raise ValidationError(
72
- message='Only lowercase letters, numbers and "-", please',
72
+ message='Only letters, numbers, spaces and "-", please',
73
73
  cursor_position=len(document.text),
74
74
  )
75
75
 
@@ -1,24 +1,24 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: okdata-cli
3
- Version: 5.0.1
3
+ Version: 6.1.0
4
4
  Summary: CLI for services provided by Oslo Origo
5
5
  Home-page: https://github.com/oslokommune/okdata-cli/
6
6
  Author: Oslo Origo
7
7
  Author-email: dataspeilet@oslo.kommune.no
8
8
  License: MIT
9
9
  Classifier: Development Status :: 5 - Production/Stable
10
- Classifier: Programming Language :: Python :: 3.9
11
10
  Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: Programming Language :: Python :: 3.12
14
13
  Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: Operating System :: OS Independent
17
- Requires-Python: >=3.9
17
+ Requires-Python: >=3.10
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
20
  Requires-Dist: docopt
21
- Requires-Dist: okdata-sdk<4,>=3.4
21
+ Requires-Dist: okdata-sdk<5,>=4.1
22
22
  Requires-Dist: PrettyTable
23
23
  Requires-Dist: questionary<2.0.0,>=1.10.0
24
24
  Requires-Dist: prompt-toolkit<3.0.52
@@ -1,5 +1,5 @@
1
1
  docopt
2
- okdata-sdk<4,>=3.4
2
+ okdata-sdk<5,>=4.1
3
3
  PrettyTable
4
4
  questionary<2.0.0,>=1.10.0
5
5
  prompt-toolkit<3.0.52
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="okdata-cli",
8
- version="5.0.1",
8
+ version="6.1.0",
9
9
  author="Oslo Origo",
10
10
  author_email="dataspeilet@oslo.kommune.no",
11
11
  description="CLI for services provided by Oslo Origo",
@@ -24,7 +24,7 @@ setuptools.setup(
24
24
  },
25
25
  install_requires=[
26
26
  "docopt",
27
- "okdata-sdk>=3.4,<4",
27
+ "okdata-sdk>=4.1,<5",
28
28
  "PrettyTable",
29
29
  # TODO: Upgrade to questionary 2.x.
30
30
  "questionary>=1.10.0,<2.0.0",
@@ -37,13 +37,13 @@ setuptools.setup(
37
37
  entry_points={"console_scripts": ["okdata=okdata.cli.__main__:main"]},
38
38
  classifiers=[
39
39
  "Development Status :: 5 - Production/Stable",
40
- "Programming Language :: Python :: 3.9",
41
40
  "Programming Language :: Python :: 3.10",
42
41
  "Programming Language :: Python :: 3.11",
43
42
  "Programming Language :: Python :: 3.12",
44
43
  "Programming Language :: Python :: 3.13",
44
+ "Programming Language :: Python :: 3.14",
45
45
  "License :: OSI Approved :: MIT License",
46
46
  "Operating System :: OS Independent",
47
47
  ],
48
- python_requires=">=3.9",
48
+ python_requires=">=3.10",
49
49
  )
File without changes
File without changes
File without changes
File without changes