conjur-cli 5.6.6 → 6.0.0.rc1

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 (203) hide show
  1. checksums.yaml +5 -5
  2. data/.dockerignore +1 -1
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +1 -1
  5. data/APPLIANCE_VERSION +1 -1
  6. data/CHANGELOG.md +3 -42
  7. data/Gemfile +4 -7
  8. data/Humanfile.md +31 -0
  9. data/Jenkinsfile +34 -63
  10. data/README.md +41 -55
  11. data/Rakefile +5 -1
  12. data/bin/conjur +0 -2
  13. data/build-deb.sh +1 -3
  14. data/ci/cli-test.sh +6 -0
  15. data/ci/package.sh +3 -1
  16. data/ci/publish.sh +2 -2
  17. data/ci/secrets/publish.yml +2 -2
  18. data/ci/wait_for_server.sh +10 -0
  19. data/conjur-cli.gemspec +7 -7
  20. data/dev/docker-compose.yml +24 -0
  21. data/dev/start.sh +15 -0
  22. data/dev/stop.sh +5 -0
  23. data/docker-compose.yml +30 -0
  24. data/features/authentication/authenticate.feature +34 -0
  25. data/features/authentication/login.feature +13 -0
  26. data/features/authentication/logout.feature +15 -0
  27. data/{acceptance-features → features}/authentication/whoami.feature +0 -0
  28. data/features/authorization/resource/annotate.feature +22 -0
  29. data/features/authorization/resource/check.feature +47 -0
  30. data/{acceptance-features → features}/authorization/resource/exists.feature +18 -6
  31. data/features/authorization/resource/permitted_roles.feature +35 -0
  32. data/features/authorization/resource/show.feature +34 -0
  33. data/features/authorization/role/exists.feature +28 -0
  34. data/features/authorization/role/members.feature +45 -0
  35. data/features/authorization/role/memberships.feature +43 -0
  36. data/features/conjurenv/check.feature +34 -0
  37. data/features/conjurenv/run.feature +15 -0
  38. data/{acceptance-features → features}/conjurenv/template.feature +8 -3
  39. data/{acceptance-features → features}/directory/user/update_password.feature +8 -2
  40. data/{acceptance-features → features}/directory/variable/value.feature +9 -5
  41. data/{acceptance-features → features}/directory/variable/values-add.feature +8 -3
  42. data/features/hostfactory/tokens.feature +22 -0
  43. data/features/pubkeys/show.feature +18 -0
  44. data/features/step_definitions/authn_steps.rb +22 -0
  45. data/features/step_definitions/cli_steps.rb +28 -0
  46. data/features/step_definitions/file_steps.rb +12 -0
  47. data/features/step_definitions/flow_control_steps.rb +7 -0
  48. data/features/step_definitions/graph_steps.rb +4 -3
  49. data/{acceptance-features → features}/step_definitions/http_steps.rb +0 -0
  50. data/features/step_definitions/overrides.rb +9 -0
  51. data/features/step_definitions/policy_steps.rb +11 -0
  52. data/{acceptance-features → features}/step_definitions/trusted_proxy_steps.rb +0 -0
  53. data/features/support/blank.yml +1 -0
  54. data/features/support/env.rb +21 -7
  55. data/features/support/hooks.rb +31 -116
  56. data/features/support/world.rb +16 -76
  57. data/jenkins.sh +33 -0
  58. data/lib/conjur/authenticator.rb +83 -0
  59. data/lib/conjur/authn.rb +5 -20
  60. data/lib/conjur/cli.rb +13 -6
  61. data/lib/conjur/command.rb +30 -350
  62. data/lib/conjur/command/authn.rb +23 -15
  63. data/lib/conjur/command/host_factories.rb +2 -74
  64. data/lib/conjur/command/hosts.rb +6 -113
  65. data/lib/conjur/command/init.rb +20 -35
  66. data/lib/conjur/command/{secrets.rb → policies.rb} +33 -22
  67. data/lib/conjur/command/pubkeys.rb +3 -63
  68. data/lib/conjur/command/resources.rb +45 -162
  69. data/lib/conjur/command/roles.rb +11 -181
  70. data/lib/conjur/command/rspec/helpers.rb +0 -1
  71. data/lib/conjur/command/rspec/mock_services.rb +4 -4
  72. data/lib/conjur/command/users.rb +2 -159
  73. data/lib/conjur/command/variables.rb +5 -218
  74. data/lib/conjur/complete.rb +2 -2
  75. data/lib/conjur/config.rb +1 -11
  76. data/lib/conjur/conjurenv.rb +12 -9
  77. data/lib/conjur/identifier_manipulation.rb +3 -5
  78. data/lib/conjur/version.rb +2 -2
  79. data/{publish-rubygem.sh → publish.sh} +0 -4
  80. data/spec/authn_spec.rb +4 -0
  81. data/spec/command/hosts_spec.rb +2 -69
  82. data/spec/command/init_spec.rb +16 -11
  83. data/spec/command/pubkeys_spec.rb +1 -46
  84. data/spec/command/resources_spec.rb +21 -170
  85. data/spec/command/roles_spec.rb +5 -181
  86. data/spec/command/users_spec.rb +3 -79
  87. data/spec/command_spec.rb +1 -20
  88. data/spec/complete_spec.rb +1 -23
  89. data/spec/config_spec.rb +1 -1
  90. data/spec/spec_helper.rb +4 -5
  91. data/test.sh +29 -25
  92. metadata +92 -212
  93. data/.githooks/pre_commit/run_specs.rb +0 -23
  94. data/Dockerfile +0 -15
  95. data/Dockerfile.fpm +0 -18
  96. data/Dockerfile.publish +0 -12
  97. data/Dockerfile.standalone +0 -33
  98. data/Dockerfile.validate-packaging +0 -9
  99. data/VERSION +0 -1
  100. data/acceptance-features/audit/audit_event_send.feature +0 -107
  101. data/acceptance-features/audit/fetch.feature +0 -16
  102. data/acceptance-features/audit/send.feature +0 -51
  103. data/acceptance-features/authentication/authenticate.feature +0 -10
  104. data/acceptance-features/authentication/login.feature +0 -12
  105. data/acceptance-features/authentication/logout.feature +0 -13
  106. data/acceptance-features/authorization/resource/annotate.feature +0 -35
  107. data/acceptance-features/authorization/resource/check.feature +0 -24
  108. data/acceptance-features/authorization/resource/create.feature +0 -21
  109. data/acceptance-features/authorization/resource/deny.feature +0 -12
  110. data/acceptance-features/authorization/resource/give.feature +0 -24
  111. data/acceptance-features/authorization/resource/permit.feature +0 -20
  112. data/acceptance-features/authorization/resource/permitted_roles.feature +0 -16
  113. data/acceptance-features/authorization/resource/show.feature +0 -28
  114. data/acceptance-features/authorization/role/create.feature +0 -13
  115. data/acceptance-features/authorization/role/exists.feature +0 -19
  116. data/acceptance-features/authorization/role/grant_to.feature +0 -21
  117. data/acceptance-features/authorization/role/graph.feature +0 -57
  118. data/acceptance-features/authorization/role/members.feature +0 -23
  119. data/acceptance-features/authorization/role/memberships.feature +0 -27
  120. data/acceptance-features/bootstrap.feature +0 -13
  121. data/acceptance-features/conjurenv/check.feature +0 -21
  122. data/acceptance-features/conjurenv/run.feature +0 -10
  123. data/acceptance-features/directory/group/create.feature +0 -20
  124. data/acceptance-features/directory/group/retire.feature +0 -54
  125. data/acceptance-features/directory/host/create.feature +0 -23
  126. data/acceptance-features/directory/host/retire.feature +0 -6
  127. data/acceptance-features/directory/hostfactory/create.feature +0 -28
  128. data/acceptance-features/directory/hostfactory/tokens.feature +0 -16
  129. data/acceptance-features/directory/layer/create.feature +0 -10
  130. data/acceptance-features/directory/layer/hosts-add.feature +0 -9
  131. data/acceptance-features/directory/layer/hosts-remove.feature +0 -10
  132. data/acceptance-features/directory/layer/retire.feature +0 -43
  133. data/acceptance-features/directory/user/create.feature +0 -23
  134. data/acceptance-features/directory/user/retire.feature +0 -6
  135. data/acceptance-features/directory/variable/create.feature +0 -14
  136. data/acceptance-features/directory/variable/retire.feature +0 -17
  137. data/acceptance-features/dsl/policy_owner.feature +0 -45
  138. data/acceptance-features/dsl/resource_owner.feature +0 -17
  139. data/acceptance-features/dsl/retire.feature +0 -15
  140. data/acceptance-features/global-privilege/elevate.feature +0 -20
  141. data/acceptance-features/global-privilege/reveal.privilege +0 -20
  142. data/acceptance-features/pubkeys/add.feature +0 -22
  143. data/acceptance-features/pubkeys/delete.feature +0 -9
  144. data/acceptance-features/pubkeys/names.feature +0 -26
  145. data/acceptance-features/pubkeys/show.feature +0 -27
  146. data/acceptance-features/step_definitions/cli_steps.rb +0 -57
  147. data/acceptance-features/step_definitions/graph_steps.rb +0 -22
  148. data/acceptance-features/step_definitions/user_steps.rb +0 -51
  149. data/acceptance-features/support/env.rb +0 -23
  150. data/acceptance-features/support/hooks.rb +0 -178
  151. data/acceptance-features/support/world.rb +0 -176
  152. data/acceptance-features/trusted_proxies.feature +0 -82
  153. data/bin/conjurize +0 -26
  154. data/bin/jsonfield +0 -70
  155. data/build-standalone +0 -6
  156. data/deprecations.sh +0 -38
  157. data/features/conjurize.feature +0 -134
  158. data/features/dsl_context.feature +0 -36
  159. data/features/dsl_host_create.feature +0 -11
  160. data/features/dsl_ownership.feature +0 -30
  161. data/features/dsl_permission.feature +0 -45
  162. data/features/dsl_resource_create.feature +0 -23
  163. data/features/dsl_role_create.feature +0 -11
  164. data/features/dsl_user_create.feature +0 -23
  165. data/features/jsonfield.feature +0 -49
  166. data/features/role_graph.feature +0 -58
  167. data/features/step_definitions/conjurize_steps.rb +0 -5
  168. data/features/step_definitions/dsl_steps.rb +0 -52
  169. data/features/support/conjur.conf +0 -6
  170. data/lib/conjur/command/assets.rb +0 -121
  171. data/lib/conjur/command/audit.rb +0 -155
  172. data/lib/conjur/command/bootstrap.rb +0 -129
  173. data/lib/conjur/command/dsl_command.rb +0 -75
  174. data/lib/conjur/command/elevate.rb +0 -76
  175. data/lib/conjur/command/field.rb +0 -45
  176. data/lib/conjur/command/groups.rb +0 -208
  177. data/lib/conjur/command/ids.rb +0 -34
  178. data/lib/conjur/command/layers.rb +0 -211
  179. data/lib/conjur/command/ldapsync.rb +0 -118
  180. data/lib/conjur/command/rspec/audit_helpers.rb +0 -68
  181. data/lib/conjur/command/rubydsl.rb +0 -93
  182. data/lib/conjur/command/script.rb +0 -48
  183. data/lib/conjur/command/server.rb +0 -67
  184. data/lib/conjur/conjurize.rb +0 -71
  185. data/lib/conjur/conjurize/script.rb +0 -150
  186. data/lib/conjur/dsl/runner.rb +0 -273
  187. data/publish-deb.sh +0 -6
  188. data/push-image +0 -29
  189. data/spec/command/assets_spec.rb +0 -115
  190. data/spec/command/audit_spec.rb +0 -376
  191. data/spec/command/elevate_spec.rb +0 -28
  192. data/spec/command/env_spec.rb +0 -168
  193. data/spec/command/groups_spec.rb +0 -77
  194. data/spec/command/host_factories_spec.rb +0 -38
  195. data/spec/command/layers_spec.rb +0 -35
  196. data/spec/command/ldapsync_spec.rb +0 -28
  197. data/spec/command/rubydsl_spec.rb +0 -63
  198. data/spec/command/variable_expiration_spec.rb +0 -164
  199. data/spec/command/variables_spec.rb +0 -192
  200. data/spec/conjurize/script_spec.rb +0 -62
  201. data/spec/conjurize_spec.rb +0 -70
  202. data/spec/dsl/runner_spec.rb +0 -93
  203. data/spec/env_spec.rb +0 -214
@@ -1,10 +0,0 @@
1
- Feature: Create a layer
2
-
3
- Scenario: Create a layer
4
- When I successfully run `conjur layer create $ns/test_layer`
5
- Then the JSON response at "id" should include "test_layer"
6
- And the JSON response at "hosts" should be []
7
-
8
- Scenario: Create a layer owned by the security_admin group
9
- When I successfully run `conjur layer create --as-group $ns/security_admin $ns/test_layer`
10
- Then the JSON response at "ownerid" should include "security_admin"
@@ -1,9 +0,0 @@
1
- Feature: Add hosts to layer
2
-
3
- Background:
4
- Given I run `conjur layer create $ns/testlayer`
5
- And I run `conjur host create $ns.example.com`
6
-
7
- Scenario: Add host to layer
8
- When I successfully run `conjur layer hosts add $ns/testlayer $ns.example.com`
9
- Then the output should contain "Host added"
@@ -1,10 +0,0 @@
1
- Feature: Remove hosts from layer
2
-
3
- Background:
4
- Given I run `conjur layer create $ns/testlayer`
5
- And I run `conjur host create $ns.example.com`
6
- And I run `conjur layer hosts add $ns/testlayer $ns.example.com`
7
-
8
- Scenario: Remove host from layer
9
- When I successfully run `conjur layer hosts remove $ns/testlayer $ns.example.com`
10
- Then the output should contain "Host removed"
@@ -1,43 +0,0 @@
1
- Feature: Retire a layer
2
- Background:
3
- When I successfully run `conjur layer create $ns/applayer`
4
-
5
- Scenario: Basic retirement
6
- Then I successfully run `conjur layer retire -d user:attic@$ns $ns/applayer`
7
-
8
- Scenario: Retiring a non-existent thing propagates the 404
9
- Then I run `conjur layer retire -d user:attic@$ns $ns/foobar`
10
- Then the exit status should be 1
11
- And the stderr should contain "Resource Not Found"
12
-
13
- Scenario: A foreign user can't retire a layer
14
- Given I login as a new user
15
- And I run `conjur layer retire -d user:attic@$ns $ns/applayer`
16
- Then the exit status should be 1
17
- And the stderr should contain "You can't administer this record"
18
-
19
- Scenario: Can't retire to a non-existant role
20
- And I run `conjur layer retire -d user:foobar $ns/applayer`
21
- Then the exit status should be 1
22
- And the output should match /error: Destination role/
23
- And the output should match /doesn't exist$/
24
-
25
- Scenario: I can retire a layer which I've granted to a group
26
- Given I successfully run `conjur group create $ns/admin`
27
- And I successfully run `conjur role grant_to layer:$ns/applayer group:$ns/admin`
28
- Then I successfully run `conjur layer retire -d user:attic@$ns $ns/applayer`
29
-
30
- Scenario: I can retire a layer which I've given to a group that I can admin
31
- Given I successfully run `conjur group create $ns/admin`
32
- And I successfully run `conjur resource give layer:$ns/applayer group:$ns/admin`
33
- Then I successfully run `conjur layer retire -d user:attic@$ns $ns/applayer`
34
-
35
- Scenario: I can't retire a layer if I can't admin the layer's role
36
- Given I successfully run `conjur group create $ns/admin`
37
- And I successfully run `conjur role grant_to layer:$ns/applayer group:$ns/admin`
38
- Given I create a new user named "alice@$ns"
39
- And I successfully run `conjur group members add -a $ns/admin alice@$ns`
40
- And I login as "alice@$ns"
41
- And I run `conjur layer retire -d user:attic@$ns $ns/applayer`
42
- Then the exit status should be 1
43
- And the stderr should contain "You can't administer this record"
@@ -1,23 +0,0 @@
1
- Feature: Create a User
2
-
3
- Scenario: Create a passwordless user
4
- When I successfully run `conjur user create alice-without-password@$ns`
5
- And the JSON should have "api_key"
6
-
7
- Scenario: Create a user with a password
8
- When I run `conjur user create -p alice-with-password@$ns` interactively
9
- And I type "foobar"
10
- And I type "foobar"
11
- Then the exit status should be 0
12
- And the JSON should have "api_key"
13
-
14
- Scenario: Create a user owned by the security_admin group
15
- When I successfully run `conjur user create --as-group $ns/security_admin alice-without-password@$ns`
16
- And I keep the JSON response at "ownerid" as "OWNERID"
17
- Then the output should contain "/security_admin"
18
-
19
- Scenario: Some characters are disallowed in user ids, such as /
20
- When I run `conjur user create alice/$ns`
21
- Then the exit status should be 1
22
- And the stderr should contain "error: 403 Forbidden"
23
- And the stdout should not contain anything
@@ -1,6 +0,0 @@
1
- Feature: Retire a user
2
- Background:
3
- When I successfully run `conjur user create --as-role user:admin@$ns alice@$ns`
4
-
5
- Scenario: Basic retirement
6
- Then I successfully run `conjur user retire -d user:attic@$ns alice@$ns`
@@ -1,14 +0,0 @@
1
- Feature: create an empty variable
2
-
3
- Background:
4
- Given I successfully run `conjur variable create $ns/secret`
5
-
6
- Scenario: Variable is created and responds to metadata
7
- When I run `conjur variable show $ns/secret`
8
- Then the JSON should have "id"
9
- And the JSON should have "ownerid"
10
- And the JSON at "version_count" should be 0
11
-
12
- Scenario: Variable keeps no value
13
- When I run `conjur variable value $ns/secret`
14
- Then the exit status should be 1
@@ -1,17 +0,0 @@
1
- Feature: Retire a variable
2
- Background:
3
- Given I successfully run `conjur variable create $ns/secret the-value`
4
-
5
- Scenario: Basic retirement
6
- Then I successfully run `conjur variable retire -d user:attic@$ns $ns/secret`
7
-
8
- Scenario: A foreign user can't retire a secret
9
- Given I login as a new user
10
- And I run `conjur variable retire -d user:attic@$ns $ns/secret`
11
- Then the exit status should be 1
12
- And the stderr should contain "You don't own the record"
13
-
14
- Scenario: I can retire a variable which I've given to a group that I can admin
15
- Given I successfully run `conjur group create $ns/admin`
16
- And I successfully run `conjur resource give variable:$ns/secret group:$ns/admin`
17
- Then I successfully run `conjur variable retire -d user:attic@$ns $ns/secret`
@@ -1,45 +0,0 @@
1
- Feature: Loading a policy can specify the policy's admin
2
-
3
- Background:
4
- Given I successfully run `conjur group create $ns/admin`
5
- And a file named "policy.rb" with:
6
- """
7
- policy 'test-policy-1.0' do
8
- user "test_user"
9
- end
10
- """
11
- And I reset the command list
12
-
13
- Scenario: --as-group works
14
- When I run `conjur rubydsl load --as-group $ns/admin --collection $ns` interactively
15
- And I pipe in the file "policy.rb"
16
- And the command completes successfully
17
- And I reset the command list
18
- When I run `conjur role members policy:$ns/test-policy-1.0`
19
- Then the JSON should be:
20
- """
21
- [
22
- "cucumber:group:%{NAMESPACE}/admin"
23
- ]
24
- """
25
-
26
- Scenario: --as-role works
27
- When I run `conjur rubydsl load --as-role group:$ns/admin --collection $ns` interactively
28
- And I pipe in the file "policy.rb"
29
- And the command completes successfully
30
- And I reset the command list
31
- When I run `conjur role members policy:$ns/test-policy-1.0`
32
- Then the JSON should be:
33
- """
34
- [
35
- "cucumber:group:%{NAMESPACE}/admin"
36
- ]
37
- """
38
-
39
- Scenario: --as-group doesn't interfere with policy ownership of other resources
40
- When I run `conjur rubydsl load --as-group $ns/admin --collection $ns` interactively
41
- And I pipe in the file "policy.rb"
42
- And the command completes successfully
43
- And I reset the command list
44
- When I run `conjur resource show user:test_user@$ns-test-policy-1-0`
45
- Then the JSON at "owner" should be "cucumber:policy:%{NAMESPACE}/test-policy-1.0"
@@ -1,17 +0,0 @@
1
- Feature: Resources created by a policy are owned by the policy
2
-
3
- Background:
4
- Given a file named "policy.rb" with:
5
- """
6
- policy 'test-policy-1.0' do
7
- resource 'webservice', 'web1'
8
- end
9
- """
10
-
11
- Scenario: resource is create with correct ownership
12
- When I run `conjur rubydsl load --collection $ns` interactively
13
- And I pipe in the file "policy.rb"
14
- And the command completes successfully
15
- And I reset the command list
16
- When I run `conjur resource show webservice:$ns/test-policy-1.0/web1`
17
- Then the JSON at "owner" should be "cucumber:policy:%{NAMESPACE}/test-policy-1.0"
@@ -1,15 +0,0 @@
1
- Feature: Retire a policy
2
- Background:
3
- Given a file named "policy.rb" with:
4
- """
5
- policy 'test-policy-1.0' do
6
- end
7
- """
8
- And I run `conjur rubydsl load --as-role user:admin@$ns --collection $ns` interactively
9
- And I pipe in the file "policy.rb"
10
- And the exit status should be 0
11
-
12
- @wip
13
- Scenario: Basic retirement
14
- Then I successfully run `conjur rubydsl retire -d user:attic@$ns $ns/test-policy-1.0`
15
-
@@ -1,20 +0,0 @@
1
- Feature: 'elevate' can be used to activate root-like privileges
2
-
3
- Background:
4
- Given I successfully run `conjur variable create $ns/secret secretvalue`
5
- And I create a new user named "alice@$ns"
6
-
7
- Scenario: The secret value is not accessible without 'elevate' privilege
8
- Given I login as "alice@$ns"
9
- When I run `conjur variable value $ns/secret`
10
- Then the exit status should be 1
11
-
12
- Scenario: 'elevate' can't be used without permission
13
- Given I login as "alice@$ns"
14
- When I run `conjur elevate variable show $ns/secret`
15
- Then the exit status should be 1
16
-
17
- Scenario: The secret value is accessible with 'elevate' privilege
18
- Given I successfully run `conjur resource permit '!:!:conjur' user:alice@$ns elevate`
19
- And I login as "alice@$ns"
20
- Then I successfully run `conjur elevate variable value $ns/secret`
@@ -1,20 +0,0 @@
1
- Feature: 'reveal' can be used to see all records
2
-
3
- Background:
4
- Given I successfully run `conjur variable create $ns/secret secretvalue`
5
- And I create a new user named "alice@$ns"
6
-
7
- Scenario: The secret value is not accessible without 'reveal' privilege
8
- Given I login as "alice@$ns"
9
- When I run `conjur variable show $ns/secret`
10
- Then the exit status should be 1
11
-
12
- Scenario: 'reveal' can't be used without permission
13
- Given I login as "alice@$ns"
14
- When I run `conjur reveal variable show $ns/secret`
15
- Then the exit status should be 1
16
-
17
- Scenario: The secret value is accessible with 'reveal' privilege
18
- Given I successfully run `conjur resource permit '!:!:conjur' user:alice@$ns reveal`
19
- And I login as "alice@$ns"
20
- Then I successfully run `conjur reveal variable show $ns/secret`
@@ -1,22 +0,0 @@
1
- Feature: Register a public key
2
-
3
- Background:
4
- Given I successfully run `conjur user create alice@$ns`
5
- And I successfully run `ssh-keygen -t rsa -C "laptop" -N "" -f ./id_alice_$ns`
6
- And I reset the command list
7
-
8
- Scenario: Register a public key file for a user
9
- When I run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
10
- Then the exit status should be 0
11
-
12
- Scenario: You can't accidentally register the private key
13
- When I run `conjur pubkeys add alice@$ns @id_alice_$ns`
14
- Then the exit status should be 1
15
- And the stderr should contain "Unprocessable Entity"
16
-
17
- Scenario: Unauthorized users cannot modify public keys
18
- Given I login as new user "bob@$ns"
19
- And I reset the command list
20
- And I run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
21
- Then the exit status should be 1
22
- And the stderr should contain "Forbidden"
@@ -1,9 +0,0 @@
1
- Feature: Remove a public key
2
-
3
- Background:
4
- Given I successfully run `conjur user create alice@$ns`
5
- And I successfully run `ssh-keygen -t rsa -C "laptop" -N "" -f ./id_alice_$ns`
6
-
7
- Scenario: To remove a public key, use the user's login name and the key name (-C option to ssh-keygen)
8
- Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
9
- Then I successfully run `conjur pubkeys delete alice@$ns laptop`
@@ -1,26 +0,0 @@
1
- Feature: List known public key names for a user
2
-
3
- Background:
4
- Given I successfully run `conjur user create alice@$ns`
5
- And I successfully run `ssh-keygen -t rsa -C "laptop" -N "" -f ./id_alice_$ns`
6
- And I reset the command list
7
-
8
- Scenario: Initial key names list is empty
9
- When I run `conjur pubkeys names alice@$ns`
10
- Then the stdout should contain exactly ""
11
-
12
- Scenario: After adding a key, the key name is shown
13
- Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
14
- And I reset the command list
15
- And I run `conjur pubkeys names alice@$ns`
16
- Then the stdout should contain exactly:
17
- """
18
- laptop\n
19
- """
20
-
21
- Scenario: After deleting the key, the key names list is empty again
22
- Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
23
- And I successfully run `conjur pubkeys delete alice@$ns laptop`
24
- And I reset the command list
25
- And I run `conjur pubkeys names alice@$ns`
26
- Then the stdout should contain exactly ""
@@ -1,27 +0,0 @@
1
- Feature: Show public keys for a user
2
-
3
- Background:
4
- Given I successfully run `conjur user create alice@$ns`
5
- And I successfully run `ssh-keygen -t rsa -C "laptop" -N "" -f ./id_alice_$ns`
6
- And I reset the command list
7
-
8
- Scenario: Initial key list is empty
9
- When I run `conjur pubkeys show alice@$ns`
10
- Then the stdout should contain exactly "\n"
11
-
12
- Scenario: After adding a key, the key is shown
13
- Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
14
- And I run `conjur pubkeys show alice@$ns`
15
- And the output should match /^ssh-rsa .* laptop$/
16
-
17
- Scenario: After deleting the key, the key list is empty again
18
- Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
19
- And I successfully run `conjur pubkeys delete alice@$ns laptop`
20
- And I reset the command list
21
- And I run `conjur pubkeys show alice@$ns`
22
- Then the stdout should contain exactly "\n"
23
-
24
- Scenario: Public keys can be listed using cURL, without authentication
25
- Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
26
- When I successfully run `curl -k $pubkeys_url/alice@$ns`
27
- Then the output should match /^ssh-rsa .* laptop$/
@@ -1,57 +0,0 @@
1
- Transform /\$ns/ do |s|
2
- s.gsub('$ns', namespace)
3
- end
4
-
5
- Transform /\$user_role/ do |s|
6
- s.gsub('$user_role', test_user.role_id)
7
- end
8
-
9
- Transform /^table:/ do |table|
10
- table.tap do |t|
11
- t.hashes.each do |row|
12
- row.each do |_,v|
13
- v.gsub!('$ns', namespace)
14
- v.gsub!('$user_role', test_user.role_id)
15
- end
16
- end
17
- end
18
- end
19
-
20
-
21
- Then /^I reset the command list/ do
22
- aruba.command_monitor.clear
23
- end
24
-
25
- When /^the command completes successfully/ do
26
- last_command_started.wait
27
- last_command_started.terminate
28
- expect(last_command_started.exit_status).to eq(0)
29
- end
30
-
31
- Then /^I send the audit event:/ do |event|
32
- step "I run `env RESTCLIENT_LOG=stderr conjur audit send` interactively"
33
- last_command_started.write event
34
- last_command_started.close_io :stdin
35
- step "the command completes successfully"
36
- end
37
-
38
- # this is step copypasted from https://github.com/cucumber/aruba/blob/master/lib/aruba/cucumber.rb#L24
39
- # original has typo in regexp, which is fixed here
40
- Given(/^a file named "([^"]*?)" with: '(.*?)'$/) do |file_name, file_content|
41
- write_file(file_name, file_content)
42
- end
43
-
44
- Given(/^a file named "([^"]*?)" with namespace substitution:$/) do |file_name, file_content|
45
- step "a file named \"#{file_name}\" with:", file_content
46
- end
47
-
48
- Then /^it prints the path to temporary file which contains: '(.*)'$/ do |content|
49
- filename = last_command_started.stdout.strip
50
- tempfiles << filename
51
- actual_content = File.read(filename)
52
- expect(actual_content).to match(content)
53
- end
54
-
55
- Then /^the output from "([^"]*)" should match \/([^\/]*)\/$/ do |cmd, expected|
56
- assert_matching_output(expected, output_from(cmd))
57
- end
@@ -1,22 +0,0 @@
1
-
2
- Given /^a graph with edges$/ do |table|
3
- graph table.raw
4
- end
5
-
6
- Then %r{^the graph JSON should be:$} do |json|
7
- json = expand_roles json
8
- last_graph = extract_filtered_graph json
9
- expect(last_graph.to_json).to be_json_eql(json)
10
- end
11
-
12
- When(/^I( successfully)? run with role expansion "(.*)"$/) do |successfully, cmd|
13
- role_id_map.each do |role, expanded_role|
14
- cmd.gsub! role, expanded_role
15
- end
16
- self.last_cmd = cmd
17
- if successfully
18
- step "I successfully run `#{cmd}`"
19
- else
20
- step "I run `#{cmd}`"
21
- end
22
- end