Commit Graph

23 Commits

Author SHA1 Message Date
Eric Eastwood 116d8cfcfb Fix new personal access token showing up in a flash message 2017-12-07 16:22:37 -06:00
Douwe Maan 3f24f9ed18 Add sudo API scope 2017-11-02 11:39:03 +01:00
Douwe Maan 55fe0d7d0a Set default scope on PATs that don't have one set to allow them to be revoked 2017-10-03 16:57:36 +02:00
Robin Bobbitt 0013e6c00d Clean up read_registry scope changes
Closes #37789
2017-09-18 08:39:01 -04:00
Z.J. van de Weg 0b81b5ace0 Create read_registry scope with JWT auth
This is the first commit doing mainly 3 things:
1. create a new scope and allow users to use it
2. Have the JWTController respond correctly on this
3. Updates documentation to suggest usage of PATs

There is one gotcha, there will be no support for impersonation tokens, as this
seems not needed.

Fixes gitlab-org/gitlab-ce#19219
2017-06-05 12:26:49 +02:00
Sean McGivern de37dcee90 Merge branch 'siemens/gitlab-ce-feature/openid-connect' 2017-03-07 16:16:08 +00:00
Markus Koller eefbc83730 Only use API scopes for personal access tokens 2017-03-07 15:00:29 +01:00
Tiago Botelho 005749a616 apply codestyle and implementation changes to the respective feature code 2017-03-06 19:18:26 +00:00
Tiago Botelho 2b474dc2b2 refactors finder and correlated code 2017-03-01 13:11:11 +00:00
Tiago Botelho 9f2e4742e3 applies relevant changes to the code and code structure 2017-02-28 22:15:40 +00:00
Timothy Andrew 6c809dfae8 Allow creating personal access tokens / OAuth applications with scopes. 2016-12-16 15:08:10 +05:30
Timothy Andrew 7ee0898a9e Implement @DouweM's feedback.
- Extract a duplicated `redirect_to`
- Fix a typo: "token", not "certificate"
- Have the "Expires at" datepicker be attached to a text field, not inline
- Have both private tokens and personal access tokens verified in a
  single "authenticate_from_private_token" method, both in the
  application and API. Move relevant logic to
  `User#find_by_personal_access_token`
- Remove unnecessary constants relating to API auth. We don't need a
  separate constant for personal access tokens since the param is the
  same as for private tokens.
2016-06-16 08:24:13 +05:30
Timothy Andrew 1f5ecf916e Implement @jschatz1's comments.
- No hardcoded colors in any SCSS file except `variables.scss`
- Don't allow choosing a date in the past
- Use the same table as in the "Applications" tab
- The button should say "Create Personal Access Token"
- Float the revoke button to the right of the table cell
- Change the revocation message to be more explicit.
- Date shouldn't look selected on page load
- Don't use a panel for the created token
    - Use a normal flash for "Your new personal access token has been created"
    - Show the input (with the token) below it full width.
    - Put the "Make sure you save it - you won't be able to access it again." message near the input
- Have the created token's input highlight all on single click
2016-06-09 14:08:49 +05:30
Timothy Andrew ffe111c1e2 Display appropriate errors when personal access token creation/revocation fails. 2016-06-03 09:23:16 +05:30
Timothy Andrew 4d50d8a6e3 Only show a personal access token right after its creation. 2016-06-02 11:06:38 +05:30
Timothy Andrew c75aea5e4d Fix minor issues with the personal access tokens implementation.
- Use the `:personal_access_token` param root instead of
  `personal_access_token_params`, because we aren't using the
  `personal_access_token` param for authentication anymore (we're using
  `private_token` instead).
- Use `build` to instantiate a `PersonalAccessToken`
- Use better-formatted dates
2016-06-01 14:31:16 +05:30
Timothy Andrew fc4bce755d Make fixes based on @vsizov's comments on MR !3749 2016-04-28 22:28:36 +05:30
Timothy Andrew 17f2fc10e6 Change the root param while creating personal access tokens.
- Can't use `personal_access_token` anymore, because the contents
  of that param are assumed to be a token string, and authenticated
  against.
2016-04-28 22:28:36 +05:30
Timothy Andrew fb2da6795c Add an "Inactive Personal Access Tokens" section.
- Show the count for each section in parens
- Remove the `revoked?` check, because everything in the
  active section is guaranteed to not be revoked.
2016-04-28 22:28:36 +05:30
Timothy Andrew 41b4e119e9 Add an entry for Personal Access Tokens in the sidebar. 2016-04-28 22:28:36 +05:30
Timothy Andrew e5cf527f27 Allow expiration of personal access tokens. 2016-04-28 22:28:36 +05:30
Timothy Andrew 6d76f14f54 Allow revoking personal access tokens. 2016-04-28 22:28:36 +05:30
Timothy Andrew 3a60903874 Allow creating Personal Access Tokens through the website. 2016-04-28 22:28:36 +05:30