aptible-api 1.10.0 → 1.11.2
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 +4 -4
- data/.github/workflows/ci.yml +5 -12
- data/.gitignore +2 -0
- data/Dockerfile +20 -0
- data/Gemfile +8 -5
- data/Makefile +68 -0
- data/Procfile +1 -1
- data/aptible-api.gemspec +0 -1
- data/docker-compose.yml +12 -0
- data/lib/aptible/api/account.rb +2 -0
- data/lib/aptible/api/ai_token.rb +39 -0
- data/lib/aptible/api/app.rb +1 -0
- data/lib/aptible/api/app_external_aws_rds_connection.rb +15 -0
- data/lib/aptible/api/external_aws_account.rb +1 -0
- data/lib/aptible/api/external_aws_database_credential.rb +15 -0
- data/lib/aptible/api/external_aws_resource.rb +2 -0
- data/lib/aptible/api/resource.rb +3 -0
- data/lib/aptible/api/settings.rb +2 -2
- data/lib/aptible/api/version.rb +1 -1
- data/spec/aptible/api/operation_spec.rb +0 -2
- metadata +8 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bd9276b8e979050ccc45108a050a16e142cf577b2ef6aadc274455e4975061cc
|
|
4
|
+
data.tar.gz: 9a5929e1d7acbc030b24ecbaa6816c59769d2d43805854a5137b76e127a3d201
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1e61a0b6c7de497cb9fd60e7258a4395ca55f6c5237ba63124016ed72c68e84b0ac0f9ac143838a8210659145afebd187fb9a1891d2878ce34a7cf793f7f2cf0
|
|
7
|
+
data.tar.gz: 3e4a18a1f5dc7254a002fc8b88b147d2cc8bfcb1bb0f13a80eb9e76a825f2e2d30f00db7e81631587bded8670e8a63e36195e9e2d79ad5c0a87d35dddedbe04a
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -17,24 +17,17 @@ jobs:
|
|
|
17
17
|
strategy:
|
|
18
18
|
fail-fast: false
|
|
19
19
|
matrix:
|
|
20
|
-
RUBY_VERSION: [2.
|
|
20
|
+
RUBY_VERSION: [2.3, 2.4, 2.5, 2.6, 2.7, 3.1, 3.2, 3.3, 3.4]
|
|
21
|
+
env:
|
|
22
|
+
RUBY_VERSION: ${{ matrix.RUBY_VERSION }}
|
|
21
23
|
steps:
|
|
22
24
|
- name: Check out code
|
|
23
25
|
uses: actions/checkout@v4
|
|
24
26
|
with:
|
|
25
27
|
persist-credentials: false
|
|
26
28
|
|
|
27
|
-
- name: Install Ruby
|
|
28
|
-
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
|
|
29
|
-
with:
|
|
30
|
-
ruby-version: ${{ matrix.RUBY_VERSION }}
|
|
31
|
-
bundler: 1.17.3
|
|
32
|
-
|
|
33
|
-
- name: Bundle install
|
|
34
|
-
run: bundle install
|
|
35
|
-
|
|
36
29
|
- name: Rubocop
|
|
37
|
-
run:
|
|
30
|
+
run: make lint
|
|
38
31
|
|
|
39
32
|
- name: Rspec
|
|
40
|
-
run:
|
|
33
|
+
run: make test
|
data/.gitignore
CHANGED
data/Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
ARG RUBY_VERSION=2.3.1
|
|
2
|
+
FROM ruby:${RUBY_VERSION}
|
|
3
|
+
|
|
4
|
+
ARG BUNDLER_VERSION=1.17.3
|
|
5
|
+
ENV BUNDLER_VERSION=${BUNDLER_VERSION}
|
|
6
|
+
RUN if [ "${BUNDLER_VERSION}" != "" ] ; then \
|
|
7
|
+
gem install bundler -v "${BUNDLER_VERSION}" ; \
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
WORKDIR /app
|
|
11
|
+
COPY Gemfile /app/
|
|
12
|
+
COPY aptible-api.gemspec /app/
|
|
13
|
+
RUN mkdir -p /app/lib/aptible/api/
|
|
14
|
+
COPY lib/aptible/api/version.rb /app/lib/aptible/api/
|
|
15
|
+
|
|
16
|
+
RUN bundle install
|
|
17
|
+
|
|
18
|
+
COPY . /app
|
|
19
|
+
|
|
20
|
+
CMD ["bash"]
|
data/Gemfile
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
# ActiveSupport version depends on Ruby version for compatibility
|
|
4
|
+
# ActiveSupport 4.x is incompatible with Ruby 2.7+ (BigDecimal.new removed)
|
|
5
|
+
if RUBY_VERSION < '2.7'
|
|
6
|
+
gem 'activesupport', '~> 4.0'
|
|
7
|
+
else
|
|
8
|
+
gem 'activesupport', '>= 5.2'
|
|
9
|
+
end
|
|
10
|
+
gem "irb", "~> 1.1"
|
|
8
11
|
|
|
9
12
|
# Specify your gem's dependencies in aptible-api.gemspec
|
|
10
13
|
gemspec
|
data/Makefile
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
export COMPOSE_IGNORE_ORPHANS ?= true
|
|
3
|
+
export RUBY_VERSION ?= 2.3.1
|
|
4
|
+
RUBY_VERSION_MAJOR = $(word 1,$(subst ., ,$(RUBY_VERSION)))
|
|
5
|
+
export BUNDLER_VERSION ?=
|
|
6
|
+
ifeq ($(BUNDLER_VERSION),)
|
|
7
|
+
ifeq ($(RUBY_VERSION_MAJOR),2)
|
|
8
|
+
export BUNDLER_VERSION = 1.17.3
|
|
9
|
+
endif
|
|
10
|
+
endif
|
|
11
|
+
PROJECT_NAME = $(shell ls *.gemspec | sed 's/\.gemspec//')
|
|
12
|
+
export COMPOSE_PROJECT_NAME ?= $(PROJECT_NAME)-$(subst .,_,$(RUBY_VERSION))
|
|
13
|
+
|
|
14
|
+
default: help
|
|
15
|
+
|
|
16
|
+
## Show this help message
|
|
17
|
+
help:
|
|
18
|
+
@echo "\n\033[1;34mAvailable targets:\033[0m\n"
|
|
19
|
+
@awk 'BEGIN {FS = ":"; prev = ""} \
|
|
20
|
+
/^## / {prev = substr($$0, 4); next} \
|
|
21
|
+
/^[a-zA-Z_-]+:/ {if (prev != "") printf " \033[1;36m%-20s\033[0m %s\n", $$1, prev; prev = ""} \
|
|
22
|
+
{prev = ""}' $(MAKEFILE_LIST) | sort
|
|
23
|
+
@echo
|
|
24
|
+
|
|
25
|
+
BUILD_ARGS ?=
|
|
26
|
+
## Build and pull docker compose images
|
|
27
|
+
build: gemfile-lock
|
|
28
|
+
docker compose build --pull $(BUILD_ARGS)
|
|
29
|
+
|
|
30
|
+
## Create a Gemfile.lock specific to the container (i.e., for the ruby version)
|
|
31
|
+
gemfile-lock:
|
|
32
|
+
mkdir -pv ./docker/ruby-$(RUBY_VERSION)/ && \
|
|
33
|
+
echo '' > ./docker/ruby-$(RUBY_VERSION)/Gemfile.lock
|
|
34
|
+
|
|
35
|
+
## Open shell in a docker container, supports CMD=
|
|
36
|
+
bash: build
|
|
37
|
+
$(MAKE) run CMD=bash
|
|
38
|
+
|
|
39
|
+
CMD ?= bash
|
|
40
|
+
## Run command in a docker container, supports CMD=
|
|
41
|
+
run:
|
|
42
|
+
docker compose run --rm runner $(CMD)
|
|
43
|
+
|
|
44
|
+
## Run tests in a docker container, supports ARGS=
|
|
45
|
+
test: build
|
|
46
|
+
$(MAKE) test-direct ARGS="$(ARGS)"
|
|
47
|
+
|
|
48
|
+
## Run tests in a docker container without building, supports ARGS=
|
|
49
|
+
test-direct:
|
|
50
|
+
$(MAKE) run CMD="bundle exec rspec $(ARGS)"
|
|
51
|
+
|
|
52
|
+
## Run rubocop in a docker container, supports ARGS=
|
|
53
|
+
lint: build
|
|
54
|
+
$(MAKE) lint-direct ARGS="$(ARGS)"
|
|
55
|
+
|
|
56
|
+
## Run rubocop in a docker container without building, supports ARGS=
|
|
57
|
+
lint-direct:
|
|
58
|
+
$(MAKE) run CMD="bundle exec rake rubocop $(ARGS)"
|
|
59
|
+
|
|
60
|
+
## Clean up docker compose resources
|
|
61
|
+
clean: clean-gemfile-lock
|
|
62
|
+
docker compose down --remove-orphans --volumes
|
|
63
|
+
|
|
64
|
+
## Clean up the container specific Gemfile.lock
|
|
65
|
+
clean-gemfile-lock:
|
|
66
|
+
rm -v ./docker/ruby-$(RUBY_VERSION)/Gemfile.lock ||:
|
|
67
|
+
|
|
68
|
+
.PHONY: build bash test
|
data/Procfile
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
console: bundle exec
|
|
1
|
+
console: bundle exec irb -r aptible/api -r aptible/auth
|
data/aptible-api.gemspec
CHANGED
|
@@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
|
|
28
28
|
spec.add_development_dependency 'activesupport'
|
|
29
29
|
spec.add_development_dependency 'aptible-tasks', '>= 0.2.0'
|
|
30
|
-
spec.add_development_dependency 'bundler', '~> 1.3'
|
|
31
30
|
spec.add_development_dependency 'foreman'
|
|
32
31
|
spec.add_development_dependency 'pry'
|
|
33
32
|
spec.add_development_dependency 'rake', '~> 12.3.3'
|
data/docker-compose.yml
ADDED
data/lib/aptible/api/account.rb
CHANGED
|
@@ -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
|
|
@@ -18,6 +19,7 @@ module Aptible
|
|
|
18
19
|
has_many :vhosts
|
|
19
20
|
has_many :service_sizing_policies
|
|
20
21
|
has_many :backup_retention_policies
|
|
22
|
+
has_many :operations
|
|
21
23
|
embeds_many :log_drains
|
|
22
24
|
|
|
23
25
|
field :id
|
|
@@ -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
|
data/lib/aptible/api/app.rb
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Aptible
|
|
2
|
+
module Api
|
|
3
|
+
class AppExternalAwsRdsConnection < Resource
|
|
4
|
+
belongs_to :app
|
|
5
|
+
belongs_to :external_aws_resource
|
|
6
|
+
belongs_to :external_aws_account
|
|
7
|
+
|
|
8
|
+
field :id
|
|
9
|
+
field :database_name
|
|
10
|
+
field :database_user
|
|
11
|
+
field :created_at, type: Time
|
|
12
|
+
field :updated_at, type: Time
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Aptible
|
|
2
|
+
module Api
|
|
3
|
+
class ExternalAwsDatabaseCredential < Resource
|
|
4
|
+
belongs_to :external_aws_resource
|
|
5
|
+
has_many :operations
|
|
6
|
+
|
|
7
|
+
field :id
|
|
8
|
+
field :type
|
|
9
|
+
field :default, type: Aptible::Resource::Boolean
|
|
10
|
+
field :connection_url
|
|
11
|
+
field :created_at, type: Time
|
|
12
|
+
field :updated_at, type: Time
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/lib/aptible/api/resource.rb
CHANGED
|
@@ -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'
|
|
@@ -59,3 +60,5 @@ require 'aptible/api/maintenance'
|
|
|
59
60
|
require 'aptible/api/vpn_tunnel'
|
|
60
61
|
require 'aptible/api/external_aws_account'
|
|
61
62
|
require 'aptible/api/external_aws_resource'
|
|
63
|
+
require 'aptible/api/external_aws_database_credential'
|
|
64
|
+
require 'aptible/api/app_external_aws_rds_connection'
|
data/lib/aptible/api/settings.rb
CHANGED
data/lib/aptible/api/version.rb
CHANGED
|
@@ -48,7 +48,6 @@ describe Aptible::Api::Operation do
|
|
|
48
48
|
|
|
49
49
|
it 'yields usable SSH connection arguments' do
|
|
50
50
|
expect(subject).to receive(:create_ssh_portal_connection!)
|
|
51
|
-
.with(ssh_public_key: 'some public key')
|
|
52
51
|
.and_return(ssh_portal_connection)
|
|
53
52
|
|
|
54
53
|
has_yielded = false
|
|
@@ -100,7 +99,6 @@ describe Aptible::Api::Operation do
|
|
|
100
99
|
|
|
101
100
|
it 'allows passing a custom host' do
|
|
102
101
|
expect(subject).to receive(:create_ssh_portal_connection!)
|
|
103
|
-
.with(ssh_public_key: 'some public key')
|
|
104
102
|
.and_return(ssh_portal_connection)
|
|
105
103
|
|
|
106
104
|
has_yielded = false
|
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.
|
|
4
|
+
version: 1.11.2
|
|
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-
|
|
11
|
+
date: 2025-12-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aptible-auth
|
|
@@ -94,20 +94,6 @@ dependencies:
|
|
|
94
94
|
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: 0.2.0
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: bundler
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - "~>"
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '1.3'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - "~>"
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '1.3'
|
|
111
97
|
- !ruby/object:Gem::Dependency
|
|
112
98
|
name: foreman
|
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -190,20 +176,25 @@ files:
|
|
|
190
176
|
- ".github/workflows/zizmor.yaml"
|
|
191
177
|
- ".gitignore"
|
|
192
178
|
- ".rspec"
|
|
179
|
+
- Dockerfile
|
|
193
180
|
- Gemfile
|
|
194
181
|
- LICENSE.md
|
|
182
|
+
- Makefile
|
|
195
183
|
- Procfile
|
|
196
184
|
- README.md
|
|
197
185
|
- Rakefile
|
|
198
186
|
- SECURITY.md
|
|
199
187
|
- aptible-api.gemspec
|
|
188
|
+
- docker-compose.yml
|
|
200
189
|
- lib/aptible/api.rb
|
|
201
190
|
- lib/aptible/api/account.rb
|
|
202
191
|
- lib/aptible/api/active_plan.rb
|
|
203
192
|
- lib/aptible/api/agent.rb
|
|
193
|
+
- lib/aptible/api/ai_token.rb
|
|
204
194
|
- lib/aptible/api/ami.rb
|
|
205
195
|
- lib/aptible/api/ami_release.rb
|
|
206
196
|
- lib/aptible/api/app.rb
|
|
197
|
+
- lib/aptible/api/app_external_aws_rds_connection.rb
|
|
207
198
|
- lib/aptible/api/aws_instance.rb
|
|
208
199
|
- lib/aptible/api/backup.rb
|
|
209
200
|
- lib/aptible/api/backup_retention_policy.rb
|
|
@@ -220,6 +211,7 @@ files:
|
|
|
220
211
|
- lib/aptible/api/ephemeral_container.rb
|
|
221
212
|
- lib/aptible/api/ephemeral_session.rb
|
|
222
213
|
- lib/aptible/api/external_aws_account.rb
|
|
214
|
+
- lib/aptible/api/external_aws_database_credential.rb
|
|
223
215
|
- lib/aptible/api/external_aws_resource.rb
|
|
224
216
|
- lib/aptible/api/image.rb
|
|
225
217
|
- lib/aptible/api/instance_layer_membership.rb
|