localhost 1.4.0 → 1.4.1
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/bake/localhost.rb +47 -0
- data/lib/localhost/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -1
- 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: 612e08c97838afdec317692687bbda34463ffd795c37ad2ec737d3b6a9502293
|
4
|
+
data.tar.gz: 0d2eccf3c7bb248f7bbff43c986e8a5c5e4c7ba568e2afe3264bd37032b40809
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d62f6d3f501f3ca57b400428d606bb35c4c1ed96cb0cc28e4abeba14b2cc0e1e1808ad1f911bffab5b9f12fe461c8c9b351857cbcc6eacf45d4498959ca12091
|
7
|
+
data.tar.gz: df37c2f45dc667c66c7e8751da6e4fa455aa9d5b112b50ceaacb83bf9ba5dc9de0046507710042477bf76c640af814a4fadfc3972abccb4670671c698b024f2b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/localhost.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2021-2025, by Samuel Williams.
|
5
|
+
|
6
|
+
def initialize(...)
|
7
|
+
super
|
8
|
+
|
9
|
+
require_relative "../lib/localhost"
|
10
|
+
end
|
11
|
+
|
12
|
+
# List all local authorities.
|
13
|
+
#
|
14
|
+
# @returns [Array(Hash)] The certificate and key paths, and the expiry date.
|
15
|
+
def list
|
16
|
+
Localhost::Authority.list.map do |authority|
|
17
|
+
{
|
18
|
+
certificate_path: authority.certificate_path,
|
19
|
+
key_path: authority.key_path,
|
20
|
+
expires_at: authority.certificate.not_after,
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Fetch a local authority by hostname. If the authority does not exist, it will be created.
|
26
|
+
#
|
27
|
+
# @parameter hostname [String] The hostname to fetch.
|
28
|
+
# @returns [Hash] The certificate and key paths, and the expiry date.
|
29
|
+
def fetch(hostname)
|
30
|
+
if authority = Localhost::Authority.fetch(hostname)
|
31
|
+
return {
|
32
|
+
certificate_path: authority.certificate_path,
|
33
|
+
key_path: authority.key_path,
|
34
|
+
expires_at: authority.certificate.not_after,
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def install(name: nil)
|
40
|
+
issuer = Localhost::Issuer.fetch(name)
|
41
|
+
|
42
|
+
Localhost::System.current.install(issuer.certificate_path)
|
43
|
+
end
|
44
|
+
|
45
|
+
def purge
|
46
|
+
Localhost::State.purge
|
47
|
+
end
|
data/lib/localhost/version.rb
CHANGED
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.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -52,6 +52,7 @@ executables: []
|
|
52
52
|
extensions: []
|
53
53
|
extra_rdoc_files: []
|
54
54
|
files:
|
55
|
+
- bake/localhost.rb
|
55
56
|
- lib/localhost.rb
|
56
57
|
- lib/localhost/authority.rb
|
57
58
|
- lib/localhost/issuer.rb
|
metadata.gz.sig
CHANGED
Binary file
|