Commit 839962d2 authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason

Generate a longer agentk token by default

See https://gitlab.com/gitlab-org/gitlab/-/issues/270218
parent 0745b989
......@@ -3,7 +3,7 @@
module Clusters
class AgentToken < ApplicationRecord
include TokenAuthenticatable
add_authentication_token_field :token, encrypted: :required
add_authentication_token_field :token, encrypted: :required, token_generator: -> { Devise.friendly_token(50) }
self.table_name = 'cluster_agent_tokens'
......
---
title: Generate a longer Kuberntes Agent Token by default (was 20 characters, now 50)
merge_request: 45620
author:
type: changed
......@@ -14,5 +14,10 @@ RSpec.describe Clusters::AgentToken do
expect(agent_token.token).to be_present
end
it 'is at least 50 characters' do
agent_token = create(:cluster_agent_token)
expect(agent_token.token.length).to be >= 50
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment