diff --git a/db/migrate/20231220202003_add_ip_ranges_to_api_token.rb b/db/migrate/20231220202003_add_ip_ranges_to_api_token.rb new file mode 100644 index 000000000..cee66ba6b --- /dev/null +++ b/db/migrate/20231220202003_add_ip_ranges_to_api_token.rb @@ -0,0 +1,5 @@ +class AddIPRangesToAPIToken < ActiveRecord::Migration[7.0] + def change + add_column :api_tokens, :authorized_networks, :inet, array: true, default: [] + end +end diff --git a/db/schema.rb b/db/schema.rb index 948530382..89de42424 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -93,6 +93,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_01_10_113623) do create_table "api_tokens", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.bigint "administrateur_id", null: false t.bigint "allowed_procedure_ids", array: true + t.inet "authorized_networks", default: [], array: true t.datetime "created_at", null: false t.string "encrypted_token", null: false t.datetime "last_v1_authenticated_at"