gitlab-org--gitlab-foss/doc
Douwe Maan a2ce5188fb Merge branch '2979-personal-access-tokens' into 'master'
Allow creating Personal Access Tokens through the website

Related to #2979 

- Allow a user to create personal access tokens, and use them to authenticate
- Refactor `API::Helpers` into `API::Helpers::Core` and `API::Helpers::Authentication`

# Tasks

- [ ]  #2979 (!3749)  - Personal Access Tokens
    - [x]  Basic Implementation
        - [x]  Add UI to add "Personal Access Tokens"
        - [x]  Reload `lib/api` on every request
        - [x]  Respect these tokens for API requests
        - [x]  Just a param or a header too?
        - [x]  Allow revoking tokens
        - [x]  Expire tokens
        - [x]  Left bar should have a "PAT" icon
        - [x]  Scopes?
        - [x]  Copy to Clipboard
        - [x]  Show active/inactive tokens separately
            - [x]  No need to check for expired/revoked in the appropriate places
        - [x]  Why does regular ApplicationController check for private token?
        - [x]  Support non-API requests
        - [x]  Revert (or work on) `lib/api` eager loading
    - [x]  Create MR
    - [x]  Refactoring
    - [x]  Fix tests
    - [x]  Write more tests
    - [x]  Add screenshots to MR
    - [x]  Add description of query performance to MR
    - [x]  Limit the number of queries in the `personal_access_tokens` page
    - [x]  Wait for CI to pass
    - [x]  Fix merge issues in schema.rb
    - [x]  Assign MR to endboss
    - [x]  Wait for feedback
    - [x]  Fix feedback
        - [x]  Wait for CI to pass
    - [x]  Assign to @rspeicher
    - [x]  Fix @rspeicher's comments
    - [x]  Wait for CI to pass
    - [x]  Assign back to @rspeicher
    - [x]  Write documentation and ping @axil
    - [x]  Wait for Axil to respond
    - [x]  Assign to endboss
    - [x]  Address Douwe's feedback
        - [x]  Use the `private_token` or `authentication_token` param instead of `personal_access_token`
        - [x]  Ditto for the header
    - [x]  Assign to endboss
    - [x]  Make sure CI is green
    - [x]  Address Douwe's feedback
        - [x]  Don't go through the `authenticate_user_from_private_token!` method, if a private token is supplied (or combine them)
        - [x]  In `authenticate_user_from_personal_access_token!` don't hit DB if `token_string` is `nil`
        - [x]  Use `current_user.personal_access_tokens.build` in the controller
        - [x]  Remove the "We aren't using `personal_access_token` as the root param" comment
        - [x]  `No need for = "...", we can just have the Inactive ... #{...} on the next line` in the view
        - [x]  Render dates in a (more) human format
        - [x]  CSS issue with table
        - [x]  Don't show the tokens in the UI indefinitely
        - [x]  How to implement scopes? Add-on to current impl? Doorkeeper?
    - [x]  Wait for @DouweM's comments about scopes
    - [x]  Address @DouweM's second review 
        - [x]  Try not using `native['innerHTML']`
        - [x]  use contexts for all "when ..."
        - [x]  Ensure consistency (styling) with other pages for "You don't have any tokens" message
        - [x]  "Actions" table column doesn't need a label
        - [x]  %td can be moved outside of the if/else statement
        - [x]  The header title should be "Profile Settings"
        - [x]  Can this be a `before_create`, so we don't need to use `generate`?
        - [x]  If it couldn't be revoked, will we show an error?
        - [x]  If it couldn't be saved, will we show an error?
    - [x]  Merge master
    - [x]  Update CHANGELOG entry
    - [x]  Add tests for form errors?
    - [x]  Post screenshots
    - [x]  Tag @jschatz1 for review
    - [x]  Wait for [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/0dff6fd/builds) to pass
    - [x]  Respond to @jschatz1's comments
        - [x]  Hardcoded colors should be variables
        - [x]  Should not be allowed to chose a date in the past
        - [x]  Use the same table as in the Applications tab
        - [x]  button should say "Create Personal Access Token"
        - [x]  Float the revoke to the right on the `a`
        - [x]  Change revocation message. "Are you sure you want to revoke this certificate? This action cannot be undone."
        - [x]  Date stays selected and looks selected even though date is set as "never".
        - [x]  ~~hover on the calendar button shifts~~ (not caused by this MR - happens on `milestones#new` as well)
        - [x]  Don't use the panel for the created token
            - [x]  Use a normal flash for "Your new personal access token has been created"
            - [x]  Show the input (with the token) below it full width.
            - [x]  Put the "Make sure you save it - you won't be able to access it again." message near the input
        - [x]  Have the input highlight all on single click
    - [x]  Update screenshots
    - [x]  Merge master in + conflicts
    - [x]  Assign to @jschatz1 again
    - [x]  Respond to @jschatz1's comments
        - [x]  No button for clipboard, only link
        - [x]  text-danger
        - [x]  highlight fade on that area where the token was created
    - [x]  Make sure [build](d754d99179/builds) is green
    - [x]  Assign to @jschatz1
    - [x]  Wait for [build](faa0e3f758/builds) to pass
    - [x]  Respond to @DouweM's feedback
        - [x]  move the redirect_to out of the if/else
        - [x]  certificate -> token
        - [x]  datepicker back to text field
        - [x]  combine the get_user_from_private_token and get_user_from_personal_access_token methods in ApplicationController
        - [x]  combine the get_user_from_private_token and get_user_from_personal_access_token methods in `lib/api/helpers`
        - [x]  don't need the new constants
    - [x]  Wait for [build](9d7cda3ddc/builds) to pass
    - [ ]  Wait for merge

# Screenshots
![Screen_Shot_2016-06-16_at_8.30.33_AM](/uploads/30a168964b7c5e0eb322705747829fb6/Screen_Shot_2016-06-16_at_8.30.33_AM.png)
![Screen_Shot_2016-06-16_at_8.30.44_AM](/uploads/7a8202885df6120071bbe81b215aaead/Screen_Shot_2016-06-16_at_8.30.44_AM.png)
![Screen_Shot_2016-06-16_at_8.31.02_AM](/uploads/6905c0848864e390138b771389c7a1b2/Screen_Shot_2016-06-16_at_8.31.02_AM.png)
![Screen_Shot_2016-06-16_at_8.31.29_AM](/uploads/0bc92369fb2f9bc335773f6abec421c3/Screen_Shot_2016-06-16_at_8.31.29_AM.png)

See merge request !3749
2016-06-17 14:40:24 +00:00
..
administration Merge branch 'fix-sidekiq-troubleshooting' into 'master' 2016-06-14 23:52:47 +00:00
api Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-16 08:27:37 +05:30
ci Merge branch 'environments-and-deployments' into 'master' 2016-06-15 13:48:09 +00:00
container_registry Move registry CI example to CI docs 2016-06-13 22:06:13 -07:00
customization Merge branch 'patch-1' into 'master' 2016-04-26 16:48:26 +00:00
development Update migration_style_guide.md with new details 2016-06-15 21:38:12 +00:00
downgrade_ee_to_ce Split into sections, port `downgrade_ee_to_ce` doc from EE 2016-04-21 13:07:33 +03:00
gitlab-basics Change all occurrences of doc.gitlab.com to docs.gitlab.com 2016-05-13 16:26:56 -05:00
hooks Change all occurrences of doc.gitlab.com to docs.gitlab.com 2016-05-13 16:26:56 -05:00
incoming_email Improve and finish the fallback to the In-Reply-To and References header for the reply-by-email feature 2016-03-25 13:05:15 +01:00
install Added 8.9 install/update guides 2016-06-07 15:20:40 +02:00
integration Update Google integration API workflow 2016-05-23 18:35:04 +00:00
intro Change all occurrences of doc.gitlab.com to docs.gitlab.com 2016-05-13 16:26:56 -05:00
legal Reformats confusing '[named here]' section for 3rd party code attribution 2016-02-17 17:13:06 +00:00
logs Move logs/logs.md to administration/logs.md 2016-06-13 13:52:20 +02:00
markdown Merge branch 'adambutler/gitlab-ce-feature/support-diff-of-issue-title-rename' 2016-05-20 16:23:04 -05:00
migrate_ci_to_ce errros -> errors 2016-05-29 22:34:58 -07:00
monitoring fixing typo in link #17809 2016-05-24 20:26:43 +02:00
operations succes -> success 2016-05-29 22:35:23 -07:00
permissions Improve design after review 2016-06-14 18:34:48 +02:00
profile Add documentation for U2F registration & authentication. 2016-06-06 12:50:31 +05:30
project_services Tie example config to JIRA screenshot 2016-04-13 12:28:07 +03:00
public_access Fix documentation and improve permissions code 2016-04-18 11:12:28 -03:00
raketasks Change all occurrences of doc.gitlab.com to docs.gitlab.com 2016-05-13 16:26:56 -05:00
security Change landing page when skipping confirmation email and add documentation 2016-05-16 14:56:32 -03:00
ssh Fixed Window's commands for SSH Help. 2016-02-06 12:17:12 +00:00
system_hooks Using single builder for push and tag events 2016-04-19 11:00:30 +02:00
update Fix version references in 8.8 to 8.9 update guide 2016-06-08 14:20:46 -04:00
web_hooks Fix hook data for Wiki Page event 2016-05-31 11:24:58 -03:00
workflow Add documentation for the 'only_allow_merge_if_build_succeeds.rb' feature 2016-06-10 14:36:57 +02:00
README.md Change logs.md location in README 2016-06-13 14:19:29 +02:00

README.md

Documentation

User documentation

  • API Automate GitLab via a simple and powerful API.
  • CI GitLab Continuous Integration (CI) getting started, .gitlab-ci.yml options, and examples.
  • GitLab as OAuth2 authentication service provider. It allows you to login to other applications from GitLab.
  • GitLab Basics Find step by step how to start working on your commandline and on GitLab.
  • Importing to GitLab.
  • Markdown GitLab's advanced formatting system.
  • Migrating from SVN Convert a SVN repository to Git and GitLab
  • Permissions Learn what each role in a project (external/guest/reporter/developer/master/owner) can do.
  • Profile Settings
  • Project Services Integrate a project with external services, such as CI and chat.
  • Public access Learn how you can allow public and internal access to projects.
  • Container Registry Learn how to use GitLab Container Registry.
  • SSH Setup your ssh keys and deploy keys for secure access to your projects.
  • Webhooks Let GitLab notify you when new code has been pushed to your project.
  • Workflow Using GitLab functionality and importing projects from GitHub and SVN.

Administrator documentation

Contributor documentation

  • Documentation styleguide Use this styleguide if you are contributing to documentation.
  • Development Explains the architecture and the guidelines for shell commands.
  • Legal Contributor license agreements.