ccs 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60d859bd2a81a6b31a609481cd0e1d0c04a2a4721084c044c65089f434ba0028
4
- data.tar.gz: 499c070bcab5c966055de84266ffc4bfd474dc55e5051f82cc6c25dac5ceb992
3
+ metadata.gz: ddc7a13cb4e185260a511ead10fd9f75387fecdd42a4138d19e0a0de35cd9caf
4
+ data.tar.gz: 8c99aa2c31cbd7a66bb1023f8b32872478691268b475b80f9bf6c203ebb978a1
5
5
  SHA512:
6
- metadata.gz: be0fd271a7d744a143bb3a11b55bbde8a5da7ae569eb360f642160bf6fe04ddbbdb66a0f866f1999223c863b0b653dd234b54f56edd69820dab8ae50463e1088
7
- data.tar.gz: cfcd265804deb742dc684cdd63aaef3d35e76cb9be048e0ddccec01ba28bbe7ab3eaa7523c96d0096d61636bcc71cb45b705d3760565eab70ddee047cfc1be10
6
+ metadata.gz: 6c8f8bff758c7917bee0a1f779f5a97594c863d19ae96a673b8ca630cfe0189649d326130c44b622799ce489b9486492c1bf9fb74ee38c6e998167f29a7cb8a5
7
+ data.tar.gz: 0ac4cd8805f4addd47e7b224a7eff2a7fab360856294aed60444846946d9563c294d415bdbba9f72da3d7fe2f966b1cec18d5f51b97fc615e6a0da49d6da8d94
data/README.md CHANGED
@@ -25,8 +25,8 @@ Or install it yourself as:
25
25
  Options:
26
26
  -a CCS_ACCESS_TOKEN, CCS Access Token
27
27
  --access-token
28
- -s CCS_SECRET_TOKEN, CCS Secret Token
29
- --secret-token
28
+ -p CCS_PASSPHRASE, CCS Passphrase
29
+ --passphrase
30
30
 
31
31
 
32
32
  ## Example
@@ -58,10 +58,10 @@ Upload
58
58
 
59
59
  destination = 'ccs://workspace-name/0.1.0/path/to/file.yml'
60
60
  access_token = ENV.fetch('CCS_ACCESS_TOKEN')
61
- secret_token = 'MySecretToken'
61
+ passphrase = 'MyPassphrase'
62
62
  content = 'RAILS_ENV=production'
63
63
 
64
- Ccs::Document.new(destination, access_token, secret_token).upload(content)
64
+ Ccs::Document.new(destination, access_token, passphrase).upload(content)
65
65
 
66
66
  Download
67
67
 
@@ -69,9 +69,9 @@ Download
69
69
 
70
70
  source = 'ccs://workspace-name/0.1.0/path/to/file.yml'
71
71
  access_token = ENV.fetch('CCS_ACCESS_TOKEN')
72
- secret_token = 'MySecretToken'
72
+ passphrase = 'MyPassphrase'
73
73
 
74
- Ccs::Document.new(source, access_token, secret_token).download
74
+ Ccs::Document.new(source, access_token, passphrase).download
75
75
 
76
76
  ## Development
77
77
 
@@ -81,7 +81,7 @@ To install this gem onto your local machine, run `bin/rake install`. To release
81
81
 
82
82
  ## Contributing
83
83
 
84
- Bug reports and pull requests are welcome on GitHub at https://github.com/tkowalewski/ccs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
84
+ Bug reports and pull requests are welcome on GitHub at https://github.com/occson/ccs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
85
85
 
86
86
 
87
87
  ## License
data/exe/ccs CHANGED
@@ -9,7 +9,7 @@ require 'io/console'
9
9
 
10
10
  options = {
11
11
  'access_token' => ENV['CCS_ACCESS_TOKEN'],
12
- 'secret_token' => ENV['CCS_SECRET_TOKEN']
12
+ 'passphrase' => ENV['CCS_PASSPHRASE']
13
13
  }
14
14
 
15
15
  option_parser = OptionParser.new do |option_parser|
@@ -38,14 +38,14 @@ when 'cp'
38
38
  options['access_token'] = v
39
39
  end
40
40
 
41
- option_parser.on('-s CCS_SECRET_TOKEN', '--secret-token CCS_SECRET_TOKEN', String, 'CCS Secret Token') do |v|
42
- options['secret_token'] = v
41
+ option_parser.on('-p CCS_PASSPHRASE', '--passphrase CCS_PASSPHRASE', String, 'CCS Passphrase') do |v|
42
+ options['passphrase'] = v
43
43
  end
44
44
 
45
45
  option_parser.separator ''
46
46
  option_parser.separator 'Configure via environment variables:'
47
47
  option_parser.separator ' CCS_ACCESS_TOKEN'
48
- option_parser.separator ' CCS_SECRET_TOKEN'
48
+ option_parser.separator ' CCS_PASSPHRASE'
49
49
 
50
50
  option_parser.separator ''
51
51
  option_parser.separator 'Examples:'
@@ -73,11 +73,11 @@ when 'cp'
73
73
  end
74
74
 
75
75
  raise OptionParser::MissingArgument, 'access_token' unless options['access_token']
