feat: encrypt auth config

This commit is contained in:
Shivam Mishra
2026-04-06 19:52:16 +05:30
parent 118270d2e8
commit 3514ed61d6
3 changed files with 19 additions and 3 deletions
@@ -0,0 +1,13 @@
class ChangeAuthConfigToTextInCaptainCustomTools < ActiveRecord::Migration[7.1]
def up
change_column :captain_custom_tools, :auth_config, :text, default: nil
end
def down
execute <<~SQL.squish
ALTER TABLE captain_custom_tools
ALTER COLUMN auth_config TYPE jsonb USING auth_config::jsonb,
ALTER COLUMN auth_config SET DEFAULT '{}'::jsonb
SQL
end
end
+2 -2
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2026_03_24_102005) do
ActiveRecord::Schema[7.1].define(version: 2026_04_06_140414) do
# These extensions should be enabled to support this database
enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
@@ -334,7 +334,7 @@ ActiveRecord::Schema[7.1].define(version: 2026_03_24_102005) do
t.text "request_template"
t.text "response_template"
t.string "auth_type", default: "none"
t.jsonb "auth_config", default: {}
t.text "auth_config"
t.jsonb "param_schema", default: []
t.boolean "enabled", default: true, null: false
t.datetime "created_at", null: false