occi-cli 4.3.2 → 4.3.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c64f0a254a8ad13bf87a32afd212cb92b565fe7
4
- data.tar.gz: 9404dabf53b0b0b32b33a5943ae104402e0d32a8
3
+ metadata.gz: 923576b014280e1810eda84b47b89ea27fe5a239
4
+ data.tar.gz: 685817d6dc86d4e3c1c8e1407e5553bed93adf74
5
5
  SHA512:
6
- metadata.gz: d9ee1c0c68c62028270518d0cbe267e1f1e143309150eeb01354354f1d132f4c66d345ff5f013ff76c53b8fd75e39439fc499935f747eee476badfe5ef4f81e2
7
- data.tar.gz: 6c8780431ac94e0522802823d316d2cfea6fd4366e647070ee160f63a784c0973bf2ed89447d0940ea0be06db1f4365c9dcb116a283fd9e4cb4719aac486cf9f
6
+ metadata.gz: 5542e7d99378f2ceb4ae38cad6c4bbca6ba715ebb36e4f2ae710655709063db20ffe3d50b647dc073b8cfa71e4ca1fea8f0e4e80f6bb5695f102137e27483665
7
+ data.tar.gz: 2860ac0d49267d3040b36dd1fc7d2ba29aaa770cce3796f66379c4bb8df003ad59595bed0204f5b364983ebcf0f7944589351c27c824a5ac5ec726f200ad4095
data/bin/occi CHANGED
@@ -21,6 +21,8 @@ require 'highline/import'
21
21
 
22
22
  require 'occi-cli'
23
23
 
24
+ NONPASS_AUTHS = %w(none token).freeze
25
+
24
26
  # get arguments and validate/parse them to an ostruct
25
27
  options = Occi::Cli::OcciOpts.parse ARGV
26
28
 
@@ -42,7 +44,7 @@ if options.auth[:password].nil? || options.auth[:user_cert_password].nil?
42
44
 
43
45
  options.auth[:user_cert_password] = ask("Enter a password: ") {
44
46
  |q| q.echo = '*'
45
- } unless options.auth[:type] == "none" || (options.auth[:voms] && options.auth[:type] == "x509")
47
+ } unless NONPASS_AUTHS.include?(options.auth[:type]) || (options.auth[:voms] && options.auth[:type] == "x509")
46
48
 
47
49
  options.auth[:password] = options.auth[:user_cert_password]
48
50
  end
@@ -9,7 +9,7 @@ module Occi::Cli
9
9
 
10
10
  class OcciOpts
11
11
 
12
- AUTH_METHODS = [:x509, :basic, :digest, :none].freeze
12
+ AUTH_METHODS = [:x509, :token, :basic, :digest, :none].freeze
13
13
  MEDIA_TYPES = ["application/occi+json", "text/plain,text/occi", "text/plain", "text/occi"].freeze
14
14
  ACTIONS = [:list, :describe, :create, :delete, :trigger, :link, :unlink, :discover].freeze
15
15
  LOG_OUTPUTS = [:stdout, :stderr].freeze
@@ -121,6 +121,15 @@ module Occi::Cli
121
121
  options.auth.voms = true
122
122
  end
123
123
 
124
+ opts.on("-q",
125
+ "--token TOKEN",
126
+ String,
127
+ "A pre-generated token to be used for authentication purposes") do |token|
128
+ raise ArgumentError, "Token cannot be blank!" if token.blank?
129
+
130
+ options.auth.token = token
131
+ end
132
+
124
133
  opts.on("-y",
125
134
  "--media-type MEDIA_TYPE",
126
135
  MEDIA_TYPES,
@@ -1,5 +1,5 @@
1
1
  module Occi
2
2
  module Cli
3
- VERSION = "4.3.2" unless defined?(::Occi::Cli::VERSION)
3
+ VERSION = "4.3.3" unless defined?(::Occi::Cli::VERSION)
4
4
  end
5
5
  end
data/occi-cli.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
  gem.test_files = `git ls-files -- {test,spec}/*`.split("\n")
20
20
  gem.require_paths = ['lib']
21
21
 
22
- gem.add_dependency 'occi-api', '~> 4.3', '>= 4.3.3'
22
+ gem.add_dependency 'occi-api', '~> 4.3', '>= 4.3.4'
23
23
  gem.add_dependency 'json', '~> 1.8', '>= 1.8.1'
24
24
  gem.add_dependency 'highline', '~> 1.6', '>= 1.6.21'
25
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occi-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.2
4
+ version: 4.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Feldhaus
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-11-26 00:00:00.000000000 Z
13
+ date: 2015-12-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: occi-api
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '4.3'
22
22
  - - ">="
23
23
  - !ruby/object:Gem::Version
24
- version: 4.3.3
24
+ version: 4.3.4
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -31,7 +31,7 @@ dependencies:
31
31
  version: '4.3'
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 4.3.3
34
+ version: 4.3.4
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: json
37
37
  requirement: !ruby/object:Gem::Requirement