Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
839962d2
Commit
839962d2
authored
Oct 19, 2020
by
Hordur Freyr Yngvason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate a longer agentk token by default
See
https://gitlab.com/gitlab-org/gitlab/-/issues/270218
parent
0745b989
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
app/models/clusters/agent_token.rb
app/models/clusters/agent_token.rb
+1
-1
changelogs/unreleased/use-longer-agentk-token.yml
changelogs/unreleased/use-longer-agentk-token.yml
+5
-0
spec/models/clusters/agent_token_spec.rb
spec/models/clusters/agent_token_spec.rb
+5
-0
No files found.
app/models/clusters/agent_token.rb
View file @
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'
...
...
changelogs/unreleased/use-longer-agentk-token.yml
0 → 100644
View file @
839962d2
---
title
:
Generate a longer Kuberntes Agent Token by default (was 20 characters, now 50)
merge_request
:
45620
author
:
type
:
changed
spec/models/clusters/agent_token_spec.rb
View file @
839962d2
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment