cnvrg 2.0.11 → 2.0.13

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: 86857e06a0d107172c161467e8ff8cb04a120d8b230c97843e91ce13c826ccce
4
- data.tar.gz: 272fe88e1e390f2887c36c49915cc89f10a6cf9947bb98ab6fd503476ac03820
3
+ metadata.gz: 0e2e22e961bc723442ec80d457f0dde2b982f1c75beb2e859bb5523e83682fbe
4
+ data.tar.gz: 645a4add593bcf3a63be4d64b4ccb45000e39447e7e11b9fd674347856e2bf97
5
5
  SHA512:
6
- metadata.gz: c28ab54953e47843897273f8038f5e0bfc92e101e161d1edae4477250e1334b5730b5020713572ad2482c5b0c305c5c0b2c5725b8796a44c06750eccf2924e9f
7
- data.tar.gz: 69be0cd1fc89180ce7b878aaa8e0767b5be9a00cb0c9813c504e62677c1c839831aa6cf4fbf27aeb66aa50b756f7b28f46eb721182e588bcc4b7c65544e6a41b
6
+ metadata.gz: 2af7a28b7b428f8b4066a1b3f01bada7273eaa93ea847f87badc253aea2123244ad27ab3804cda5f4cdcee91cc2cc0ed7dd168b347839f59a6c183a702438167
7
+ data.tar.gz: dc151c1ab54d54a86648b9f1341d402d0eb6fb8d578cc0a01f2594a28a34bfb8d97676d07aa389a8b1155fa466845f87be9b1dffbfcc2bcda33376937ecef418
data/Readme.md CHANGED
@@ -53,4 +53,10 @@
53
53
  2021-09-12
54
54
  * DEV-10502 - Bug: Periodic sync stuck
55
55
  ## Version v2.0.11
56
- 2021-10-21
56
+ 2021-10-21
57
+ ## Version v2.0.12
58
+ 2021-10-25
59
+ * DEV-11544 - Sub-bug: local experiment is failing to run
60
+ ## Version v2.0.13
61
+ 2021-10-27
62
+ * DEV-11054 - Task: Create organization and user by default
data/lib/cnvrg/api.rb CHANGED
@@ -57,6 +57,7 @@ module Cnvrg
57
57
  conn = Faraday.new "#{endpoint_uri}"
58
58
  end
59
59
  conn.headers['Auth-Token'] = @pass
60
+ conn.headers['Authorization'] = "CAPI #{@pass}"
60
61
  conn.headers['User-Agent'] = "#{Cnvrg::API::USER_AGENT}"
61
62
  conn.options.timeout = 420
62
63
  conn.options.open_timeout=180
@@ -169,6 +170,7 @@ module Cnvrg
169
170
  when 'POST_FILE'
170
171
  conn = Faraday.new do |fr|
171
172
  fr.headers['Auth-Token'] = @pass
173
+ fr.headers['Authorization'] = "CAPI #{@pass}"
172
174
  fr.headers['User-Agent'] = "#{Cnvrg::API::USER_AGENT}"
173
175
  fr.headers["Content-Type"] = "multipart/form-data"
174
176
  if !Helpers.is_verify_ssl
data/lib/cnvrg/api_v2.rb CHANGED
@@ -22,6 +22,7 @@ module Cnvrg
22
22
 
23
23
  conn = Faraday.new endpoint_uri, :ssl => {:verify => !!Helpers.is_verify_ssl}
24
24
  conn.headers['Auth-Token'] = pass
25
+ conn.headers['Authorization'] = "CAPI #{pass}"
25
26
  conn.headers['User-Agent'] = Cnvrg::API::USER_AGENT
26
27
  conn.headers['Content-Type'] = "application/json"
27
28
  conn.options.timeout = 420
data/lib/cnvrg/auth.rb CHANGED
@@ -44,7 +44,7 @@ module Cnvrg
44
44
  end
45
45
  end
46
46
 
47
- def sign_in(email, password)
47
+ def sign_in(email, password, token: nil)
48
48
  url = Cnvrg::API.endpoint_uri()
49
49
  url = URI.parse(url+ "/users/sign_in")
50
50
  http = Net::HTTP.new(url.host, url.port)
@@ -61,6 +61,9 @@ module Cnvrg
61
61
 
62
62
  req.add_field("EMAIL", email)
63
63
  req.add_field("PASSWORD", password)
64
+ if token.present?
65
+ req.add_field("Authorization", "CAPI #{token}")
66
+ end
64
67
 
65
68
  response = http.request(req)
66
69
 
data/lib/cnvrg/cli.rb CHANGED
@@ -496,8 +496,10 @@ module Cnvrg
496
496
 
497
497
 
498
498
  desc 'login', 'Authenticate with cnvrg.io platform'
499
+ method_option :sso, :type => :boolean, :aliases => ["-s", "--sso"], :default => false
499
500
 
500
501
  def login
502
+ use_token = options["sso"]
501
503
  begin
502
504
  log_handler()
503
505
  log_start(__method__, args, options)
@@ -515,12 +517,21 @@ module Cnvrg
515
517
  exit(0)
516
518
  end
517
519
  @email = ask("Enter your email:")
518
- password = cmd.ask("Enter your password (hidden):") {|q| q.echo = "*"}
519
- result = @auth.sign_in(@email, password)
520
+ if use_token
521
+ @token = cmd.ask("Enter your token (hidden):") {|q| q.echo = "*"}
522
+ netrc[Cnvrg::Helpers.netrc_domain] = @email, @token
523
+ netrc.save
524
+ password = ""
525
+ else
526
+ password = cmd.ask("Enter your password (hidden):") {|q| q.echo = "*"}
527
+ end
528
+ result = @auth.sign_in(@email, password, token: @token)
520
529
 
521
530
  if !result["token"].nil?
522
- netrc[Cnvrg::Helpers.netrc_domain] = @email, result["token"]
523
- netrc.save
531
+ unless use_token
532
+ netrc[Cnvrg::Helpers.netrc_domain] = @email, result["token"]
533
+ netrc.save
534
+ end
524
535
 
525
536
  log_message("Authenticated successfully as #{@email}", Thor::Shell::Color::GREEN)
526
537
 
@@ -3327,7 +3338,7 @@ module Cnvrg
3327
3338
  end
3328
3339
 
3329
3340
  if local
3330
- exec_local(cmd)
3341
+ exec_local(cmd, print_log, start_commit, real, start_time)
3331
3342
  exit_status = $?.exitstatus
3332
3343
 
3333
3344
  else
@@ -5884,7 +5895,8 @@ module Cnvrg
5884
5895
  end
5885
5896
  end
5886
5897
 
5887
- def exec_local(cmd)
5898
+ def exec_local(cmd , print_log, start_commit, real, start_time)
5899
+ log = []
5888
5900
  PTY.spawn(@exp.as_env, cmd) do |stdout, stdin, pid, stderr|
5889
5901
  begin
5890
5902
  stdout.each do |line|
data/lib/cnvrg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cnvrg
2
- VERSION = '2.0.11'
2
+ VERSION = '2.0.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cnvrg
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.11
4
+ version: 2.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yochay Ettun
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-10-21 00:00:00.000000000 Z
13
+ date: 2021-10-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler