cloud_party 0.1.7 → 0.1.8

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
  SHA256:
3
- metadata.gz: 47d19b145dd37b914a80456721c7489e9708781ddd832f86fbf8d97674561511
4
- data.tar.gz: 5542d0d92ab63035f9f53c71261e6d73059463f31087ff995dc775bf784831d0
3
+ metadata.gz: 7420fa2c42d6801e11409e4f80fd857fde0fbde1c03fbee011d7dc2c29b92535
4
+ data.tar.gz: 929a90535e66420733ca0070b042f092721ab36f6ef252821dffb251e37d155a
5
5
  SHA512:
6
- metadata.gz: f159ba7a29c319565f148254117687e376532cfdde407ca35bde2379c881f522654fa7553e5b46369920dc753b831198c44c56090161e095c2716a43d5f88cc1
7
- data.tar.gz: 18fbd570c394d82c8dafe037fd730f1a3e54e91ff1515e2a9a04ad629a42b83c9bffd1e769234c60902002f2b6b13255537b83bb836760111a6d069dafa3ec34
6
+ metadata.gz: 443c6d4fd3e540e56b013d46165b7a530bb086533e77d119ce3e206d89f5b0656f7546dcb0a8c34b7fdcaf70cbf89191d20959ec24b4fcb09f5246cb7a6b89e2
7
+ data.tar.gz: 40cffe6a2ec7cc7e689c558f5b514e2c43c3e0e4cca5ebc3dceed7126034b9a569bafae502903628dfae07e101cafbc7aa5770f3033873c6ea017434b637b92b
data/README.md CHANGED
@@ -1,9 +1,6 @@
1
1
  # CloudParty
2
2
  HTTParty based library for Cloudflare
3
3
 
4
- ### SonarCloud
5
- [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=iotaspencer_gem_cloud_party&metric=alert_status)](https://sonarcloud.io/dashboard?id=cloud_party)
6
- [![Code Smell](https://sonarcloud.io/api/project_badges/measure?project=iotaspencer_gem_cloud_party&metric=code_smells)](https://sonarcloud.io/dashboard?id=cloud_party)
7
4
 
8
5
  ### Badges
9
6
  [![Gem Version](https://badge.fury.io/rb/cloud_party.svg)](https://badge.fury.io/rb/cloud_party)
@@ -50,13 +47,14 @@ Two configurations are applicable for setup currently,
50
47
  ```yaml
51
48
  email: 'email@here.com'
52
49
  api-key: 'abcdefabcdef1234561234567890'
50
+ token: 'ABCDEFG123456789ABCDEF
53
51
  ```
54
52
  </p>
55
53
  </details>
56
54
 
57
55
  ```ruby
58
56
  require 'cloud_party'
59
- connection = CloudParty.connect
57
+ connection =
60
58
  ```
61
59
 
62
60
  #### GET your user account details
data/cloud_party.gemspec CHANGED
@@ -8,7 +8,7 @@ spec = Gem::Specification.new do |s|
8
8
  s.name = 'cloud_party'
9
9
  s.version = CloudParty::VERSION
10
10
  s.authors = ['Ken Spencer']
11
- s.email = ['me+gems@iotaspencer.me']
11
+ s.email = ['me@iotaspencer.me']
12
12
 
13
13
  s.summary = "Thin Ruby wrapper around Cloudflare's V4 API. Based on https://github.com/trev/rubyflare"
14
14
  s.description = "Thin Ruby wrapper around Cloudflare's V4 API for good measure!"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
-
2
+ require 'etc'
3
3
  require 'app_configuration'
4
4
  module CloudParty
5
5
  class Config
@@ -18,6 +18,7 @@ module CloudParty
18
18
  end
19
19
  @email = cp_config.email || cfcli_config.email
20
20
  @api_key = cp_config.api_key || cfcli_config.api_key
21
+ @token = cp_config.token || cfcli_config.token
21
22
  end
22
23
 
23
24
  # @return [String] the email string
@@ -29,5 +30,9 @@ module CloudParty
29
30
  def api_key
30
31
  @api_key
31
32
  end
33
+
34
+ # @return [String] the cloudflare api token
35
+ def token
36
+ @token
32
37
  end
33
38
  end
@@ -7,9 +7,8 @@ module CloudParty
7
7
  class Accounts
8
8
  include CloudParty::Context
9
9
  include HTTParty
10
- base_uri 'api.cloudflare.com:443/client/v4'
11
- headers 'X-Auth-Email' => cfg.email,
12
- 'X-Auth-Key' => cfg.api_key,
10
+ base_uri 'https://api.cloudflare.com/client/v4'
11
+ headers 'Authorization' => "Bearer #{CloudParty::Config.token}",
13
12
  'Content-Type' => 'application/json',
14
13
  'User-Agent' => "CloudParty/#{CloudParty::VERSION}"
15
14
 
@@ -13,9 +13,8 @@ module CloudParty
13
13
  class DNSRecords
14
14
  include CloudParty::Context
15
15
  include HTTParty
16
- base_uri 'api.cloudflare.com:443/client/v4'
17
- headers 'X-Auth-Email' => cfg.email,
18
- 'X-Auth-Key' => cfg.api_key,
16
+ base_uri 'https://api.cloudflare.com/client/v4'
17
+ headers 'Authorization' => "Bearer #{CloudParty::Config.token}",
19
18
  'Content-Type' => 'application/json',
20
19
  'User-Agent' => "CloudParty/#{CloudParty::VERSION}"
21
20
 
@@ -7,9 +7,8 @@ module CloudParty
7
7
  class IPs
8
8
  include CloudParty::Context
9
9
  include HTTParty
10
- base_uri 'api.cloudflare.com:443/client/v4'
11
- headers 'X-Auth-Email' => cfg.email,
12
- 'X-Auth-Key' => cfg.api_key,
10
+ base_uri 'https://api.cloudflare.com/client/v4'
11
+ headers 'Authorization' => "Bearer #{CloudParty::Config.token}",
13
12
  'Content-Type' => 'application/json',
14
13
  'User-Agent' => "CloudParty/#{CloudParty::VERSION}"
15
14
 
@@ -7,9 +7,8 @@ module CloudParty
7
7
  class Memberships
8
8
  include CloudParty::Context
9
9
  include HTTParty
10
- base_uri 'api.cloudflare.com:443/client/v4'
11
- headers 'X-Auth-Email' => cfg.email,
12
- 'X-Auth-Key' => cfg.api_key,
10
+ base_uri 'https://api.cloudflare.com/client/v4'
11
+ headers 'Authorization' => "Bearer #{CloudParty::Config.token}",
13
12
  'Content-Type' => 'application/json',
14
13
  'User-Agent' => "CloudParty/#{CloudParty::VERSION}"
15
14
 
@@ -7,9 +7,8 @@ module CloudParty
7
7
  class Zones
8
8
  include CloudParty::Context
9
9
  include HTTParty
10
- base_uri 'api.cloudflare.com:443/client/v4'
11
- headers 'X-Auth-Email' => cfg.email,
12
- 'X-Auth-Key' => cfg.api_key,
10
+ base_uri 'https://api.cloudflare.com/client/v4'
11
+ headers 'Authorization' => "Bearer #{CloudParty::Config.token}",
13
12
  'Content-Type' => 'application/json',
14
13
  'User-Agent' => "CloudParty/#{CloudParty::VERSION}"
15
14
 
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- module CloudParty
4
- VERSION = '0.1.7'
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ module CloudParty
4
+ VERSION = '0.1.8'
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud_party
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-18 00:00:00.000000000 Z
11
+ date: 2024-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -172,7 +172,7 @@ dependencies:
172
172
  version: 0.16.2
173
173
  description: Thin Ruby wrapper around Cloudflare's V4 API for good measure!
174
174
  email:
175
- - me+gems@iotaspencer.me
175
+ - me@iotaspencer.me
176
176
  executables:
177
177
  - console
178
178
  - setup
@@ -255,8 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  - !ruby/object:Gem::Version
256
256
  version: '0'
257
257
  requirements: []
258
- rubyforge_project:
259
- rubygems_version: 2.7.6.2
258
+ rubygems_version: 3.5.22
260
259
  signing_key:
261
260
  specification_version: 4
262
261
  summary: Thin Ruby wrapper around Cloudflare's V4 API. Based on https://github.com/trev/rubyflare