76
- raise OptionParser::MissingArgument, 'secret_token' unless options['secret_token']
76
+ raise OptionParser::MissingArgument, 'passphrase' unless options['passphrase']
77
77
  raise OptionParser::MissingArgument, 'source' unless arguments.fetch(0, nil)
78
78
  raise OptionParser::MissingArgument, 'destination' unless arguments.fetch(1, nil)
79
79
 
80
- exit(1) unless Ccs::Commands::Copy.new(arguments[0], arguments[1], options['access_token'], options['secret_token']).call
80
+ exit(1) unless Ccs::Commands::Copy.new(arguments[0], arguments[1], options['access_token'], options['passphrase']).call
81
81
  else
82
82
  puts option_parser
83
83
  exit(1)
@@ -3,11 +3,11 @@
3
3
  module Ccs
4
4
  module Commands
5
5
  class Copy
6
- def initialize(source, destination, access_token, secret_token)
6
+ def initialize(source, destination, access_token, passphrase)
7
7
  @source = source
8
8
  @destination = destination
9
9
  @access_token = access_token
10
- @secret_token = secret_token
10
+ @passphrase = passphrase
11
11
  end
12
12
 
13
13
  def call
@@ -21,7 +21,7 @@ module Ccs
21
21
  end
22
22
 
23
23
  def download
24
- content = Document.new(@source, @access_token, @secret_token).download
24
+ content = Document.new(@source, @access_token, @passphrase).download
25
25
  return unless content
26
26
 
27
27
  (@destination.eql?('-') ? STDOUT : File.new(@destination, 'w')).print content
@@ -29,7 +29,7 @@ module Ccs
29
29
 
30
30
  def upload
31
31
  content = @source.eql?('-') ? STDIN.read : File.read(@source)
32
- Document.new(@destination, @access_token, @secret_token).upload(content)
32
+ Document.new(@destination, @access_token, @passphrase).upload(content)
33
33
  end
34
34
  end
35
35
  end
@@ -2,18 +2,18 @@
2
2
 
3
3
  module Ccs
4
4
  class Document
5
- def initialize(uri, access_token, secret_token)
5
+ def initialize(uri, access_token, passphrase)
6
6
  @uri = build_uri(uri)
7
7
  @access_token = access_token
8
- @secret_token = secret_token
8
+ @passphrase = passphrase
9
9
  end
10
10
 
11
11
  def upload(content)
12
- Uploader.new(@uri, content, @access_token, @secret_token).call
12
+ Uploader.new(@uri, content, @access_token, @passphrase).call
13
13
  end
14
14
 
15
15
  def download
16
- Downloader.new(@uri, @access_token, @secret_token).call
16
+ Downloader.new(@uri, @access_token, @passphrase).call
17
17
  end
18
18
 
19
19
  private
@@ -2,10 +2,10 @@
2
2
 
3
3
  module Ccs
4
4
  class Downloader
5
- def initialize(uri, access_token, secret_token)
5
+ def initialize(uri, access_token, passphrase)
6
6
  @uri = uri
7
7
  @access_token = access_token
8
- @secret_token = secret_token
8
+ @passphrase = passphrase
9
9
  end
10
10
 
11
11
  def call
@@ -14,7 +14,7 @@ module Ccs
14
14
  return unless response.code.eql? '200'
15
15
  json = JSON.parse body
16
16
 
17
- Decrypter.new(@secret_token, json['encrypted_content']).call
17
+ Decrypter.new(@passphrase, json['encrypted_content']).call
18
18
  end
19
19
 
20
20
  private
@@ -2,11 +2,11 @@
2
2
 
3
3
  module Ccs
4
4
  class Uploader
5
- def initialize(uri, content, access_token, secret_token)
5
+ def initialize(uri, content, access_token, passphrase)
6
6
  @uri = uri
7
7
  @content = content
8
8
  @access_token = access_token
9
- @secret_token = secret_token
9
+ @passphrase = passphrase
10
10
  end
11
11
 
12
12
  def call
@@ -36,7 +36,7 @@ module Ccs
36
36
  end
37
37
 
38
38
  def encrypted_content
39
- @encrypted_content ||= Encrypter.new(@secret_token, @content, salt).call
39
+ @encrypted_content ||= Encrypter.new(@passphrase, @content, salt).call
40
40
  end
41
41
 
42
42
  def salt
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ccs
4
- VERSION = '2.0.0'
4
+ VERSION = '3.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ccs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tkowalewski
8
+ - paweljw
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2020-10-17 00:00:00.000000000 Z
12
+ date: 2020-10-23 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: inch
@@ -139,6 +140,7 @@ dependencies:
139
140
  description: ''
140
141
  email:
141
142
  - me@tkowalewski.pl
143
+ - p@steamshard.net
142
144
  executables:
143
145
  - ccs
144
146
  extensions: []
@@ -157,7 +159,7 @@ files:
157
159
  - lib/ccs/encrypter.rb
158
160
  - lib/ccs/uploader.rb
159
161
  - lib/ccs/version.rb
160
- homepage: https://github.com/tkowalewski/ccs
162
+ homepage: https://github.com/occson/ccs
161
163
  licenses:
162
164
  - MIT
163
165
  metadata: {}