aptible-api 1.11.1 → 1.12.0

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: 3fda12c54dc7cba1dd90ff4fdfb14e03cb0dbc1b61c763a095e505510f72de30
4
- data.tar.gz: bce7f98684c73e22d92632646c1b2c556918c332e67898211156a155bc95ad90
3
+ metadata.gz: 22751cd8f83a41e885d1941e0fcfee163723787457e9d1eaeb0f22ed1f7c6a72
4
+ data.tar.gz: b2a00b6378b7cf347552305600fa788a2bb8bcafdd65e4a575ec44f388be1ef4
5
5
  SHA512:
6
- metadata.gz: 8270645847647f22457f05a4cb8ad865b435f1234fb87af3f88f2bf2d7e9b18a36b0f8c6708a63cfc23d77206d8f26360b9e8e51c096051c114117d0ca0016e7
7
- data.tar.gz: c99d860a1153c4c24c6360aa285cab54842ac150609be252e8506a48714533b752a2971685948f9fefa1005c1ff272c6aaa8a71aeffbe7b784198361c8ab1944
6
+ metadata.gz: 4756a35c275266f7cabf69686b44a78549251c1b6cc4875dbb3843ab544f4f3dbac08954829d80ef7848a887da61d249bbdaca38acced1d6b0207dfb7b3966a8
7
+ data.tar.gz: 0d4ee687358c9e37aea58310e08aa3f7cdb856b6bb5e85d51b82f41a39ce5d091d834ad4cc57e78de744545b4a002f1f3923f7ccb9bab0c85f736e74afbb00f4
data/.gitignore CHANGED
@@ -15,4 +15,5 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ vendor
18
19
  /docker/ruby-*/
data/Makefile CHANGED
@@ -2,12 +2,18 @@
2
2
  export COMPOSE_IGNORE_ORPHANS ?= true
3
3
  export RUBY_VERSION ?= 2.3.1
4
4
  RUBY_VERSION_MAJOR = $(word 1,$(subst ., ,$(RUBY_VERSION)))
5
+ RUBY_VERSION_MINOR = $(word 2,$(subst ., ,$(RUBY_VERSION)))
5
6
  export BUNDLER_VERSION ?=
6
7
  ifeq ($(BUNDLER_VERSION),)
7
8
  ifeq ($(RUBY_VERSION_MAJOR),2)
9
+ # Use old bundler for Ruby 2.3-2.6; Ruby 2.7 needs bundler 2.x to avoid resolver bugs
10
+ ifeq ($(RUBY_VERSION_MINOR),7)
11
+ export BUNDLER_VERSION = 2.4.22
12
+ else
8
13
  export BUNDLER_VERSION = 1.17.3
9
14
  endif
10
15
  endif
16
+ endif
11
17
  PROJECT_NAME = $(shell ls *.gemspec | sed 's/\.gemspec//')
12
18
  export COMPOSE_PROJECT_NAME ?= $(PROJECT_NAME)-$(subst .,_,$(RUBY_VERSION))
13
19
 
@@ -5,6 +5,7 @@ module Aptible
5
5
  class Account < Resource
6
6
  belongs_to :stack
7
7
 
8
+ has_many :ai_tokens
8
9
  has_many :apps
9
10
  has_many :backups
10
11
  has_many :certificates
@@ -0,0 +1,39 @@
1
+ module Aptible
2
+ module Api
3
+ class AiToken < Resource
4
+ belongs_to :account
5
+
6
+ field :id
7
+ field :name
8
+ field :created_at
9
+ field :updated_at
10
+ field :expires_at
11
+ field :last_used_at
12
+ field :revoked_at
13
+ field :gateway_url
14
+ # User (on whose behalf) details
15
+ field :created_by_user_id
16
+ field :created_by_user_name
17
+ field :created_by_user_email
18
+ # Actor (who performed) details
19
+ field :created_by_actor_id
20
+ field :created_by_actor_name
21
+ field :created_by_actor_email
22
+ # Revoked by user details
23
+ field :revoked_by_user_id
24
+ field :revoked_by_user_name
25
+ field :revoked_by_user_email
26
+ # Revoked by actor details
27
+ field :revoked_by_actor_id
28
+ field :revoked_by_actor_name
29
+ field :revoked_by_actor_email
30
+
31
+ # Note: The 'token' field from API response is accessible via
32
+ # attributes['token'] to avoid conflict with aptible-resource's
33
+ # internal token handling (used for auth bearer token)
34
+ def api_key
35
+ attributes['token']
36
+ end
37
+ end
38
+ end
39
+ end
@@ -27,6 +27,23 @@ module Aptible
27
27
  auth = Aptible::Auth::Organization.new(token: token, headers: headers)
