<commit_before># Change Log

## 2.0.0
The LTI Starter App has been updated with all the latest Node packages and Rails gems.
* Unused NPM packages have been removed. If those packages are used in other apps they will need to be re-added
* testEnvironment has been set to jsdom
* Rails 7 won't allow redirects to 3rd party urls without "allow_other_host" e.g. redirect_to(url, allow_other_host: true)

### attr_encrypted is no longer supported. Use the built in Rails 7 encryption instead
NOTE: Check the application to see if it contains any additional encrypted columns. The changes to
the starter app only include the following columns:

ApplicationInstance
  :canvas_token

Authentication
  :token
  :secret
  :refresh_token

Run:
 `bin/rails db:encryption:init`

The output will look something like this:
  `active_record_encryption:
    primary_key: <KEY>
    deterministic_key: <KEY>
    key_derivation_salt: <KEY>
  `
Add the output to the Rails credentials files using edit:
 `rails credentials:edit --environment=development`
** Be sure to set the value in development, test, and production

After running migrations run the following rake task to migrate the encrypted data:
`bundle exec rake migrate:encrypted_up`

The data can also be rolled back if needed:
`bundle exec rake migrate:encrypted_down`

## After migrating the encrypted data

* After the data has been migrated remove the extra columns:
ApplicationInstance
  :canvas_token_2

Authentication
  :token_2
  :secret_2
  :refresh_token_2

* migrate.rake can be removed

* The following migration can be added to remove the old columns
`class RemoveAttrEncryptedColumns < ActiveRecord::Migration[7.0]
  def up
    # ApplicationInstance
    remove_column :application_instances, :encrypted_canvas_token_2
    remove_column :application_instances, :encrypted_canvas_token_2_iv
    remove_column :application_instances, :encrypted_canvas_token_2_salt
<commit_msg>Added additional notes to the change log<commit_after># Change Log

## 2.0.0
The LTI Starter App has been updated with all the latest Node packages and Rails gems.
* Unused NPM packages have been removed. If those packages are used in other apps they will need to be re-added
* testEnvironment has been set to jsdom
* Rails 7 won't allow redirects to 3rd party urls without "allow_other_host" e.g. redirect_to(url, allow_other_host: true)

### attr_encrypted is no longer supported. Use the built in Rails 7 encryption instead
NOTE: Check the application to see if it contains any additional encrypted columns. The changes to
the starter app only include the following columns:

ApplicationInstance
  :canvas_token

Authentication
  :token
  :secret
  :refresh_token

Run:
 `bin/rails db:encryption:init`

The output will look something like this:
  `active_record_encryption:
    primary_key: <KEY>
    deterministic_key: <KEY>
    key_derivation_salt: <KEY>
  `
Add the output to the Rails credentials files using edit:
 `rails credentials:edit --environment=development`

** Be sure to set the value in development, test, and production. **
NOTE: This is a change to the deployment and will require that the deployment process
be updated to include these credentials

After running migrations run the following rake task to migrate the encrypted data:
`bundle exec rake migrate:encrypted_up`

The data can also be rolled back if needed:
`bundle exec rake migrate:encrypted_down`

## After migrating the encrypted data

* After the data has been migrated remove the extra columns:
ApplicationInstance
  :canvas_token_2

Authentication
  :token_2
  :secret_2
  :refresh_token_2

* migrate.rake can be removed

* The following migration can be added to remove the old columns
`class RemoveAttrEncryptedColumns < ActiveRecord::Migration[7.0]
  def up
    # ApplicationInstance
    remove_column :application_instances, :encrypted_canvas_token_2
    remove_column :application_instances, :encrypted_canvas_token_2_iv
    remove_column :application_instances, :encrypted_canvas_token_2_salt

{'fraction_non_alphanumeric': 0.0507715281234445, 'fraction_numerical': 0.007466401194624191, 'mean_word_length': 5.0254872563718145, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4567890', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1093, 'n_words': 479}