mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Feature: User API key support (server side implementation)
- Supports throttled read and write - No support for push yet, but data is captured about intent
This commit is contained in:
19
db/migrate/20160815002002_add_user_api_keys.rb
Normal file
19
db/migrate/20160815002002_add_user_api_keys.rb
Normal file
@ -0,0 +1,19 @@
|
||||
class AddUserApiKeys < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :user_api_keys do |t|
|
||||
t.integer :user_id, null: false
|
||||
t.string :client_id, null: false
|
||||
t.string :key, null: false
|
||||
t.string :application_name, null: false
|
||||
t.boolean :read, null: false
|
||||
t.boolean :write, null: false
|
||||
t.boolean :push, null: false
|
||||
t.string :push_url
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :user_api_keys, [:key], unique: true
|
||||
add_index :user_api_keys, [:user_id]
|
||||
add_index :user_api_keys, [:client_id]
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user