28
28
  @organization = auth.find_by_url(organization_url)
29
29
  end
30
+
31
+ def check!
32
+ response = HyperResource::Link.new(
33
+ self,
34
+ 'href' => "#{href}/check"
35
+ ).get
36
+ ExternalAwsAccountCheckResponse.new(
37
+ state: response.attributes['state'],
38
+ checks: (response.attributes['checks'] || []).map do |c|
39
+ ExternalAwsAccountCheck.new(
40
+ check_name: c['check_name'],
41
+ state: c['state'],
42
+ details: c['details']
43
+ )
44
+ end
45
+ )
46
+ end
30
47
  end
31
48
  end
32
49
  end
@@ -0,0 +1,22 @@
1
+ module Aptible
2
+ module Api
3
+ class ExternalAwsAccountCheckResponse
4
+ attr_reader :state, :checks
5
+
6
+ def initialize(state:, checks:)
7
+ @state = state
8
+ @checks = checks
9
+ end
10
+ end
11
+
12
+ class ExternalAwsAccountCheck
13
+ attr_reader :check_name, :state, :details
14
+
15
+ def initialize(check_name:, state:, details:)
16
+ @check_name = check_name
17
+ @state = state
18
+ @details = details
19
+ end
20
+ end
21
+ end
22
+ end
@@ -15,6 +15,7 @@ module Aptible
15
15
  end
16
16
 
17
17
  require 'aptible/api/account'
18
+ require 'aptible/api/ai_token'
18
19
  require 'aptible/api/ami'
19
20
  require 'aptible/api/ami_release'
20
21
  require 'aptible/api/app'
@@ -57,6 +58,7 @@ require 'aptible/api/persistent_disk'
57
58
  require 'aptible/api/disk_attachment'
58
59
  require 'aptible/api/maintenance'
59
60
  require 'aptible/api/vpn_tunnel'
61
+ require 'aptible/api/external_aws_account_check_response'
60
62
  require 'aptible/api/external_aws_account'
61
63
  require 'aptible/api/external_aws_resource'
62
64
  require 'aptible/api/external_aws_database_credential'
@@ -4,8 +4,8 @@ module Aptible
4
4
  belongs_to :resource
5
5
 
6
6
  field :id
7
- field :keys
8
- field :sensitive_keys
7
+ field :settings
8
+ field :sensitive_settings
9
9
  field :created_at, type: Time
10
10
  end
11
11
  end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Api
3
- VERSION = '1.11.1'.freeze
3
+ VERSION = '1.12.0'.freeze
4
4
  end
5
5
  end
@@ -6,12 +6,17 @@ describe Aptible::Api do
6
6
  it 'should have a configurable root_url' do
7
7
  config = described_class.configuration
8
8
  expect(config).to be_a GemConfig::Configuration
9
- expect(config.root_url).to eq 'https://api.aptible.com'
9
+ with_env 'APTIBLE_API_ROOT_URL', nil do
10
+ load 'aptible/api.rb'
11
+ config.reset
12
+ expect(config.root_url).to eq 'https://api.aptible.com'
13
+ end
10
14
  end
11
15
 
12
- pending 'uses ENV["APTIBLE_API_ROOT_URL"] if defined' do
16
+ it 'uses ENV["APTIBLE_API_ROOT_URL"] if defined' do
13
17
  config = described_class.configuration
14
18
  with_env 'APTIBLE_API_ROOT_URL', 'http://foobar.com' do
19
+ load 'aptible/api.rb'
15
20
  config.reset
16
21
  expect(config.root_url).to eq 'http://foobar.com'
17
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-16 00:00:00.000000000 Z
11
+ date: 2025-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-auth
@@ -190,6 +190,7 @@ files:
190
190
  - lib/aptible/api/account.rb
191
191
  - lib/aptible/api/active_plan.rb
192
192
  - lib/aptible/api/agent.rb
193
+ - lib/aptible/api/ai_token.rb
193
194
  - lib/aptible/api/ami.rb
194
195
  - lib/aptible/api/ami_release.rb
195
196
  - lib/aptible/api/app.rb
@@ -210,6 +211,7 @@ files:
210
211
  - lib/aptible/api/ephemeral_container.rb
211
212
  - lib/aptible/api/ephemeral_session.rb
212
213
  - lib/aptible/api/external_aws_account.rb
214
+ - lib/aptible/api/external_aws_account_check_response.rb
213
215
  - lib/aptible/api/external_aws_database_credential.rb
214
216
  - lib/aptible/api/external_aws_resource.rb
215
217
  - lib/aptible/api/image.rb