Skip to content

Add rake task to set password and an access token

Mark Lapierre requested to merge ml-add-auth-init-rake-task into master

What does this MR do?

This adds a rake task to set the default password (from Runtime::User.default_password) if it's not set already, and it creates a personal access token.

This is useful when testing on a fresh GitLab instance (e.g., an omnibus-gitlab docker image) and you don't want to have to log in and create an access token manually.

Usage example (from the gitlab/qa directory):

$ bundle exec rake  'initialize_gitlab_auth[http://gitlab.test]'
Signing in and creating the default password for the root user if it's not set already
Creating an API scoped access token for the root user
Token: s8xbMN3qMjyUyQATDWgp

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Merge request reports

Loading