Class: Doorkeeper::GrantReuseRevocationGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/doorkeeper/grant_reuse_revocation_generator.rb

Overview

Generates migration to add the access token reference column to the access grants table, enabling revocation of previously issued tokens when an authorization code is reused (RFC 6749 §4.1.2, §10.5).

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



16
17
18
# File 'lib/generators/doorkeeper/grant_reuse_revocation_generator.rb', line 16

def self.next_migration_number(path)
  ActiveRecord::Generators::Base.next_migration_number(path)
end

Instance Method Details

#grant_reuse_revocationObject



20
21
22
23
24
25
26
27
28
# File 'lib/generators/doorkeeper/grant_reuse_revocation_generator.rb', line 20

def grant_reuse_revocation
  return unless no_access_token_id_column?

  migration_template(
    "add_access_token_to_access_grants.rb.erb",
    "db/migrate/add_access_token_to_access_grants.rb",
    migration_version: migration_version,
  )
end