forte 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/bin/forte +1 -1
- data/lib/forte.rb +12 -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 -11
- data/lib/forte/version.rb +1 -1
- metadata +26 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b807f2b5969715d6f8cf32beb6c83fabdf2a149
|
4
|
+
data.tar.gz: 776a96165b52bc2be3b3340bf3c763b14372dd24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8de4ab00527964f949e3b699477f72bf3ebeb97125cbb95205f266d0c055e25fb4458af1f14e9889861baea68ee125f69d65ee8db2119c4255e0f8d591576f00
|
7
|
+
data.tar.gz: 445d5778a75311ad97ef544bc6120a182cde8cbd109e1a8ead8a0981b0b3f8c43c63997b481a1da69d99a76a0bb2f7d3018e9d47c00f3394d558c22967aa9ee3
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
data/bin/forte
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
|
@@ -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,15 +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
|
-
|
13
|
-
|
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
|
14
15
|
|
16
|
+
end
|
15
17
|
end
|
data/lib/forte/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,37 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Yockey
|
8
8
|
- Ryan Cromwell
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
|
-
cert_chain:
|
12
|
-
|
11
|
+
cert_chain:
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMQ0wCwYDVQQDDARtaWtl
|
15
|
+
MRswGQYKCZImiZPyLGQBGRYLaGV5c3Bhcmtib3gxEzARBgoJkiaJk/IsZAEZFgNj
|
16
|
+
b20wHhcNMTYxMTExMTUzNjA2WhcNMTcxMTExMTUzNjA2WjBBMQ0wCwYDVQQDDARt
|
17
|
+
aWtlMRswGQYKCZImiZPyLGQBGRYLaGV5c3Bhcmtib3gxEzARBgoJkiaJk/IsZAEZ
|
18
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBD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11 00:00:00.000000000 Z
|
13
35
|
dependencies:
|
14
36
|
- !ruby/object:Gem::Dependency
|
15
37
|
name: thor
|
@@ -76,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
98
|
version: '0'
|
77
99
|
requirements: []
|
78
100
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.5.1
|
80
102
|
signing_key:
|
81
103
|
specification_version: 4
|
82
104
|
summary: Create an authorized_keys file for a shared shell account from a repository
|
metadata.gz.sig
ADDED
Binary file
|