armrest 0.1.3 → 0.2.1

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: d4c4f5c3ad0273b918079782f07fc19afeb79f27643507425170a669b13189f1
4
- data.tar.gz: f24c988d305341bdf9dec63cee30b10c4731cc6869944899e30d4720c43a54fd
3
+ metadata.gz: 8fa3acf6609a37ab249c81102bb915108499631571af0b5884c4d66b33f28376
4
+ data.tar.gz: 3691659a2058ccd4944397cad38a9c22194fdc96afb89288e6f21957aa2b2131
5
5
  SHA512:
6
- metadata.gz: 72e496e6289d559f4830922aaf0d88c2ebce9e1d02c4168f27197d10bb164c7ef6470096683ce0a59628c2b60d77df749d0a7bc8eb046c5577f60b2c77c0898a
7
- data.tar.gz: c72f975deeeac2c870e9b484aa6d94782ac73bcb11fe3bcdb4d4c9a013d7709b352e567b1f00f6d9746691d5ae3614db3b455ab81241a6ab57678285e82b982c
6
+ metadata.gz: bf768b1fb7c039488df49baa4e9d68cf6af33db34d238ec49d8063dd215b2b82d8abe8a39b8d04d3806f9c3874aa7d1623992f8e1bd689f8ccff49b2ffcfcbc0
7
+ data.tar.gz: 17d2bd2bacc9ed0727cca2d9c5b870e0557c86a32aed60af2c10bc73ccb55e0832d08e7343fa6534bb4b33375f309b2ce286921d74362d0f766dec113ae71df8
data/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.2.1] - 2023-12-22
7
+ - [#6](https://github.com/boltops-tools/armrest/pull/6) Adjust the AZ timeout
8
+
9
+ ## [0.2.0] - 2023-12-21
10
+ - [#5](https://github.com/boltops-tools/armrest/pull/5) fix cli auth
11
+
6
12
  ## [0.1.3] - 2022-05-03
7
13
  - [#1](https://github.com/boltops-tools/armrest/pull/1) remove camelize
8
14
 
data/README.md CHANGED
@@ -31,7 +31,7 @@ resource_group.create_or_update(
31
31
  )
32
32
  ```
33
33
 
34
- Refer to the [boltops-tools/terraspace_plugin_azurer](https://github.com/boltops-tools/terraspace_plugin_azurerm) for more examples.
34
+ Refer to the [boltops-tools/terraspace_plugin_azurerm](https://github.com/boltops-tools/terraspace_plugin_azurerm) for more examples.
35
35
 
36
36
  ## Usage: CLI
37
37
 
@@ -25,12 +25,14 @@ module Armrest::Api::Auth
25
25
  # Looks like az account get-access-token caches the toke in ~/.azure/accessTokens.json
26
26
  # and will update it only when it expires. So dont think we need to handle caching
27
27
  def get_access_token
28
- command = "az account get-access-token -o json --resource #{resource}"
28
+ command = "az account get-access-token -o json"
29
29
  logger.debug "command: #{command}"
30
30
  out = `#{command}`
31
- JSON.load(out)
32
- rescue
33
- raise CliError, 'Error acquiring token from the Azure az CLI'
31
+ if $?.success?
32
+ JSON.load(out)
33
+ else
34
+ raise CliError, 'Error acquiring token from the Azure az CLI'
35
+ end
34
36
  end
35
37
  end
36
38
  end
@@ -17,7 +17,7 @@ module Armrest::Api::Auth
17
17
  return @@available unless @@available.nil?
18
18
  url = "metadata/instance"
19
19
  resp = nil
20
- with_open_timeout(0.5) do
20
+ with_open_timeout(1.5) do
21
21
  resp = get(url)
22
22
  end
23
23
  @@available = resp.code == "200"
data/lib/armrest/auth.rb CHANGED
@@ -41,7 +41,6 @@ module Armrest
41
41
  end
42
42
 
43
43
  def cli_credentials
44
- return unless File.exist?("#{ENV['HOME']}/.azure/accessTokens.json")
45
44
  Armrest::Api::Auth::CLI.new(@options)
46
45
  end
47
46
  end
@@ -1,3 +1,3 @@
1
1
  module Armrest
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: armrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-03 00:00:00.000000000 Z
11
+ date: 2023-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
272
  - !ruby/object:Gem::Version
273
273
  version: '0'
274
274
  requirements: []
275
- rubygems_version: 3.3.12
275
+ rubygems_version: 3.4.20
276
276
  signing_key:
277
277
  specification_version: 4
278
278
  summary: Ruby Azure REST API Library