remotivelabs-cli 0.0.1a14__tar.gz → 0.0.1a15__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 (23) hide show
  1. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/PKG-INFO +1 -1
  2. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/auth_tokens.py +2 -3
  3. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/rest_helper.py +2 -2
  4. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/service_account_tokens.py +2 -2
  5. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/pyproject.toml +1 -1
  6. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/LICENSE +0 -0
  7. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/README.md +0 -0
  8. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/__about__.py +0 -0
  9. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/__init__.py +0 -0
  10. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/brokers.py +0 -0
  11. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/__init__.py +0 -0
  12. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/auth.py +0 -0
  13. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/brokers.py +0 -0
  14. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/cloud_cli.py +0 -0
  15. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/configs.py +0 -0
  16. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/projects.py +0 -0
  17. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/recordings.py +0 -0
  18. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/cloud/service_accounts.py +0 -0
  19. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/lib/__about__.py +0 -0
  20. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/lib/broker.py +0 -0
  21. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/remotive.py +0 -0
  22. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/requirements.txt +0 -0
  23. {remotivelabs_cli-0.0.1a14 → remotivelabs_cli-0.0.1a15}/cli/test/test_simple.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: remotivelabs-cli
3
- Version: 0.0.1a14
3
+ Version: 0.0.1a15
4
4
  Summary:
5
5
  Author: Johan Rask
6
6
  Author-email: johan.rask@remotivelabs.com
@@ -35,11 +35,10 @@ def list_personal_access_tokens():
35
35
 
36
36
  @app.command(name="revoke", help="Revoke the specified access token")
37
37
  def revoke(
38
- token_name: str = typer.Option(..., help="Name of the access token to revoke")
38
+ name: str = typer.Option(..., help="Name of the access token to revoke")
39
39
  ):
40
40
  rest.ensure_auth_token()
41
- rest.handle_delete(f'/api/me/keys/{token_name}')
42
-
41
+ rest.handle_delete(f'/api/me/keys/{name}', success_msg="Successfully revoked")
43
42
 
44
43
  @app.command()
45
44
  def describe(
@@ -77,7 +77,7 @@ def has_access(url, params={}):
77
77
  return True
78
78
 
79
79
 
80
- def handle_delete(url, params={}, quiet=False):
80
+ def handle_delete(url, params={}, quiet=False, success_msg="Successfully deleted"):
81
81
  ensure_auth_token()
82
82
  r = requests.delete(f'{base_url}{url}', headers=headers, params=params)
83
83
  if r.status_code == 200:
@@ -85,7 +85,7 @@ def handle_delete(url, params={}, quiet=False):
85
85
  print(json.dumps(r.json()))
86
86
  if r.status_code == 204:
87
87
  if quiet == False:
88
- sys.stderr.write('Successfully deleted\n')
88
+ sys.stderr.write(f'{success_msg}\n')
89
89
  else:
90
90
  print(f'Got status code: {r.status_code}')
91
91
  print(r.text)
@@ -47,10 +47,10 @@ def list_files():
47
47
 
48
48
  @app.command(name="revoke", help="Revoke service account access token")
49
49
  def revoke(
50
+ name: str = typer.Argument(..., help="Access token name"),
50
51
  service_account: str = typer.Option(..., help="Service account name"),
51
- token_name: str = typer.Option(..., help="Access token name"),
52
52
  project: str = typer.Option(..., help="Project ID", envvar='REMOTIVE_CLOUD_PROJECT')):
53
- rest.handle_delete(f"/api/project/{project}/admin/accounts/{service_account}/keys/{token_name}")
53
+ rest.handle_delete(f"/api/project/{project}/admin/accounts/{service_account}/keys/{name}")
54
54
 
55
55
 
56
56
  def write_token(file, token):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "remotivelabs-cli"
3
- version = "0.0.1.alpha14"
3
+ version = "0.0.1.alpha15"
4
4
  description = ""
5
5
  authors = ["Johan Rask <johan.rask@remotivelabs.com>"]
6
6
  readme = "README.md"