Skip to main content

v8.2.18

This release adds a required name field to API tokens, replacing the description field introduced in v8.2.14.

Breaking Changes​

API Token description Replaced by Required name​

API tokens now have a required name field (string, max 100 characters) to identify what each token is used for. This replaces the description field introduced in v8.2.14 — the cm_admin:add_description_to_api_token generator has been removed, so run the name generator below even if you already generated the description migration.

The index page lists name as the first column and adds a search-by-name filter. A new Edit page lets users rename a token; the token value and other fields stay read-only.

Migration Steps​

  1. Run the Add Name to API Token generator, then migrate:
rails generate cm_admin:add_name_to_api_token
rails db:migrate

The generated migration:

  • Adds a name string column to api_tokens (skipped if the column already exists).
  • Backfills existing records with 'Unnamed Token'.
  • Drops the description column if it exists — this cleans up apps that ran v8.2.14's add_description_to_api_token generator.
warning

Existing description values are not carried over to name. If you ran the v8.2.14 generator and want to keep the descriptions, copy them across in the generated migration before remove_column runs, for example:

execute "UPDATE api_tokens SET name = description WHERE name IS NULL"
  1. Pass a name wherever your application creates ApiToken records directly. ApiToken validates name presence (and a 100-character limit) for every token type, so ApiToken.create(...) calls that worked before now fail validation without one. The admin form already requires a name.

Checklist​

  1. Run rails generate cm_admin:add_name_to_api_token && rails db:migrate (skip add_description_to_api_token — it has been removed).
  2. Set a name in any code that creates ApiToken records directly.