debian-mirror-gitlab/spec/factories/clusters/agent_tokens.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
416 B
Ruby
Raw Normal View History

2020-10-24 23:57:45 +05:30
# frozen_string_literal: true
FactoryBot.define do
factory :cluster_agent_token, class: 'Clusters::AgentToken' do
association :agent, factory: :cluster_agent
2022-07-16 23:28:13 +05:30
association :created_by_user, factory: :user
2020-10-24 23:57:45 +05:30
token_encrypted { Gitlab::CryptoHelper.aes256_gcm_encrypt(SecureRandom.hex(50)) }
2021-04-17 20:07:23 +05:30
sequence(:name) { |n| "agent-token-#{n}" }
2022-03-02 08:16:31 +05:30
trait :revoked do
status { :revoked }
end
2020-10-24 23:57:45 +05:30
end
end