Welcome to mirror list, hosted at ThFree Co, Russian Federation.

agent_tokens.rb « clusters « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 03f765123db397ec47399300571a444e41444f58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

FactoryBot.define do
  factory :cluster_agent_token, class: 'Clusters::AgentToken' do
    association :agent, factory: :cluster_agent

    token_encrypted { Gitlab::CryptoHelper.aes256_gcm_encrypt(SecureRandom.hex(50)) }

    sequence(:name) { |n| "agent-token-#{n}" }

    trait :revoked do
      status { :revoked }
    end
  end
end