gritano 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/TODO CHANGED
@@ -1,5 +1,14 @@
1
1
  v0.6.0
2
- - renomear gritano-check
3
2
  - melhorar o instalador/updater
4
3
  - escolha de db
5
- - escolha de pasta dos repos
4
+ - escolha de pasta dos repos
5
+
6
+ v0.7.0
7
+ - gritano-openssh
8
+ - gritano ssh:install
9
+ gritano ssh:config:show
10
+ gritano ssh config:set:port 22
11
+ ...
12
+ gritano ssh:start
13
+ gritano ssh:stop
14
+ gritano ssh:restart
File without changes
data/gritano.gemspec CHANGED
@@ -5,14 +5,14 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gritano"
8
- s.version = "0.5.1"
8
+ s.version = "0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Igor Bonadio"]
12
- s.date = "2012-12-29"
12
+ s.date = "2013-01-03"
13
13
  s.description = "Gritano is the simplest way to configure your git server over ssh. You can create repositories and manage user access."
14
14
  s.email = "igorbonadio@gmail.com"
15
- s.executables = ["gritano", "gritano-check"]
15
+ s.executables = ["gritano", "gritano-remote"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE.txt",
18
18
  "README.rdoc",
@@ -30,32 +30,12 @@ Gem::Specification.new do |s|
30
30
  "Rakefile",
31
31
  "VERSION",
32
32
  "bin/gritano",
33
- "bin/gritano-check",
33
+ "bin/gritano-remote",
34
34
  "db/migrate/001_create_users.rb",
35
35
  "db/migrate/002_create_repositories.rb",
36
36
  "db/migrate/003_create_permissions.rb",
37
37
  "db/migrate/004_create_keys.rb",
38
38
  "db/migrate/005_add_admin_to_users.rb",
39
- "features/cli.feature",
40
- "features/console.feature",
41
- "features/data/help-check.txt",
42
- "features/data/help-test.txt",
43
- "features/data/help.txt",
44
- "features/data/keys/full_authorized_keys",
45
- "features/data/keys/igorbonadio.pub",
46
- "features/data/keys/igorbonadio_authorized_keys",
47
- "features/data/keys/jessicaeto.pub",
48
- "features/data/keys/jessicaeto_authorized_keys",
49
- "features/help.feature",
50
- "features/keys.feature",
51
- "features/polices.feature",
52
- "features/ssh.feature",
53
- "features/step_definitions/cli_steps.rb",
54
- "features/step_definitions/console_step.rb",
55
- "features/step_definitions/help.rb",
56
- "features/step_definitions/keys_steps.rb",
57
- "features/step_definitions/polices_steps.rb",
58
- "features/step_definitions/ssh_steps.rb",
59
39
  "features/support/database_cleaner.rb",
60
40
  "features/support/env.rb",
61
41
  "gritano.gemspec",
@@ -95,7 +95,7 @@ module Gritano
95
95
  key = user.keys.create(name: key_name, key: @stdin.read)
96
96
  if key.valid?
97
97
  File.open(File.join(@ssh_path, 'authorized_keys'), 'w').write(Key.authorized_keys)
98
- return [true, "Key added successfully."]
98
+ return [true, "Key added successfully."]
99
99
  end
100
100
  end
101
101
  return [false, "Key could not be added."]
@@ -5,6 +5,7 @@ module Gritano
5
5
  def initialize(stdin = STDIN, home_dir = Etc.getpwuid.dir)
6
6
  @home_dir = home_dir
7
7
  @stdin = stdin
8
+ @ssh_path = File.join(@home_dir, '.ssh')
8
9
  super(@stdin, @home_dir)
9
10
  end
10
11
 
@@ -30,7 +31,8 @@ module Gritano
30
31
  ActiveRecord::Migrator.migrate(
31
32
  File.join(File.dirname(__FILE__),'..', '..', '..', 'db/migrate'),
32
33
  ENV["VERSION"] ? ENV["VERSION"].to_i : nil )
33
- [true, "gritano has been installed"]
34
+ File.open(File.join(@ssh_path, 'authorized_keys'), 'w').write(Key.authorized_keys)
35
+ [true, "gritano has been installed"]
34
36
  end
35
37
  end
36
38
  end
@@ -13,7 +13,7 @@ module Gritano
13
13
  unless k.key[-1] == "\n"
14
14
  user_key = user_key + "\n"
15
15
  end
16
- authorized_keys += "command=\"gritano-check #{k.user.login}\" #{user_key}"
16
+ authorized_keys += "command=\"gritano-remote #{k.user.login}\" #{user_key}"
17
17
  end
18
18
  return authorized_keys
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gritano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-29 00:00:00.000000000 Z
12
+ date: 2013-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -192,7 +192,7 @@ description: Gritano is the simplest way to configure your git server over ssh.
192
192
  email: igorbonadio@gmail.com
193
193
  executables:
194
194
  - gritano
195
- - gritano-check
195
+ - gritano-remote
196
196
  extensions: []
197
197
  extra_rdoc_files:
198
198
  - LICENSE.txt
@@ -210,32 +210,12 @@ files:
210
210
  - Rakefile
211
211
  - VERSION
212
212
  - bin/gritano
213
- - bin/gritano-check
213
+ - bin/gritano-remote
214
214
  - db/migrate/001_create_users.rb
215
215
  - db/migrate/002_create_repositories.rb
216
216
  - db/migrate/003_create_permissions.rb
217
217
  - db/migrate/004_create_keys.rb
218
218
  - db/migrate/005_add_admin_to_users.rb
219
- - features/cli.feature
220
- - features/console.feature
221
- - features/data/help-check.txt
222
- - features/data/help-test.txt
223
- - features/data/help.txt
224
- - features/data/keys/full_authorized_keys
225
- - features/data/keys/igorbonadio.pub
226
- - features/data/keys/igorbonadio_authorized_keys
227
- - features/data/keys/jessicaeto.pub
228
- - features/data/keys/jessicaeto_authorized_keys
229
- - features/help.feature
230
- - features/keys.feature
231
- - features/polices.feature
232
- - features/ssh.feature
233
- - features/step_definitions/cli_steps.rb
234
- - features/step_definitions/console_step.rb
235
- - features/step_definitions/help.rb
236
- - features/step_definitions/keys_steps.rb
237
- - features/step_definitions/polices_steps.rb
238
- - features/step_definitions/ssh_steps.rb
239
219
  - features/support/database_cleaner.rb
240
220
  - features/support/env.rb
241
221
  - gritano.gemspec
@@ -275,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
275
255
  version: '0'
276
256
  segments:
277
257
  - 0
278
- hash: 3374500696150512185
258
+ hash: 4484062896934626166
279
259
  required_rubygems_version: !ruby/object:Gem::Requirement
280
260
  none: false
281
261
  requirements:
data/features/cli.feature DELETED
@@ -1,183 +0,0 @@
1
- Feature: Console operations
2
- In order to use gritano via CLI
3
- As a user
4
- I want to execute some commands
5
-
6
- Background:
7
- Given the following users exist:
8
- | login | admin |
9
- | igorbonadio | true |
10
- | jessicaeto | false |
11
-
12
- And the following keys exist:
13
- | login | key |
14
- | igorbonadio | eva |
15
- | jessicaeto | hal |
16
-
17
- And the following repositories exist:
18
- | name |
19
- | tmp/gritano.git |
20
- | tmp/jeka.git |
21
-
22
- And the following permissions exist:
23
- | user | repo | access |
24
- | igorbonadio | tmp/gritano.git | read |
25
- | igorbonadio | tmp/gritano.git | write |
26
- | igorbonadio | tmp/jeka.git | read |
27
- | jessicaeto | tmp/jeka.git | read |
28
- | jessicaeto | tmp/jeka.git | write |
29
-
30
- Scenario: Git read access
31
- Given I start the CLI with "igorbonadio"
32
- When I try to get tmp/gritano.git from CLI.check
33
- Then I should get it
34
-
35
- Scenario: Git write access
36
- Given I start the CLI with "igorbonadio"
37
- When I try to send data to tmp/gritano.git from CLI.check
38
- Then I should send it
39
-
40
- Scenario: Error
41
- Given I start the CLI with "igorbonadio"
42
- When I try to send an invalid command to CLI.check
43
- Then CLI should return the help-check
44
-
45
- Scenario: Get help
46
- Given I start the CLI
47
- When I send "help" to the CLI.execute
48
- Then CLI should return the help
49
-
50
- Scenario: Check git
51
- Given I start the CLI but gritano is not installed
52
- When I send a command to the CLI.execute
53
- Then CLI should exit
54
-
55
- Scenario Outline: Add user
56
- Given I start the CLI
57
- When I send "<command>" to the CLI.execute
58
- Then CLI should return "<result>"
59
- Examples:
60
- | command | result |
61
- | version | v0.5.0 |
62
- | user:add jose | User jose added. |
63
- | user:key:add igorbonadio marvin | Key added successfully. |
64
- | user:key:rm igorbonadio eva | Key removed successfully. |
65
- | user:rm igorbonadio | User igorbonadio removed. |
66
- | user:admin:add igorbonadio | Now, user igorbonadio is an administrator |
67
- | user:admin:rm igorbonadio | Now, user igorbonadio is not an administrator |
68
- | repo:add tmp/p-lang.git | Repository tmp/p-lang.git created successfully. |
69
- | repo:add tmp/p-lang.git igorbonadio | Repository tmp/p-lang.git created successfully. |
70
- | repo:add tmp/p-lang.git igorbonadio jessicaeto | Repository tmp/p-lang.git created successfully. |
71
- | repo:rm tmp/jeka.git | Repository tmp/jeka.git removed successfully. |
72
- | repo:read:add tmp/gritano.git jessicaeto | User jessicaeto has read access to tmp/gritano.git. |
73
- | repo:write:add tmp/gritano.git jessicaeto | User jessicaeto has write access to tmp/gritano.git. |
74
- | repo:read:rm tmp/jeka.git igorbonadio | User igorbonadio has not read access to tmp/jeka.git. |
75
- | repo:write:rm tmp/gritano.git igorbonadio | User igorbonadio has not write access to tmp/gritano.git. |
76
- | user:add igorbonadio | error: Login has already been taken. |
77
- | user:rm jose | error: User jose could not be removed. |
78
- | user:key:add userrr marvino | error: Key could not be added. |
79
- | user:key:rm igorbonadio marvino | error: Key could not be removed. |
80
- | user:key:list arybonadio | error: User arybonadio is not registered |
81
- | user:repo:list arybonadio | error: User arybonadio is not registered |
82
- | user:admin:add arybonadio | error: User arybonadio could not be modified |
83
- | user:admin:rm arybonadio | error: User arybonadio could not be modified |
84
- | repo:add tmp/jeka.git | error: Repository tmp/jeka.git could not be created. |
85
- | repo:rm tmp/p-lang.git | error: Repository tmp/p-lang.git could not be removed. |
86
- | repo:read:add tmp/gritano.git arybonadio | error: An error occurred. Permissions was not modified. |
87
- | repo:read:add tmp/p-lang.git jessicaeto | error: An error occurred. Permissions was not modified. |
88
- | repo:write:add tmp/gritano.git arybonadio | error: An error occurred. Permissions was not modified. |
89
- | repo:write:add tmp/p-lang.git jessicaeto | error: An error occurred. Permissions was not modified. |
90
- | repo:read:rm tmp/jeka.git aribonadio | error: An error occurred. Permissions was not modified. |
91
- | repo:read:rm tmp/p-lang.git igorbonadio | error: An error occurred. Permissions was not modified. |
92
- | repo:write:rm tmp/gritano.git arybonadio | error: An error occurred. Permissions was not modified. |
93
- | repo:write:rm tmp/p-lang.git igorbonadio | error: An error occurred. Permissions was not modified. |
94
- | repo:user:list tmp/ruby.git | error: Repository tmp/ruby.git doesn't exist. |
95
-
96
- Scenario Outline: Admin via ssh
97
- Given I start the CLI with "igorbonadio"
98
- When I send "<command>" to the CLI.check
99
- Then CLI should return "<result>"
100
- Examples:
101
- | command | result |
102
- | version | v0.5.0 |
103
- | key:add keyname | Key added successfully. |
104
- | key:rm eva | Key removed successfully. |
105
- | key:rm keyname | error: Key could not be removed. |
106
- | admin:user:add jose | User jose added. |
107
- | admin:user:key:add igorbonadio marvin | Key added successfully. |
108
- | admin:user:key:rm igorbonadio eva | Key removed successfully. |
109
- | admin:user:rm igorbonadio | User igorbonadio removed. |
110
- | admin:user:admin:add igorbonadio | Now, user igorbonadio is an administrator |
111
- | admin:user:admin:rm igorbonadio | Now, user igorbonadio is not an administrator |
112
- | admin:repo:add tmp/p-lang.git | Repository tmp/p-lang.git created successfully. |
113
- | admin:repo:add tmp/p-lang.git igorbonadio | Repository tmp/p-lang.git created successfully. |
114
- | admin:repo:add tmp/p-lang.git igorbonadio jessicaeto | Repository tmp/p-lang.git created successfully. |
115
- | admin:repo:rm tmp/jeka.git | Repository tmp/jeka.git removed successfully. |
116
- | admin:repo:read:add tmp/gritano.git jessicaeto | User jessicaeto has read access to tmp/gritano.git. |
117
- | admin:repo:write:add tmp/gritano.git jessicaeto | User jessicaeto has write access to tmp/gritano.git. |
118
- | admin:repo:read:rm tmp/jeka.git igorbonadio | User igorbonadio has not read access to tmp/jeka.git. |
119
- | admin:repo:write:rm tmp/gritano.git igorbonadio | User igorbonadio has not write access to tmp/gritano.git. |
120
- | admin:user:add igorbonadio | error: Login has already been taken. |
121
- | admin:user:rm jose | error: User jose could not be removed. |
122
- | admin:user:key:add userrr marvino | error: Key could not be added. |
123
- | admin:user:key:rm igorbonadio marvino | error: Key could not be removed. |
124
- | admin:user:key:list arybonadio | error: User arybonadio is not registered |
125
- | admin:user:repo:list arybonadio | error: User arybonadio is not registered |
126
- | admin:user:admin:add arybonadio | error: User arybonadio could not be modified |
127
- | admin:user:admin:rm arybonadio | error: User arybonadio could not be modified |
128
- | admin:repo:add tmp/jeka.git | error: Repository tmp/jeka.git could not be created. |
129
- | admin:repo:rm tmp/p-lang.git | error: Repository tmp/p-lang.git could not be removed. |
130
- | admin:repo:read:add tmp/gritano.git arybonadio | error: An error occurred. Permissions was not modified. |
131
- | admin:repo:read:add tmp/p-lang.git jessicaeto | error: An error occurred. Permissions was not modified. |
132
- | admin:repo:write:add tmp/gritano.git arybonadio | error: An error occurred. Permissions was not modified. |
133
- | admin:repo:write:add tmp/p-lang.git jessicaeto | error: An error occurred. Permissions was not modified. |
134
- | admin:repo:read:rm tmp/jeka.git aribonadio | error: An error occurred. Permissions was not modified. |
135
- | admin:repo:read:rm tmp/p-lang.git igorbonadio | error: An error occurred. Permissions was not modified. |
136
- | admin:repo:write:rm tmp/gritano.git arybonadio | error: An error occurred. Permissions was not modified. |
137
- | admin:repo:write:rm tmp/p-lang.git igorbonadio | error: An error occurred. Permissions was not modified. |
138
- | admin:repo:user:list tmp/ruby.git | error: Repository tmp/ruby.git doesn't exist. |
139
-
140
- Scenario Outline: Normal user via ssh
141
- Given I start the CLI with "jessicaeto"
142
- When I send "<command>" to the CLI.check
143
- Then CLI should return "<result>"
144
- Examples:
145
- | command | result |
146
- | version | v0.5.0 |
147
- | key:add keyname | Key added successfully. |
148
- | key:rm hal | Key removed successfully. |
149
- | key:rm keyname | error: Key could not be removed. |
150
- | admin:user:add jose | error: access denied |
151
- | admin:user:key:add igorbonadio marvin | error: access denied |
152
- | admin:user:key:rm igorbonadio eva | error: access denied |
153
- | admin:user:rm igorbonadio | error: access denied |
154
- | admin:user:admin:add igorbonadio | error: access denied |
155
- | admin:user:admin:rm igorbonadio | error: access denied |
156
- | admin:repo:add tmp/p-lang.git | error: access denied |
157
- | admin:repo:add tmp/p-lang.git igorbonadio | error: access denied |
158
- | admin:repo:add tmp/p-lang.git igorbonadio jessicaeto | error: access denied |
159
- | admin:repo:rm tmp/jeka.git | error: access denied |
160
- | admin:repo:read:add tmp/gritano.git jessicaeto | error: access denied |
161
- | admin:repo:write:add tmp/gritano.git jessicaeto | error: access denied |
162
- | admin:repo:read:rm tmp/jeka.git igorbonadio | error: access denied |
163
- | admin:repo:write:rm tmp/gritano.git igorbonadio | error: access denied |
164
- | admin:user:add igorbonadio | error: access denied |
165
- | admin:user:rm jose | error: access denied |
166
- | admin:user:key:add userrr marvino | error: access denied |
167
- | admin:user:key:rm igorbonadio marvino | error: access denied |
168
- | admin:user:key:list arybonadio | error: access denied |
169
- | admin:user:repo:list arybonadio | error: access denied |
170
- | admin:user:admin:add arybonadio | error: access denied |
171
- | admin:user:admin:rm arybonadio | error: access denied |
172
- | admin:repo:add tmp/jeka.git | error: access denied |
173
- | admin:repo:rm tmp/p-lang.git | error: access denied |
174
- | admin:repo:read:add tmp/gritano.git arybonadio | error: access denied |
175
- | admin:repo:read:add tmp/p-lang.git jessicaeto | error: access denied |
176
- | admin:repo:write:add tmp/gritano.git arybonadio | error: access denied |
177
- | admin:repo:write:add tmp/p-lang.git jessicaeto | error: access denied |
178
- | admin:repo:read:rm tmp/jeka.git aribonadio | error: access denied |
179
- | admin:repo:read:rm tmp/p-lang.git igorbonadio | error: access denied |
180
- | admin:repo:write:rm tmp/gritano.git arybonadio | error: access denied |
181
- | admin:repo:write:rm tmp/p-lang.git igorbonadio | error: access denied |
182
- | admin:repo:user:list tmp/ruby.git | error: access denied |
183
-
@@ -1,89 +0,0 @@
1
- Feature: Console operations
2
- In order to use gritano via console
3
- As a user
4
- I want to execute some commands
5
-
6
- Background:
7
- Given the following users exist:
8
- | login | admin |
9
- | igorbonadio | true |
10
- | jessicaeto | false |
11
-
12
- And the following keys exist:
13
- | login | key |
14
- | igorbonadio | eva |
15
- | jessicaeto | hal |
16
-
17
- And the following repositories exist:
18
- | name |
19
- | tmp/gritano.git |
20
- | tmp/jeka.git |
21
-
22
- And the following permissions exist:
23
- | user | repo | access |
24
- | igorbonadio | tmp/gritano.git | read |
25
- | igorbonadio | tmp/gritano.git | write |
26
- | igorbonadio | tmp/jeka.git | read |
27
- | jessicaeto | tmp/jeka.git | read |
28
- | jessicaeto | tmp/jeka.git | write |
29
-
30
- Scenario: Get help
31
- Given I start the gritano console
32
- When I execute "help"
33
- Then I should see the help
34
-
35
- Scenario: Check git
36
- Given I start the gritano console but gritano is not installed
37
- When I execute a command
38
- Then I should see an error
39
-
40
- Scenario: Install
41
- Given I start the gritano console but gritano is not installed
42
- When I install it
43
- Then I should see a success message
44
-
45
- Scenario Outline: Add user
46
- Given I start the gritano console
47
- When I execute "<command>"
48
- Then I should see a <result> message
49
- Examples:
50
- | command | result |
51
- | version | success |
52
- | user:add jose | success |
53
- | user:key:add igorbonadio marvin | success |
54
- | user:key:rm igorbonadio eva | success |
55
- | user:rm igorbonadio | success |
56
- | user:list | success |
57
- | user:key:list igorbonadio | success |
58
- | user:repo:list igorbonadio | success |
59
- | user:admin:add igorbonadio | success |
60
- | user:admin:rm igorbonadio | success |
61
- | repo:add tmp/p-lang.git | success |
62
- | repo:add tmp/p-lang.git igorbonadio | success |
63
- | repo:add tmp/p-lang.git igorbonadio jessicaeto | success |
64
- | repo:rm tmp/jeka.git | success |
65
- | repo:read:add tmp/gritano.git jessicaeto | success |
66
- | repo:write:add tmp/gritano.git jessicaeto | success |
67
- | repo:read:rm tmp/jeka.git igorbonadio | success |
68
- | repo:write:rm tmp/gritano.git igorbonadio | success |
69
- | repo:list | success |
70
- | repo:user:list tmp/jeka.git | success |
71
- | user:add igorbonadio | error |
72
- | user:rm jose | error |
73
- | user:key:add userrr marvino | error |
74
- | user:key:rm igorbonadio marvino | error |
75
- | user:key:list arybonadio | error |
76
- | user:repo:list arybonadio | error |
77
- | user:admin:add arybonadio | error |
78
- | user:admin:rm arybonadio | error |
79
- | repo:add tmp/jeka.git | error |
80
- | repo:rm tmp/p-lang.git | error |
81
- | repo:read:add tmp/gritano.git arybonadio | error |
82
- | repo:read:add tmp/p-lang.git jessicaeto | error |
83
- | repo:write:add tmp/gritano.git arybonadio | error |
84
- | repo:write:add tmp/p-lang.git jessicaeto | error |
85
- | repo:read:rm tmp/jeka.git aribonadio | error |
86
- | repo:read:rm tmp/p-lang.git igorbonadio | error |
87
- | repo:write:rm tmp/gritano.git arybonadio | error |
88
- | repo:write:rm tmp/p-lang.git igorbonadio | error |
89
- | repo:user:list tmp/ruby.git | error |
@@ -1,13 +0,0 @@
1
- ssh git@host.com [command]
2
-
3
- Examples:
4
- ssh git@host.com version
5
- ssh git@host.com help
6
- ssh git@host.com repo:list
7
- ssh git@host.com key:list
8
- ssh git@host.com key:add keyname < key.pub
9
- ssh git@host.com key:rm keyname
10
- ssh git@host.com admin:help
11
-
12
- --
13
- v0.5.0
@@ -1,27 +0,0 @@
1
- test [command]
2
-
3
- Examples:
4
- test help
5
- test version
6
- test setup:prepare
7
- test setup:install
8
- test user:list
9
- test user:key:list username
10
- test user:repo:list username
11
- test user:add username
12
- test user:rm username
13
- test user:key:add username keyname < key.pub
14
- test user:key:rm username keyname
15
- test user:admin:add username
16
- test user:admin:rm username
17
- test repo:list
18
- test repo:add reponame.git [username1 username2 ...]*
19
- test repo:user:list reponame.git
20
- test repo:rm reponame.git
21
- test repo:read:add reponame.git username
22
- test repo:write:add reponame.git username
23
- test repo:read:rm reponame.git username
24
- test repo:write:rm reponame.git username
25
-
26
- --
27
- v0.5.0
@@ -1,27 +0,0 @@
1
- gritano [command]
2
-
3
- Examples:
4
- gritano help
5
- gritano version
6
- gritano setup:prepare
7
- gritano setup:install
8
- gritano user:list
9
- gritano user:key:list username
10
- gritano user:repo:list username
11
- gritano user:add username
12
- gritano user:rm username
13
- gritano user:key:add username keyname < key.pub
14
- gritano user:key:rm username keyname
15
- gritano user:admin:add username
16
- gritano user:admin:rm username
17
- gritano repo:list
18
- gritano repo:add reponame.git [username1 username2 ...]*
19
- gritano repo:user:list reponame.git
20
- gritano repo:rm reponame.git
21
- gritano repo:read:add reponame.git username
22
- gritano repo:write:add reponame.git username
23
- gritano repo:read:rm reponame.git username
24
- gritano repo:write:rm reponame.git username
25
-
26
- --
27
- v0.5.0
@@ -1,2 +0,0 @@
1
- command="gritano-check igorbonadio" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFW6Du1iXTyo44g+7R4DNgm4P1fQIiW/iGRFwHJTV1jaPX74VwNq7tC1kBSdPS4+Q9f24wJC1MhWzLxB40BFdqn519JhhV+/1IWZdY/UJ0D5KiUw38U7QPzMM2uA0l0JeB+FwZAl/Oiu/ty3Fq0JsuqsolehIbRRLeiJiwrn1XC5LdhA81b2WBzM8SSFgAaXPimuLBXYJyYrcTR5SXczZvgkWojQEvk7wCavvDzFpy/DtXUFv0ZwUJILhN23cW3mg1IsGMXg7hOQfp67J6cX212YYXhDe+5sI3UpFWKCHcyxv3EdL8rQ/3DLSELkTwWHPRqDhn1wnPmfJlj8ZfbpyX git2@debian-ror
2
- command="gritano-check jessicaeto" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ4WqIu8XwnHwBz220/1Kbgi1IR7aanq8hW1dB0LD2dmCSyojBvduoht4p7+3k2R6A5y2DZvTetzEios9OFUnCC+4U8g2GTc+zGM0W+msCb6yWnpfYaIwHVuFtsid7lyWOCEYLi2WbNZxfAx0PbwIcHMoYWc9sil3R/YwLGorvQDGH0rFcf6BOMzVMDRD0yPvuN3xgAtBOxrSRl0U4dH+3fAQ9oKLePmouzLrrKvRmyVwl/rHNod8ae5VmmAalC+wXIsiQAI92Hwew757HzhY45wWtjOsdBBf45Psv7BkB1OqGxMfwysO5iwhY3HPTJs70K22K2DARpejFq8Bd8PyV git2@debian-ror
@@ -1 +0,0 @@
1
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFW6Du1iXTyo44g+7R4DNgm4P1fQIiW/iGRFwHJTV1jaPX74VwNq7tC1kBSdPS4+Q9f24wJC1MhWzLxB40BFdqn519JhhV+/1IWZdY/UJ0D5KiUw38U7QPzMM2uA0l0JeB+FwZAl/Oiu/ty3Fq0JsuqsolehIbRRLeiJiwrn1XC5LdhA81b2WBzM8SSFgAaXPimuLBXYJyYrcTR5SXczZvgkWojQEvk7wCavvDzFpy/DtXUFv0ZwUJILhN23cW3mg1IsGMXg7hOQfp67J6cX212YYXhDe+5sI3UpFWKCHcyxv3EdL8rQ/3DLSELkTwWHPRqDhn1wnPmfJlj8ZfbpyX git2@debian-ror
@@ -1 +0,0 @@
1
- command="gritano-check igorbonadio" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFW6Du1iXTyo44g+7R4DNgm4P1fQIiW/iGRFwHJTV1jaPX74VwNq7tC1kBSdPS4+Q9f24wJC1MhWzLxB40BFdqn519JhhV+/1IWZdY/UJ0D5KiUw38U7QPzMM2uA0l0JeB+FwZAl/Oiu/ty3Fq0JsuqsolehIbRRLeiJiwrn1XC5LdhA81b2WBzM8SSFgAaXPimuLBXYJyYrcTR5SXczZvgkWojQEvk7wCavvDzFpy/DtXUFv0ZwUJILhN23cW3mg1IsGMXg7hOQfp67J6cX212YYXhDe+5sI3UpFWKCHcyxv3EdL8rQ/3DLSELkTwWHPRqDhn1wnPmfJlj8ZfbpyX git2@debian-ror
@@ -1 +0,0 @@
1
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ4WqIu8XwnHwBz220/1Kbgi1IR7aanq8hW1dB0LD2dmCSyojBvduoht4p7+3k2R6A5y2DZvTetzEios9OFUnCC+4U8g2GTc+zGM0W+msCb6yWnpfYaIwHVuFtsid7lyWOCEYLi2WbNZxfAx0PbwIcHMoYWc9sil3R/YwLGorvQDGH0rFcf6BOMzVMDRD0yPvuN3xgAtBOxrSRl0U4dH+3fAQ9oKLePmouzLrrKvRmyVwl/rHNod8ae5VmmAalC+wXIsiQAI92Hwew757HzhY45wWtjOsdBBf45Psv7BkB1OqGxMfwysO5iwhY3HPTJs70K22K2DARpejFq8Bd8PyV git2@debian-ror
@@ -1 +0,0 @@
1
- command="gritano-check jessicaeto" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ4WqIu8XwnHwBz220/1Kbgi1IR7aanq8hW1dB0LD2dmCSyojBvduoht4p7+3k2R6A5y2DZvTetzEios9OFUnCC+4U8g2GTc+zGM0W+msCb6yWnpfYaIwHVuFtsid7lyWOCEYLi2WbNZxfAx0PbwIcHMoYWc9sil3R/YwLGorvQDGH0rFcf6BOMzVMDRD0yPvuN3xgAtBOxrSRl0U4dH+3fAQ9oKLePmouzLrrKvRmyVwl/rHNod8ae5VmmAalC+wXIsiQAI92Hwew757HzhY45wWtjOsdBBf45Psv7BkB1OqGxMfwysO5iwhY3HPTJs70K22K2DARpejFq8Bd8PyV git2@debian-ror
@@ -1,9 +0,0 @@
1
- Feature: Console operations
2
- In order to kwon how to use gritano
3
- As a user
4
- I want to see the help
5
-
6
- Scenario: Get help
7
- When I set bin_name to test
8
- Then gritano should show help-test
9
-
@@ -1,31 +0,0 @@
1
- Feature: Keys
2
- In Order to restrict access to repositories
3
- As Gritano
4
- I want to manage user's keys
5
-
6
- Background:
7
- Given the following users exist:
8
- | login |
9
- | igorbonadio |
10
- | jessicaeto |
11
-
12
- Scenario Outline: Add user key
13
- Given I add "<key>" key to "<user>"
14
- When I generate the authorized_keys
15
- Then I should see "<authorized_keys>" authorized_keys
16
- Examples:
17
- | user | key | authorized_keys |
18
- | igorbonadio | igorbonadio.pub | igorbonadio_authorized_keys |
19
- | jessicaeto | jessicaeto.pub | jessicaeto_authorized_keys |
20
-
21
- Scenario: Generate autorized_keys
22
- Given I add "igorbonadio.pub" key to "igorbonadio"
23
- And I add "jessicaeto.pub" key to "jessicaeto"
24
- When I generate the authorized_keys
25
- Then I should see "full_authorized_keys" authorized_keys
26
-
27
- Scenario: Duplicated keys
28
- Given I add "igorbonadio.pub" key to "igorbonadio"
29
- When I add "igorbonadio.pub" key to "igorbonadio"
30
- Then I should see that "igorbonadio" has only one key
31
-
@@ -1,55 +0,0 @@
1
- Feature: Policies
2
- In order to restrict access to repositories
3
- As Gritano
4
- I want to create policies
5
-
6
- Background:
7
- Given the following users exist:
8
- | login |
9
- | igorbonadio |
10
- | jessicaeto |
11
-
12
- And the following repositories exist:
13
- | name |
14
- | tmp/gritano.git |
15
- | tmp/jeka.git |
16
-
17
- And the following permissions exist:
18
- | user | repo | access |
19
- | igorbonadio | tmp/gritano.git | read |
20
- | igorbonadio | tmp/gritano.git | write |
21
- | igorbonadio | tmp/jeka.git | read |
22
- | jessicaeto | tmp/jeka.git | read |
23
- | jessicaeto | tmp/jeka.git | write |
24
-
25
- Scenario Outline: Create a new user
26
- Given I create a new user called "<user>"
27
- When I check if "<user>" has <access> access to "<repo>"
28
- Then I should see that the access is <result>
29
- Examples:
30
- | user | access | repo | result |
31
- | arybonadio | read | tmp/gritano.git | denied |
32
- | arybonadio | write | tmp/gritano.git | denied |
33
-
34
- Scenario Outline: Create a new repository
35
- Given I create a new repository called "<repo>" to "<user>"
36
- Then I should see that only "<user>" has access to "<repo>"
37
- Examples:
38
- | user | repo |
39
- | igorbonadio | tmp/p-lang.git |
40
- | jessicaeto | tmp/pabel.git |
41
-
42
- Scenario Outline: Edit access permission
43
- Given I <op> "<user>" <permission> access to "<repo>"
44
- When I check if "<user>" has <access> access to "<repo>"
45
- Then I should see that the access is <result>
46
- Examples:
47
- | op | user | permission | repo | access | result |
48
- | add | igorbonadio | read | tmp/jeka.git | read | allowed |
49
- | add | igorbonadio | read | tmp/jeka.git | write | denied |
50
- | add | igorbonadio | write | tmp/jeka.git | read | allowed |
51
- | add | igorbonadio | write | tmp/jeka.git | write | allowed |
52
- | remove | jessicaeto | read | tmp/jeka.git | read | denied |
53
- | remove | jessicaeto | read | tmp/jeka.git | write | allowed |
54
- | remove | jessicaeto | write | tmp/jeka.git | read | allowed |
55
- | remove | jessicaeto | write | tmp/jeka.git | write | denied |
data/features/ssh.feature DELETED
@@ -1,150 +0,0 @@
1
- Feature: SSH operations
2
- In order to use gritano via ssh
3
- As a user
4
- I want to execute some commands
5
-
6
- Background:
7
- Given the following users exist:
8
- | login | admin |
9
- | igorbonadio | true |
10
- | jessicaeto | false |
11
-
12
- And the following keys exist:
13
- | login | key |
14
- | igorbonadio | eva |
15
- | jessicaeto | hal |
16
-
17
- And the following repositories exist:
18
- | name |
19
- | tmp/gritano.git |
20
- | tmp/jeka.git |
21
-
22
- And the following permissions exist:
23
- | user | repo | access |
24
- | igorbonadio | tmp/gritano.git | read |
25
- | igorbonadio | tmp/gritano.git | write |
26
- | igorbonadio | tmp/jeka.git | read |
27
- | jessicaeto | tmp/jeka.git | read |
28
- | jessicaeto | tmp/jeka.git | write |
29
-
30
- Scenario: Git read access
31
- Given I start the gritano-check console with "igorbonadio"
32
- When I try to get tmp/gritano.git
33
- Then I should get it
34
-
35
- Scenario: Git write access
36
- Given I start the gritano-check console with "igorbonadio"
37
- When I try to send data to tmp/gritano.git
38
- Then I should send it
39
-
40
- Scenario: Error
41
- Given I start the gritano-check console with "igorbonadio"
42
- When I try to send an invalid command
43
- Then I should see an exception
44
-
45
- Scenario Outline: Admin via ssh
46
- Given I start the gritano-check console with "igorbonadio"
47
- When I execute "<command>" via ssh
48
- Then I should see a <result> message
49
- Examples:
50
- | command | result |
51
- | version | success |
52
- | help | success |
53
- | repo:list | success |
54
- | key:list | success |
55
- | key:add keyname | success |
56
- | key:rm eva | success |
57
- | admin:help | success |
58
- | key:rm keyname | error |
59
- | admin:user:add jose | success |
60
- | admin:user:key:add igorbonadio marvin | success |
61
- | admin:user:key:rm igorbonadio eva | success |
62
- | admin:user:rm igorbonadio | success |
63
- | admin:user:list | success |
64
- | admin:user:key:list igorbonadio | success |
65
- | admin:user:repo:list igorbonadio | success |
66
- | admin:user:admin:add igorbonadio | success |
67
- | admin:user:admin:rm igorbonadio | success |
68
- | admin:repo:add tmp/p-lang.git | success |
69
- | admin:repo:add tmp/p-lang.git igorbonadio | success |
70
- | admin:repo:add tmp/p-lang.git igorbonadio jessicaeto | success |
71
- | admin:repo:rm tmp/jeka.git | success |
72
- | admin:repo:read:add tmp/gritano.git jessicaeto | success |
73
- | admin:repo:write:add tmp/gritano.git jessicaeto | success |
74
- | admin:repo:read:rm tmp/jeka.git igorbonadio | success |
75
- | admin:repo:write:rm tmp/gritano.git igorbonadio | success |
76
- | admin:repo:list | success |
77
- | admin:repo:user:list tmp/jeka.git | success |
78
- | admin:user:add igorbonadio | error |
79
- | admin:user:rm jose | error |
80
- | admin:user:key:add userrr marvino | error |
81
- | admin:user:key:rm igorbonadio marvino | error |
82
- | admin:user:key:list arybonadio | error |
83
- | admin:user:repo:list arybonadio | error |
84
- | admin:user:admin:add arybonadio | error |
85
- | admin:user:admin:rm arybonadio | error |
86
- | admin:repo:add tmp/jeka.git | error |
87
- | admin:repo:rm tmp/p-lang.git | error |
88
- | admin:repo:read:add tmp/gritano.git arybonadio | error |
89
- | admin:repo:read:add tmp/p-lang.git jessicaeto | error |
90
- | admin:repo:write:add tmp/gritano.git arybonadio | error |
91
- | admin:repo:write:add tmp/p-lang.git jessicaeto | error |
92
- | admin:repo:read:rm tmp/jeka.git aribonadio | error |
93
- | admin:repo:read:rm tmp/p-lang.git igorbonadio | error |
94
- | admin:repo:write:rm tmp/gritano.git arybonadio | error |
95
- | admin:repo:write:rm tmp/p-lang.git igorbonadio | error |
96
- | admin:repo:user:list tmp/ruby.git | error |
97
-
98
- Scenario Outline: Normal user via ssh
99
- Given I start the gritano-check console with "jessicaeto"
100
- When I execute "<command>" via ssh
101
- Then I should see a <result> message
102
- Examples:
103
- | command | result |
104
- | version | success |
105
- | help | success |
106
- | repo:list | success |
107
- | key:list | success |
108
- | key:add keyname | success |
109
- | key:rm hal | success |
110
- | admin:help | success |
111
- | key:rm keyname | error |
112
- | admin:user:add jose | error |
113
- | admin:user:key:add igorbonadio marvin | error |
114
- | admin:user:key:rm igorbonadio eva | error |
115
- | admin:user:rm igorbonadio | error |
116
- | admin:user:list | error |
117
- | admin:user:key:list igorbonadio | error |
118
- | admin:user:repo:list igorbonadio | error |
119
- | admin:user:admin:add igorbonadio | error |
120
- | admin:user:admin:rm igorbonadio | error |
121
- | admin:repo:add tmp/p-lang.git | error |
122
- | admin:repo:add tmp/p-lang.git igorbonadio | error |
123
- | admin:repo:add tmp/p-lang.git igorbonadio jessicaeto | error |
124
- | admin:repo:rm tmp/jeka.git | error |
125
- | admin:repo:read:add tmp/gritano.git jessicaeto | error |
126
- | admin:repo:write:add tmp/gritano.git jessicaeto | error |
127
- | admin:repo:read:rm tmp/jeka.git igorbonadio | error |
128
- | admin:repo:write:rm tmp/gritano.git igorbonadio | error |
129
- | admin:repo:list | error |
130
- | admin:repo:user:list tmp/jeka.git | error |
131
- | admin:user:add igorbonadio | error |
132
- | admin:user:rm jose | error |
133
- | admin:user:key:add userrr marvino | error |
134
- | admin:user:key:rm igorbonadio marvino | error |
135
- | admin:user:key:list arybonadio | error |
136
- | admin:user:repo:list arybonadio | error |
137
- | admin:user:admin:add arybonadio | error |
138
- | admin:user:admin:rm arybonadio | error |
139
- | admin:repo:add tmp/jeka.git | error |
140
- | admin:repo:rm tmp/p-lang.git | error |
141
- | admin:repo:read:add tmp/gritano.git arybonadio | error |
142
- | admin:repo:read:add tmp/p-lang.git jessicaeto | error |
143
- | admin:repo:write:add tmp/gritano.git arybonadio | error |
144
- | admin:repo:write:add tmp/p-lang.git jessicaeto | error |
145
- | admin:repo:read:rm tmp/jeka.git aribonadio | error |
146
- | admin:repo:read:rm tmp/p-lang.git igorbonadio | error |
147
- | admin:repo:write:rm tmp/gritano.git arybonadio | error |
148
- | admin:repo:write:rm tmp/p-lang.git igorbonadio | error |
149
- | admin:repo:user:list tmp/ruby.git | error |
150
-
@@ -1,71 +0,0 @@
1
- Given /^I start the CLI$/ do
2
- @cli = Gritano::CLI
3
- @home_dir = '.'
4
- @repo_dir = 'tmp'
5
- @stdin = double()
6
- @stdin.stub(:read).and_return("Your SSHKEY here...")
7
- end
8
-
9
- When /^I send "(.*?)" to the CLI\.execute$/ do |cmd|
10
- @output = @cli.execute(cmd.split(' '), @stdin, @home_dir, @repo_dir)
11
- end
12
-
13
- When /^I send "(.*?)" to the CLI\.check$/ do |cmd|
14
- @output = @cli.check(cmd.split(' '), @login, @stdin, @home_dir, @repo_dir)
15
- end
16
-
17
-
18
- Then /^CLI should return the help$/ do
19
- help = File.open("features/data/help.txt").readlines.join[0..-2]
20
- @output.should be == help
21
- end
22
-
23
- Then /^CLI should return the help\-check$/ do
24
- help = File.open("features/data/help-check.txt").readlines.join[0..-2]
25
- @output.should be == help
26
- end
27
-
28
- Given /^I start the CLI but gritano is not installed$/ do
29
- @cli = Gritano::CLI
30
- @home_dir = 'tmp'
31
- @repo_dir = 'tmp'
32
- @stdin = double()
33
- @stdin.stub(:read).and_return("Your SSHKEY here...")
34
- end
35
-
36
- Given /^I start the CLI with "(.*?)"$/ do |login|
37
- @cli = Gritano::CLI
38
- @home_dir = '.'
39
- @repo_dir = 'tmp'
40
- @stdin = double()
41
- @stdin.stub(:read).and_return("Your SSHKEY here...")
42
- @login = login
43
- end
44
-
45
- Then /^CLI should exit$/ do
46
- lambda {@cli.execute(@cmd, @stdin, @home_dir, @repo_dir)}.should raise_error SystemExit
47
- end
48
-
49
- When /^I send a command to the CLI\.execute$/ do
50
- @cmd = ["user:list"]
51
- end
52
-
53
- Then /^CLI should return "(.*?)"$/ do |msg|
54
- @output.should be == msg
55
- end
56
-
57
- When /^I try to get tmp\/gritano\.git from CLI\.check$/ do
58
- Kernel.should_receive(:exec)
59
- @cli.check(['git-receive-pack', 'tmp/gritano.git'], @login, @stdin, @home_dir, @repo_dir)
60
- end
61
-
62
- When /^I try to send data to tmp\/gritano\.git from CLI\.check$/ do
63
- Kernel.should_receive(:exec)
64
- @cli.check(['git-upload-pack', 'tmp/gritano.git'], @login, @stdin, @home_dir, @repo_dir)
65
- end
66
-
67
- When /^I try to send an invalid command to CLI\.check$/ do
68
- @output = @cli.check(['error:error'], @login, @stdin, @home_dir, @repo_dir)
69
- end
70
-
71
-
@@ -1,41 +0,0 @@
1
- Given /^I start the gritano console$/ do
2
- stdin = double()
3
- stdin.stub(:read).and_return("Your SSHKEY here...")
4
- @console = Gritano::Console::Gritano.new(stdin, '.', 'tmp')
5
- end
6
-
7
- When /^I execute "(.*?)"$/ do |command|
8
- @output = @console.execute(command.split(' '))
9
- end
10
-
11
- Then /^I should see a (success|error) message$/ do |result|
12
- expected_output = true if result == 'success'
13
- expected_output = false if result == 'error'
14
- @output[0].should be == expected_output
15
- end
16
-
17
- Then /^I should see the help$/ do
18
- help = File.open("features/data/help.txt").readlines.join[0..-2]
19
- @output[1].should be == help
20
- end
21
-
22
- Given /^I start the gritano console but gritano is not installed$/ do
23
- stdin = double()
24
- stdin.stub(:read).and_return("Your SSHKEY here...")
25
- FileUtils.rm_rf('tmp\.gritano')
26
- @console = Gritano::Console::Gritano.new(stdin, 'tmp', 'tmp')
27
- end
28
-
29
- When /^I execute a command$/ do
30
- @command = ['user:list']
31
- end
32
-
33
- Then /^I should see an error$/ do
34
- lambda {@console.execute(@command)}.should raise_error SystemExit
35
- end
36
-
37
- When /^I install it$/ do
38
- @console.execute(['setup:prepare'])
39
- @output = @console.execute(['setup:install'])
40
- end
41
-
@@ -1,9 +0,0 @@
1
- When /^I set bin_name to test$/ do
2
- Gritano::Console::Gritano.bin_name = "test "
3
- end
4
-
5
- Then /^gritano should show help\-test$/ do
6
- help = File.open("features/data/help-test.txt").readlines.join[0..-2]
7
- Gritano::Console::Gritano.help.should be == help
8
- end
9
-
@@ -1,23 +0,0 @@
1
- Given /^the following keys exist:$/ do |table|
2
- table.hashes.each do |key|
3
- Gritano::User.find_by_login(key['login']).keys.create(name: key["key"], key: "key")
4
- end
5
- end
6
-
7
- Given /^I add "(.*?)" key to "(.*?)"$/ do |key, login|
8
- ssh_key = File.open(File.join("features/data/keys/", key)).readlines.join
9
- Gritano::User.find_by_login(login).keys.create({name: key, key: ssh_key})
10
- end
11
-
12
- When /^I generate the authorized_keys$/ do
13
- @authorized_keys = Gritano::Key.authorized_keys
14
- end
15
-
16
- Then /^I should see "(.*?)" authorized_keys$/ do |authorized_keys|
17
- expected_authorized_keys = File.open(File.join("features/data/keys/", authorized_keys)).readlines.join
18
- @authorized_keys.should be == expected_authorized_keys
19
- end
20
-
21
- Then /^I should see that "(.*?)" has only one key$/ do |login|
22
- Gritano::User.find_by_login(login).keys.count.should be == 1
23
- end
@@ -1,54 +0,0 @@
1
- Given /^the following users exist:$/ do |table|
2
- table.hashes.each do |user|
3
- Gritano::User.create(user)
4
- end
5
- end
6
-
7
- Given /^the following repositories exist:$/ do |table|
8
- table.hashes.each do |repo|
9
- Gritano::Repository.create(repo)
10
- end
11
- end
12
-
13
- Given /^the following permissions exist:$/ do |table|
14
- table.hashes.each do |permission|
15
- Gritano::User.find_by_login(permission['user'])
16
- .add_access(Gritano::Repository.find_by_name(permission['repo']), permission['access'].to_sym)
17
- end
18
- end
19
-
20
- Given /^I create a new user called "(.*?)"$/ do |login|
21
- @user = Gritano::User.create(login: login)
22
- end
23
-
24
- When /^I check if "(.*?)" has (read|write) access to "(.*?)"$/ do |login, access, repo|
25
- @access_result = @user.check_access(Gritano::Repository.find_by_name(repo), access.to_sym)
26
- end
27
-
28
- Then /^I should see that the access is (denied|allowed)$/ do |result|
29
- @expected_result = false if result == 'denied'
30
- @expected_result = true if result == 'allowed'
31
- @access_result.should be == @expected_result
32
- end
33
-
34
- Given /^I create a new repository called "(.*?)" to "(.*?)"$/ do |repo, login|
35
- Gritano::User.find_by_login(login).create_repository(name: repo)
36
- end
37
-
38
- Then /^I should see that only "(.*?)" has access to "(.*?)"$/ do |login, repo|
39
- repository = Gritano::Repository.find_by_name(repo)
40
- user = Gritano::User.find_by_login(login)
41
- user.check_access(repository, :read).should be_true
42
- user.check_access(repository, :write).should be_true
43
- Gritano::User.all.each do |u|
44
- unless u.login == user.login
45
- u.check_access(repository, :read).should be_false
46
- u.check_access(repository, :write).should be_false
47
- end
48
- end
49
- end
50
-
51
- Given /^I (add|remove) "(.*?)" (read|write) access to "(.*?)"$/ do |op, user, permission, repo|
52
- @user = Gritano::User.find_by_login(user)
53
- @user.send("#{op}_access", Gritano::Repository.find_by_name(repo), permission.to_sym)
54
- end
@@ -1,35 +0,0 @@
1
- Given /^I start the gritano\-check console with "(.*?)"$/ do |login|
2
- stdin = double()
3
- stdin.stub(:read).and_return("Your SSHKEY here...")
4
- @console = Gritano::Console::Remote.new(stdin, '.', 'tmp')
5
- @login = login
6
- end
7
-
8
- When /^I execute "(.*?)" via ssh$/ do |command|
9
- @output = @console.execute(command.split(' ') + [@login])
10
- end
11
-
12
- When /^I try to get tmp\/gritano\.git$/ do
13
- Kernel.should_receive(:exec)
14
- @console.execute(['git-receive-pack', 'tmp/gritano.git'] + [@login])
15
- end
16
-
17
- Then /^I should get it$/ do
18
- end
19
-
20
- When /^I try to send data to tmp\/gritano\.git$/ do
21
- Kernel.should_receive(:exec)
22
- @console.execute(['git-upload-pack', 'tmp/gritano.git'] + [@login])
23
- end
24
-
25
- Then /^I should send it$/ do
26
- end
27
-
28
- When /^I try to send an invalid command$/ do
29
- @command = ['invalid:command']
30
- end
31
-
32
- Then /^I should see an exception$/ do
33
- lambda {@console.execute(@command + [@login])}.should raise_error NoMethodError
34
- end
35
-