localhost 1.4.2 → 1.5.0
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
- checksums.yaml.gz.sig +0 -0
- data/lib/localhost/issuer.rb +5 -2
- data/lib/localhost/system/darwin.rb +5 -1
- data/lib/localhost/system/linux.rb +5 -3
- data/lib/localhost/system.rb +4 -2
- data/lib/localhost/version.rb +1 -1
- data/readme.md +0 -2
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb2af90326b97a7ed35c40f67354cd551fc7f7087b3988752be1ce84346b5d33
|
4
|
+
data.tar.gz: 7d3e6cfe20a573d193ab7d54128af846481287423f058705ec1c7e7267d2093d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c6c85bff1973b4637c03031a73f4f0a77974eb7f9def2db89b7213586ff051f2c3d4d214732a052d6334f6253b9c54282427bf99c321d3a8c125f02bae07493
|
7
|
+
data.tar.gz: e35941e8efbae8f94b00f2738b7425cfbc4046dca06971c9a970747146e5eef22de7e17e41a185cd15cae9f44f602e5dccee705d01da19508292511f872d1d1b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/localhost/issuer.rb
CHANGED
@@ -29,12 +29,15 @@ module Localhost
|
|
29
29
|
return issuer
|
30
30
|
end
|
31
31
|
|
32
|
+
# The default certificate issuer name.
|
33
|
+
NAME = "development"
|
34
|
+
|
32
35
|
# Initialize the issuer with the given name.
|
33
36
|
#
|
34
37
|
# @parameter name [String] The common name to use for the certificate.
|
35
38
|
# @parameter path [String] The path path for loading and saving the certificate.
|
36
|
-
def initialize(name =
|
37
|
-
@name = name
|
39
|
+
def initialize(name = nil, path: State.path)
|
40
|
+
@name = name || NAME
|
38
41
|
@path = path
|
39
42
|
|
40
43
|
@subject = nil
|
@@ -5,10 +5,14 @@
|
|
5
5
|
|
6
6
|
module Localhost
|
7
7
|
module System
|
8
|
+
# Darwin specific system operations.
|
8
9
|
module Darwin
|
10
|
+
# Install a certificate into the system trust store.
|
11
|
+
#
|
12
|
+
# @parameter certificate [String] The path to the certificate file.
|
9
13
|
def self.install(certificate)
|
10
14
|
login_keychain = File.expand_path("~/Library/Keychains/login.keychain-db")
|
11
|
-
|
15
|
+
|
12
16
|
system(
|
13
17
|
"security", "add-trusted-cert",
|
14
18
|
"-d", "-r", "trustRoot",
|
@@ -3,11 +3,13 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2025, by Samuel Williams.
|
5
5
|
|
6
|
-
require "etc"
|
7
|
-
|
8
6
|
module Localhost
|
9
7
|
module System
|
10
|
-
|
8
|
+
# Linux specific system operations.
|
9
|
+
module Linux
|
10
|
+
# Install a certificate into the system trust store.
|
11
|
+
#
|
12
|
+
# @parameter certificate [String] The path to the certificate file.
|
11
13
|
def self.install(certificate)
|
12
14
|
filename = File.basename(certificate)
|
13
15
|
destination = "/usr/local/share/ca-certificates/localhost-#{filename}"
|
data/lib/localhost/system.rb
CHANGED
@@ -4,14 +4,16 @@
|
|
4
4
|
# Copyright, 2025, by Samuel Williams.
|
5
5
|
|
6
6
|
module Localhost
|
7
|
+
# @namespace
|
7
8
|
module System
|
9
|
+
# @return [Class] The best system class for the current platform.
|
8
10
|
def self.current
|
9
11
|
case RUBY_PLATFORM
|
10
12
|
when /darwin/
|
11
|
-
require
|
13
|
+
require "localhost/system/darwin"
|
12
14
|
Darwin
|
13
15
|
when /linux/
|
14
|
-
require
|
16
|
+
require "localhost/system/linux"
|
15
17
|
Linux
|
16
18
|
else
|
17
19
|
raise NotImplementedError, "Unsupported platform: #{RUBY_PLATFORM}"
|
data/lib/localhost/version.rb
CHANGED
data/readme.md
CHANGED
@@ -16,8 +16,6 @@ Please see the [project documentation](https://socketry.github.io/localhost/) fo
|
|
16
16
|
|
17
17
|
- [Getting Started](https://socketry.github.io/localhost/guides/getting-started/index) - This guide explains how to use `localhost` for provisioning local TLS certificates for development.
|
18
18
|
|
19
|
-
- [Browser Configuration](https://socketry.github.io/localhost/guides/browser-configuration/index) - This guide explains how to configure your local browser in order to avoid warnings about insecure self-signed certificates.
|
20
|
-
|
21
19
|
- [Example Server](https://socketry.github.io/localhost/guides/example-server/index) - This guide demonstrates how to use <code class="language-ruby">Localhost::Authority</code> to implement a simple HTTPS client & server.
|
22
20
|
|
23
21
|
## Releases
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: localhost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -46,7 +46,7 @@ cert_chain:
|
|
46
46
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
47
47
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
48
48
|
-----END CERTIFICATE-----
|
49
|
-
date: 2025-
|
49
|
+
date: 2025-04-12 00:00:00.000000000 Z
|
50
50
|
dependencies: []
|
51
51
|
executables: []
|
52
52
|
extensions: []
|
metadata.gz.sig
CHANGED
Binary file
|