Commit 965377e5 authored by Thong Kuah's avatar Thong Kuah

Merge branch 'use-longer-agentk-token' into 'master'

Generate a longer agentk token by default

See merge request gitlab-org/gitlab!45620
parents 2c0cdc7f 839962d2
......@@ -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