git_acl_shell 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a4907a336c5ce915ad12f0a5c62645f2621b6b2
4
- data.tar.gz: 2a4f4cd8b07650e61d908fcda58cb312ae0022be
3
+ metadata.gz: 2f377dfc78d6d578f7c0bdaa110094aa77cd9d7f
4
+ data.tar.gz: 046e5c856cfbd616e5e95f3ecb0dfe58a6ca44cb
5
5
  SHA512:
6
- metadata.gz: 920d496577b503111404951701f67ed0ce2b3cb2e9d915fafd8a757e2ab20bf559646e520619319ce0b25bab3d4d449ff183a23e6ba703f1097fb6bd899c95e4
7
- data.tar.gz: 6c861a0545a4254a60f81710d9698899ba4f674958c73a972b33b58d0e9f2fd7489522088e5c9d122e19b1f2f76eee2c33a76aa8bdc5aec1e1c322ab2f8f67f7
6
+ metadata.gz: f6ee25445985f157d918aac8472755367487945fb132ad52d753392d3132cb0b283101292dd9021e778e780432123395798a32dcd26d23be8dd7a2cd549c8df1
7
+ data.tar.gz: 730d3c56d604e04116f89d01881758970c1d0916f431c8b3e30ebcf18b1ddb190c2d6b28e959014746349b4ead8b0a79cfdb529c7291eaa805fdbe4954d49064
@@ -6,6 +6,9 @@ module GitAclShell
6
6
  # See https://git-scm.com/docs/git-shell#_commands
7
7
  # (git push) (git fetch) (git archive)
8
8
  COMMAND_WHITELIST = %w(git-receive-pack git-upload-pack git-upload-archive).freeze
9
+ NO_SHELL_ACCESS_MESSAGE = ENV['git_acl_shell_no_shell_access_message'] || "You've succesfully authenticated, but shell access is not available."
10
+ ACCESS_DENIED_MESSAGE = ENV['git_acl_shell_access_denied_message'] || "You've successfully authenticated, but you don't have access to this repo."
11
+ COMMAND_DENIED_MESSAGE = ENV['git_acl_shell_command_denied_message'] || "You've successfully authenticated, but the only allowed commands are #{COMMAND_WHITELIST.join(', ')}."
9
12
 
10
13
  def initialize(key_id, acl:, directory:, kernel: Kernel, stderr: $stderr)
11
14
  @key_id = key_id
@@ -17,7 +20,7 @@ module GitAclShell
17
20
 
18
21
  def exec(command)
19
22
  if command.nil?
20
- @stderr.puts("OH HAI! U HAS LOGGD IN BUT WE DOAN PROVIDE SHELL ACCES. KTHXBAI!")
23
+ @stderr.puts(NO_SHELL_ACCESS_MESSAGE)
21
24
  return false
22
25
  end
23
26
 
@@ -40,11 +43,11 @@ module GitAclShell
40
43
  @kernel.exec(*args)
41
44
  true
42
45
  else
43
- @stderr.puts("You've successfully authenticated, but you don't have access to this repo")
46
+ @stderr.puts(ACCESS_DENIED_MESSAGE)
44
47
  false
45
48
  end
46
49
  else
47
- @stderr.puts("OH HAI! I CAN ONLY HALP U WIF GIT COMMANDZ, SRY! KTHXBAI!")
50
+ @stderr.puts(COMMAND_DENIED_MESSAGE)
48
51
  false
49
52
  end
50
53
  end
@@ -1,3 +1,3 @@
1
1
  module GitAclShell
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_acl_shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cucumber Ltd