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: 3ca6c95d0df62b56b5396adc3bdfcb7fc10661c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

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

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

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

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