mirror of
				https://github.com/discourse/discourse.git
				synced 2025-02-25 18:55:32 -06:00 
			
		
		
		
	FEATURE: Hash user API keys in the database (#9344)
The 'key' column will be dropped in a future commit.
This commit is contained in:
		@@ -3,12 +3,12 @@
 | 
			
		||||
require 'rails_helper'
 | 
			
		||||
 | 
			
		||||
describe 'user api keys integration' do
 | 
			
		||||
  fab!(:user_api_key) { Fabricate(:readonly_user_api_key) }
 | 
			
		||||
 | 
			
		||||
  it 'updates last used time on use' do
 | 
			
		||||
    freeze_time
 | 
			
		||||
 | 
			
		||||
    user_api_key = Fabricate(:readonly_user_api_key)
 | 
			
		||||
    user_api_key.update_columns(last_used_at: 7.days.ago)
 | 
			
		||||
 | 
			
		||||
    get '/session/current.json', headers: {
 | 
			
		||||
      HTTP_USER_API_KEY: user_api_key.key,
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user