2020-07-20 05:09:22 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :cluster_agent_token, class: 'Clusters::AgentToken' do
|
|
|
|
association :agent, factory: :cluster_agent
|
2022-05-11 14:07:55 -04:00
|
|
|
association :created_by_user, factory: :user
|
2020-07-20 05:09:22 -04:00
|
|
|
|
|
|
|
token_encrypted { Gitlab::CryptoHelper.aes256_gcm_encrypt(SecureRandom.hex(50)) }
|
2021-03-01 19:11:26 -05:00
|
|
|
|
|
|
|
sequence(:name) { |n| "agent-token-#{n}" }
|
2022-01-11 10:15:55 -05:00
|
|
|
|
|
|
|
trait :revoked do
|
|
|
|
status { :revoked }
|
|
|
|
end
|
2020-07-20 05:09:22 -04:00
|
|
|
end
|
|
|
|
end
|