Skip to content

Commit 458910c

Browse files
committed
Merge branch 'master' of https://github.com/aptible/aptible-api-ruby into ext-aws-check
2 parents a993c06 + 5db552d commit 458910c

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ spec/reports
1515
test/tmp
1616
test/version_tmp
1717
tmp
18+
vendor
1819
/docker/ruby-*/

lib/aptible/api/account.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module Api
55
class Account < Resource
66
belongs_to :stack
77

8+
has_many :ai_tokens
89
has_many :apps
910
has_many :backups
1011
has_many :certificates

lib/aptible/api/ai_token.rb

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

lib/aptible/api/resource.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def root_url
1515
end
1616

1717
require 'aptible/api/account'
18+
require 'aptible/api/ai_token'
1819
require 'aptible/api/ami'
1920
require 'aptible/api/ami_release'
2021
require 'aptible/api/app'

lib/aptible/api/settings.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ class Setting < Resource
44
belongs_to :resource
55

66
field :id
7-
field :keys
8-
field :sensitive_keys
7+
field :settings
8+
field :sensitive_settings
99
field :created_at, type: Time
1010
end
1111
end

0 commit comments

Comments
 (0)