debian-mirror-gitlab/db/fixtures/development/25_api_personal_access_token.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
456 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
2020-10-24 23:57:45 +05:30
# Create an api access token for root user with the value:
token = 'ypCa3Dzb23o5nvsixwPA'
scopes = Gitlab::Auth.all_available_scopes
2019-07-07 11:18:12 +05:30
Gitlab::Seeder.quiet do
2020-10-24 23:57:45 +05:30
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
2019-07-07 11:18:12 +05:30
print '.'
end