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 @@ ...@@ -2,14 +2,22 @@
require './spec/support/sidekiq_middleware' 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 Gitlab::Seeder.quiet do
PersonalAccessToken.create!( User.find_by(username: 'root').tap do |user|
user_id: User.find_by(username: 'root').id, params = {
name: "seeded-api-token", scopes: scopes.map(&:to_s),
scopes: Gitlab::Auth.all_available_scopes, name: 'seeded-api-token'
token_digest: "/O0jfLERYT/L5gG8nfByQxqTj43TeLlRzOtJGTzRsbQ=" }
)
user.personal_access_tokens.build(params).tap do |pat|
pat.set_token(token)
pat.save!
end
end
print '.' print '.'
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