forte 1.0.0 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/bin/forte +1 -1
- data/lib/forte/authorized_keys.rb +10 -8
- data/lib/forte/base.rb +1 -1
- data/lib/forte/keyfile.rb +13 -11
- data/lib/forte/repo_location.rb +13 -10
- data/lib/forte/version.rb +1 -1
- data/lib/forte.rb +12 -1
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e4da4d23a5e9981308609c3d8900d26f9cc4e934140a1bbb8b379de5cfdd720b
|
4
|
+
data.tar.gz: adcba87a9412e19eccdb036e06b574bb228dec6c2206b60aaa649030fb190293
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69676b1be44a2e56556449610f6745de4f6e38b8ddcf3546d6960fe397b461732be729e86fb7a7093b7149e7eb9af43647c6a48f29c7acd1f484b3e757631978
|
7
|
+
data.tar.gz: 6ca717f9bfc3e63b837c6b902b62797f14791a122a244173eaf57212b84568ba2a59f0599c6606c9689806dffee7c6b86180b4746dc1d0135fd4fdf23db66c6b
|
data/bin/forte
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
module Forte
|
2
|
+
class AuthorizedKeys
|
3
|
+
def self.build(dir)
|
4
|
+
out = ''
|
5
|
+
Dir.glob(File.join(dir, '**', '*.pub')) do |file|
|
6
|
+
keyfile = Keyfile.new(file)
|
7
|
+
out << "##{keyfile.description}\n"
|
8
|
+
out << "#{keyfile.body}\n"
|
9
|
+
end
|
10
|
+
out
|
8
11
|
end
|
9
|
-
out
|
10
12
|
end
|
11
13
|
end
|
data/lib/forte/base.rb
CHANGED
@@ -2,7 +2,7 @@ class Base < Thor
|
|
2
2
|
desc "print", "Prints the public keys to STDOUT"
|
3
3
|
def print(uri)
|
4
4
|
loc = RepoLocation.new(uri)
|
5
|
-
repo = Git.clone(loc.uri, File.join(Dir.pwd, '
|
5
|
+
repo = Git.clone(loc.uri, File.join(Dir.pwd, '.forte'))
|
6
6
|
puts AuthorizedKeys.build(repo.dir.path)
|
7
7
|
FileUtils.rm_rf(repo.dir.path)
|
8
8
|
end
|
data/lib/forte/keyfile.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
module Forte
|
2
|
+
class Keyfile
|
3
|
+
attr_accessor :path
|
4
|
+
def initialize(path)
|
5
|
+
@path = path
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
def description
|
9
|
+
File.basename(path, '.*')
|
10
|
+
end
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
def body
|
13
|
+
IO.read(path)
|
14
|
+
end
|
14
15
|
|
16
|
+
end
|
15
17
|
end
|
data/lib/forte/repo_location.rb
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module Forte
|
2
|
+
class RepoLocation
|
3
|
+
attr_accessor :path
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
def initialize(path)
|
6
|
+
@path = path
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
def uri
|
10
|
+
return path if path.start_with?('git@')
|
11
|
+
return path if path.start_with?('http')
|
12
|
+
return path if Dir.exists?(File.join(path, '.git'))
|
13
|
+
"https://github.com/#{path}.git"
|
14
|
+
end
|
13
15
|
|
16
|
+
end
|
14
17
|
end
|
data/lib/forte/version.rb
CHANGED
data/lib/forte.rb
CHANGED
@@ -2,7 +2,18 @@ require 'thor'
|
|
2
2
|
require 'git'
|
3
3
|
require 'fileutils'
|
4
4
|
require 'forte/authorized_keys'
|
5
|
-
require 'forte/base'
|
6
5
|
require 'forte/keyfile'
|
7
6
|
require 'forte/repo_location'
|
8
7
|
require 'forte/version'
|
8
|
+
|
9
|
+
module Forte
|
10
|
+
class CLI < Thor
|
11
|
+
desc "print", "Prints the public keys to STDOUT"
|
12
|
+
def print(uri)
|
13
|
+
loc = RepoLocation.new(uri)
|
14
|
+
repo = Git.clone(loc.uri, File.join(Dir.pwd, '.forte'))
|
15
|
+
puts AuthorizedKeys.build(repo.dir.path)
|
16
|
+
FileUtils.rm_rf(repo.dir.path)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forte
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Yockey
|
8
8
|
- Ryan Cromwell
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-05-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '1.2'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '1.2'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: git
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '1.
|
34
|
+
version: '1.11'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '1.
|
41
|
+
version: '1.11'
|
42
42
|
description: 'Create an authorized_keys file for a shared shell account from a repository
|
43
43
|
of public key files '
|
44
44
|
email:
|
@@ -60,7 +60,7 @@ homepage: https://github.com/yock/forte
|
|
60
60
|
licenses:
|
61
61
|
- MIT
|
62
62
|
metadata: {}
|
63
|
-
post_install_message:
|
63
|
+
post_install_message:
|
64
64
|
rdoc_options: []
|
65
65
|
require_paths:
|
66
66
|
- lib
|
@@ -75,9 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
|
-
|
79
|
-
|
80
|
-
signing_key:
|
78
|
+
rubygems_version: 3.3.7
|
79
|
+
signing_key:
|
81
80
|
specification_version: 4
|
82
81
|
summary: Create an authorized_keys file for a shared shell account from a repository
|
83
82
|
of public key files
|