Commit 3aaeb0a7 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'fix-dev-pat-digest' into 'master'

Fix dev PAT fixture creation

See merge request gitlab-org/gitlab!37517
parents 2289ce54 345b81da
......@@ -2,14 +2,22 @@
require './spec/support/sidekiq_middleware'
# Create an api access token for root user with the value: ypCa3Dzb23o5nvsixwPA
# Create an api access token for root user with the value:
token = 'ypCa3Dzb23o5nvsixwPA'
scopes = Gitlab::Auth.all_available_scopes
Gitlab::Seeder.quiet do
PersonalAccessToken.create!(
user_id: User.find_by(username: 'root').id,
name: "seeded-api-token",
scopes: Gitlab::Auth.all_available_scopes,
token_digest: "/O0jfLERYT/L5gG8nfByQxqTj43TeLlRzOtJGTzRsbQ="
)
User.find_by(username: 'root').tap do |user|
params = {
scopes: scopes.map(&:to_s),
name: 'seeded-api-token'
}
user.personal_access_tokens.build(params).tap do |pat|
pat.set_token(token)
pat.save!
end
end
print '.'
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