vgs-cli 0.0.1.dev0__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.
Files changed (56) hide show
  1. vgs_cli-0.0.1.dev0.data/data/vgscli/calm.yaml +16 -0
  2. vgs_cli-0.0.1.dev0.data/data/vgscli/checkout.yaml +21 -0
  3. vgs_cli-0.0.1.dev0.data/data/vgscli/http-route-template.yaml +61 -0
  4. vgs_cli-0.0.1.dev0.data/data/vgscli/mft-route-template.yaml +10 -0
  5. vgs_cli-0.0.1.dev0.data/data/vgscli/payments-admin.yaml +25 -0
  6. vgs_cli-0.0.1.dev0.data/data/vgscli/service-account-schema.yaml +54 -0
  7. vgs_cli-0.0.1.dev0.data/data/vgscli/sub-account-checkout.yaml +23 -0
  8. vgs_cli-0.0.1.dev0.data/data/vgscli/vault-resources.yaml +710 -0
  9. vgs_cli-0.0.1.dev0.data/data/vgscli/vault-schema.yaml +36 -0
  10. vgs_cli-0.0.1.dev0.data/data/vgscli/vault-template.yaml +12 -0
  11. vgs_cli-0.0.1.dev0.data/data/vgscli/vgs-cli.yaml +17 -0
  12. vgs_cli-0.0.1.dev0.dist-info/METADATA +139 -0
  13. vgs_cli-0.0.1.dev0.dist-info/RECORD +56 -0
  14. vgs_cli-0.0.1.dev0.dist-info/WHEEL +5 -0
  15. vgs_cli-0.0.1.dev0.dist-info/entry_points.txt +2 -0
  16. vgs_cli-0.0.1.dev0.dist-info/licenses/LICENSE +22 -0
  17. vgs_cli-0.0.1.dev0.dist-info/top_level.txt +1 -0
  18. vgscli/__init__.py +0 -0
  19. vgscli/_version.py +32 -0
  20. vgscli/access_logs.py +65 -0
  21. vgscli/audits_api.py +102 -0
  22. vgscli/auth.py +68 -0
  23. vgscli/auth_server.py +131 -0
  24. vgscli/auth_utils.py +24 -0
  25. vgscli/callback_server.py +41 -0
  26. vgscli/cert_manager_api.py +34 -0
  27. vgscli/cli/__init__.py +23 -0
  28. vgscli/cli/commands/__init__.py +3 -0
  29. vgscli/cli/commands/apply.py +307 -0
  30. vgscli/cli/commands/generate.py +134 -0
  31. vgscli/cli/commands/get.py +200 -0
  32. vgscli/cli/types/__init__.py +2 -0
  33. vgscli/cli/types/resource_id.py +39 -0
  34. vgscli/cli/types/variable.py +21 -0
  35. vgscli/cli_utils.py +132 -0
  36. vgscli/click_extensions.py +88 -0
  37. vgscli/config_file.py +58 -0
  38. vgscli/errors.py +263 -0
  39. vgscli/file_token_util.py +30 -0
  40. vgscli/id_generator.py +46 -0
  41. vgscli/keyring_token_util.py +128 -0
  42. vgscli/resource-templates/http-route-template.yaml +61 -0
  43. vgscli/resource-templates/mft-route-template.yaml +10 -0
  44. vgscli/resource-templates/service-account/calm.yaml +16 -0
  45. vgscli/resource-templates/service-account/checkout.yaml +21 -0
  46. vgscli/resource-templates/service-account/payments-admin.yaml +25 -0
  47. vgscli/resource-templates/service-account/sub-account-checkout.yaml +23 -0
  48. vgscli/resource-templates/service-account/vgs-cli.yaml +17 -0
  49. vgscli/resource-templates/vault-template.yaml +12 -0
  50. vgscli/testing.py +48 -0
  51. vgscli/text.py +9 -0
  52. vgscli/token_handler.py +11 -0
  53. vgscli/validation-schemas/service-account-schema.yaml +54 -0
  54. vgscli/validation-schemas/vault-resources.yaml +710 -0
  55. vgscli/validation-schemas/vault-schema.yaml +36 -0
  56. vgscli/vgs.py +249 -0
@@ -0,0 +1,16 @@
1
+ apiVersion: 1.0.0
2
+ kind: ServiceAccount
3
+ data:
4
+ name: calm
5
+ {%- if vaults | length == 0 %}
6
+ {{ cli_fail("This template needs single vault to be specified. Please use '--vault <vault-identifier>' to pass the vault.") }}
7
+ {% elif vaults | length == 1 %}
8
+ vaults:
9
+ - {{ vaults[0] }}
10
+ {%- else %}
11
+ {{ cli_fail("This template doesn't allow multiple vaults.") }}
12
+ {% endif %}
13
+ scopes:
14
+ - name: cards:write
15
+ - name: network-tokens:write
16
+ - name: merchants:write
@@ -0,0 +1,21 @@
1
+ apiVersion: 1.0.0
2
+ kind: ServiceAccount
3
+ data:
4
+ name: {{ name }}
5
+ {%- if vaults | length == 0 %}
6
+ {{ cli_fail("This template needs single vault to be specified. Please use '--vault <vault-identifier>' to pass the vault.") }}
7
+ {% elif vaults | length == 1 %}
8
+ vaults:
9
+ - {{ vaults[0] }}
10
+ {%- else %}
11
+ {{ cli_fail("This template doesn't allow multiple vaults.") }}
12
+ {% endif %}
13
+ scopes:
14
+ - name: financial-instruments:write
15
+ optional: true
16
+ - name: transfers:write
17
+ optional: true
18
+ - name: orders:write
19
+ optional: true
20
+
21
+ accessTokenLifespan: 28800
@@ -0,0 +1,61 @@
1
+ apiVersion: vault.vgs.io/v1
2
+ kind: HttpRoute
3
+ metadata:
4
+ name: your-name-here
5
+ labels:
6
+ vgs.io/vaultId: your-vault-id-here
7
+ spec:
8
+ # TODO: Change this ID
9
+ id: &routeId 7478d3b7-beef-cafe-0000-000000000000
10
+ type: rule_chain
11
+ attributes:
12
+ id: *routeId
13
+ host_endpoint: httpbin.org
14
+ destination_override_endpoint: '*'
15
+ ordinal: 0
16
+ port: 0
17
+ protocol: http
18
+ source_endpoint: '*'
19
+ tags:
20
+ # TODO: add a good name
21
+ name: Display name of route here
22
+ # TODO: add version here
23
+ vgs.io/version: 0.1.0
24
+ # filters
25
+ entries:
26
+ # first filter - document here what it does
27
+ - classifiers: {}
28
+ config:
29
+ condition: OR
30
+ rules:
31
+ - expression:
32
+ field: PathInfo
33
+ operator: matches
34
+ type: string
35
+ values:
36
+ - /post
37
+ id: 955834e8-beef-cafe-0000-000000000000
38
+ id_selector: null
39
+ operation: ENRICH
40
+ operations:
41
+ - name: github.com/verygoodsecurity/common/compute/larky/http/Process
42
+ parameters:
43
+ script: |
44
+ load('@stdlib//json', 'json')
45
+ load("@stdlib//builtins", "builtins")
46
+
47
+ load("@vgs//vault", "vault")
48
+
49
+ def process(input, ctx):
50
+ # TODO: write your larky code here.
51
+
52
+ return input
53
+ phase: REQUEST
54
+ public_token_generator: UUID
55
+ targets:
56
+ - body
57
+ token_manager: PERSISTENT
58
+ transformer: JSON_PATH
59
+ transformer_config:
60
+ - $.whatever_this_field_is_unused
61
+ transformer_config_map: null
@@ -0,0 +1,10 @@
1
+ ---
2
+ apiVersion: mft.vgs.io/v1beta
3
+ kind: MftRoute
4
+ metadata:
5
+ name: my-mft-route
6
+ id: foo
7
+ spec:
8
+ source: foo
9
+ destination: bar
10
+ filters: []
@@ -0,0 +1,25 @@
1
+ apiVersion: 1.0.0
2
+ kind: ServiceAccount
3
+ data:
4
+ {%- if vaults | length == 0 %}
5
+ {{ cli_fail("This template needs single vault to be specified. Please use '--vault <vault-identifier>' to pass the vault.") }}
6
+ {%- elif vaults | length == 1 %}
7
+ name: payments-{{ vaults[0] }}
8
+ vaults:
9
+ - {{ vaults[0] }}
10
+ {%- else %}
11
+ {{ cli_fail("This template doesn't allow multiple vaults.") }}
12
+ {% endif %}
13
+ scopes:
14
+ - name: financial-instruments:admin
15
+ - name: gateways:admin
16
+ - name: rules:admin
17
+ - name: transfers:admin
18
+ - name: orders:admin
19
+ - name: threeds:admin
20
+ - name: sub-accounts:admin
21
+ - name: cards:write
22
+ - name: network-tokens:write
23
+ - name: merchants:write
24
+
25
+ accessTokenLifespan: 28800
@@ -0,0 +1,54 @@
1
+ ---
2
+ "$schema": http://json-schema.org/draft-07/schema#
3
+ type: object
4
+ properties:
5
+ apiVersion:
6
+ type: string
7
+ enum:
8
+ - 1.0.0
9
+ kind:
10
+ type: string
11
+ enum:
12
+ - ServiceAccount
13
+ data:
14
+ type: object
15
+ properties:
16
+ name:
17
+ type: string
18
+ annotations:
19
+ type: object
20
+ additionalProperties:
21
+ type: string
22
+ default: {}
23
+ vaults:
24
+ type: array
25
+ items:
26
+ type: string
27
+ scopes:
28
+ type: array
29
+ items:
30
+ oneOf:
31
+ - type: object
32
+ properties:
33
+ name:
34
+ type: string
35
+ optional:
36
+ type: boolean
37
+ default: false
38
+ required:
39
+ - name
40
+ additionalProperties: false
41
+ - type: string # Left for compatibility
42
+ minItems: 1
43
+ accessTokenLifespan:
44
+ type: integer
45
+ minimum: 60
46
+ required:
47
+ - name
48
+ - scopes
49
+ additionalProperties: false
50
+ required:
51
+ - apiVersion
52
+ - kind
53
+ - data
54
+ additionalProperties: false
@@ -0,0 +1,23 @@
1
+ apiVersion: 1.0.0
2
+ kind: ServiceAccount
3
+ data:
4
+ name: {{ sub_account_id }}
5
+ annotations:
6
+ "vgs.io/sub-account": "{{ sub_account_id }}"
7
+ {%- if vaults | length == 0 %}
8
+ {{ cli_fail("This template needs single vault to be specified. Please use '--vault <vault-identifier>' to pass the vault.") }}
9
+ {% elif vaults | length == 1 %}
10
+ vaults:
11
+ - {{ vaults[0] }}
12
+ {%- else %}
13
+ {{ cli_fail("This template doesn't allow multiple vaults.") }}
14
+ {% endif %}
15
+ scopes:
16
+ - name: financial-instruments:write
17
+ optional: true
18
+ - name: transfers:write
19
+ optional: true
20
+ - name: orders:write
21
+ optional: true
22
+
23
+ accessTokenLifespan: 28800