discourse/spec/fabricators/user_api_key_fabricator.rb
David Taylor 23e5c605f6 DEV: Add support for allowed parameters in user api key scopes
Initially, this feature is only intended for use in core/plugins, so there is no API for requesting a parameter-scoped key. That may change in future.
2020-10-19 10:40:55 +01:00

18 lines
487 B
Ruby

# frozen_string_literal: true
Fabricator(:user_api_key_scope)
Fabricator(:readonly_user_api_key, from: :user_api_key) do
user
scopes { [Fabricate.build(:user_api_key_scope, name: 'read')] }
client_id { SecureRandom.hex }
application_name 'some app'
end
Fabricator(:bookmarks_calendar_user_api_key, from: :user_api_key) do
user
scopes { [Fabricate.build(:user_api_key_scope, name: 'bookmarks_calendar')] }
client_id { SecureRandom.hex }
application_name 'some app'
end