This adds a check in the route specs that TYPE_ETC ubid values are not present in responses. It then changes four models to use model-specific ubid types instead of TYPE_ETC. The original impetus for this change is to eventually remove authorization code that explicitly checks for TYPE_ETC and assumes ApiKey, which will cause problems in the future if we ever have another model using TYPE_ETC that the authorization system needs to deal with.
26 lines
748 B
Ruby
26 lines
748 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "../../model"
|
|
|
|
class PostgresMetricDestination < Sequel::Model
|
|
many_to_one :postgres_resource, key: :postgres_resource_id
|
|
|
|
include ResourceMethods
|
|
|
|
plugin :column_encryption do |enc|
|
|
enc.column :password
|
|
end
|
|
end
|
|
|
|
# Table: postgres_metric_destination
|
|
# Columns:
|
|
# id | uuid | PRIMARY KEY
|
|
# postgres_resource_id | uuid | NOT NULL
|
|
# url | text | NOT NULL
|
|
# username | text | NOT NULL
|
|
# password | text | NOT NULL
|
|
# Indexes:
|
|
# postgres_metric_destination_pkey | PRIMARY KEY btree (id)
|
|
# Foreign key constraints:
|
|
# postgres_metric_destination_postgres_resource_id_fkey | (postgres_resource_id) REFERENCES postgres_resource(id)
|