terminalwire 0.1.14 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/terminalwire/authority.rb +44 -0
- data/lib/terminalwire/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20d25d091ee29d5953cfc70935227461ed75ec3d52c5b4cbff96db9e4b30ea7a
|
4
|
+
data.tar.gz: 80325aea9d946a9050ab4d9a97003186aba8a826e04ccefa23783a6fcfeea4dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc79939e4328e469df0a13f5ec34ed0e99c5f7206712a8480916b55005b95fcf544de98884d33f306fcb16a02fa4868aa09f302087e3015c02c80d42c8429a75
|
7
|
+
data.tar.gz: 0e00b629b2ae76adddef05725f2f3fb8b1550e55b513fdd77317a978f2a416a0876af450ac47da4c0ee011fb8239623e37f7887bc0bd627ac2cb258b0779077a
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require "uri"
|
2
|
+
require "base64"
|
3
|
+
|
4
|
+
# Resolves domains into authorities, which are is used for access
|
5
|
+
# identity control in Terminalwire.
|
6
|
+
class Terminalwire::Authority
|
7
|
+
# Used to seperate path keys in the URL.
|
8
|
+
PATH_SEPERATOR = "/".freeze
|
9
|
+
|
10
|
+
# Used to demark a URL string as authorative.
|
11
|
+
SCHEME = "terminalwire://".freeze
|
12
|
+
|
13
|
+
def initialize(url:)
|
14
|
+
@url = URI(url)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Extracted from HTTP. This is so we can
|
18
|
+
def domain
|
19
|
+
if @url.port == @url.default_port
|
20
|
+
@url.host
|
21
|
+
else
|
22
|
+
"#{url.host}:#{url.port}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Make sure there's always a / at the end of the path.
|
27
|
+
def path
|
28
|
+
path_keys.join(PATH_SEPERATOR).prepend(PATH_SEPERATOR)
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_s
|
32
|
+
[SCHEME, domain, path].join
|
33
|
+
end
|
34
|
+
|
35
|
+
def key
|
36
|
+
Base64.urlsafe_encode64(to_s)
|
37
|
+
end
|
38
|
+
|
39
|
+
protected
|
40
|
+
|
41
|
+
def path_keys
|
42
|
+
@url.path.scan(/[^\/]+/)
|
43
|
+
end
|
44
|
+
end
|
data/lib/terminalwire/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terminalwire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Gessler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-websocket
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- lib/generators/terminalwire/install/templates/main_terminal.rb
|
162
162
|
- lib/terminalwire.rb
|
163
163
|
- lib/terminalwire/adapter.rb
|
164
|
+
- lib/terminalwire/authority.rb
|
164
165
|
- lib/terminalwire/client.rb
|
165
166
|
- lib/terminalwire/client/entitlement.rb
|
166
167
|
- lib/terminalwire/client/exec.rb
|
@@ -198,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
199
|
- !ruby/object:Gem::Version
|
199
200
|
version: '0'
|
200
201
|
requirements: []
|
201
|
-
rubygems_version: 3.5.
|
202
|
+
rubygems_version: 3.5.16
|
202
203
|
signing_key:
|
203
204
|
specification_version: 4
|
204
205
|
summary: Ship a CLI for your web app. No API required.
|