terminalwire 0.2.2 → 0.2.3
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.
- checksums.yaml +4 -4
- data/lib/terminalwire/client/entitlement/policy.rb +17 -0
- data/lib/terminalwire/server/context.rb +16 -0
- data/lib/terminalwire/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39232fa4bba65cc98bf87a3625e80a8c01ccee009277adeb53bd57efe28fd73c
|
4
|
+
data.tar.gz: 94ceb432cdd3f10fb3492cdfb5025eb3e71edbe352bdf0e2cd2a8438aef6f22d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a05475187aa41b8bb7b3e21ae13975a48f739ee95e00a2f099e7d13817a5192b9298a79236e008668416d8f385c31b02d716c404255e96148c385ff6268d4f10
|
7
|
+
data.tar.gz: 36fff6322f43fd783906e9e8a1878dd192b0b44695134cc6df12085da305f8cd34a758415ebb8d14a7d21ec4860172eb250c94508da27f5728149bf7cf76cbd8
|
@@ -52,6 +52,19 @@ module Terminalwire::Client::Entitlement
|
|
52
52
|
class Root < Base
|
53
53
|
AUTHORITY = "terminalwire.com".freeze
|
54
54
|
|
55
|
+
# Terminalwire checks these to install the binary stubs path.
|
56
|
+
SHELL_INITIALIZATION_FILE_PATHS = %w[
|
57
|
+
~/.bash_profile
|
58
|
+
~/.bashrc
|
59
|
+
~/.zprofile
|
60
|
+
~/.zshrc
|
61
|
+
~/.profile
|
62
|
+
~/.config/fish/config.fish
|
63
|
+
~/.bash_login
|
64
|
+
~/.cshrc
|
65
|
+
~/.tcshrc
|
66
|
+
].freeze
|
67
|
+
|
55
68
|
# Ensure the binary stubs are executable. This increases the
|
56
69
|
# file mode entitlement so that stubs created in ./bin are executable.
|
57
70
|
BINARY_PATH_FILE_MODE = 0o755
|
@@ -63,6 +76,10 @@ module Terminalwire::Client::Entitlement
|
|
63
76
|
# Now setup special permitted paths.
|
64
77
|
@paths.permit root_path
|
65
78
|
@paths.permit root_pattern
|
79
|
+
# Permit the dotfiles so terminalwire can install the binary stubs.
|
80
|
+
SHELL_INITIALIZATION_FILE_PATHS.each do |path|
|
81
|
+
@paths.permit path
|
82
|
+
end
|
66
83
|
|
67
84
|
# Permit terminalwire to grant execute permissions to the binary stubs.
|
68
85
|
@paths.permit binary_pattern, mode: BINARY_PATH_FILE_MODE
|
@@ -53,6 +53,22 @@ module Terminalwire::Server
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
+
# Wraps the environment variables in a hash-like object that can be accessed
|
57
|
+
# from client#ENV. This makes it look and feel just like the ENV object in Ruby.
|
58
|
+
class Env
|
59
|
+
def initialize(context:)
|
60
|
+
@context = context
|
61
|
+
end
|
62
|
+
|
63
|
+
def [](name)
|
64
|
+
@context.environment_variable.read(name)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def ENV
|
69
|
+
@ENV ||= Env.new(context: self)
|
70
|
+
end
|
71
|
+
|
56
72
|
def exit(status = 0)
|
57
73
|
@adapter.write(event: "exit", status: status)
|
58
74
|
end
|
data/lib/terminalwire/version.rb
CHANGED