Commit graph

21 commits

Author SHA1 Message Date
Patricio Cano
2f86860a6d Refactor find_for_git_client method to not use assignment in conditionals and syntax fixes. 2016-08-17 17:21:18 -05:00
Patricio Cano
f971026ad3 Added better information about the personal tokens 2016-08-16 11:19:00 -05:00
Patricio Cano
8bb1931ef2 Deny Git over HTTP access to users that have 2FA enabled, unless they use a Personal Access Token. 2016-08-16 11:19:00 -05:00
Connor Shea
a87b229b5d
Fix preferences tests. 2016-06-30 10:42:07 -06:00
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
e18a08fd89 Implement second round of comments from @jschatz1.
- Just use a link for the clipboard button. Having a non-clickable
  container (that looks like a button) is confusing.
- Use `text-danger` for the "you won't be able to access it again" message.
- Highlight the created token so people know to look there.
2016-06-10 10:30:49 +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
399a633061 Fix minor styling issues.
- No "Actions" label necessary
- `%td` can be moved out of `if/else`
- Page header should be "Profile Settings", not "Personal Access Tokens"
- "You don't have any tokens" message should be styled consistently
2016-06-03 09:07:37 +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
70add1388f Minor fixes after a final look at the diff.
- Spaces around `{` and `}` in HAML.
- Typo in CHANGELOG.
- Remove i18n.
2016-05-11 10:30:47 +05:30
Timothy Andrew
bafbf22c6a Address @DouweM's feedback on !3749.
- Use `TokenAuthenticatable` to generate the personal access token
- Remove a check for `authenticity_token` in application controller;
  this should've been `authentication_token`, maybe, and doesn't make
  any sense now.
- Have the datepicker appear inline
2016-04-28 22:28:36 +05:30
Timothy Andrew
c382bd266d Improve performance of the personal access tokens page. 2016-04-28 22:28:36 +05:30
Timothy Andrew
4e7acd88dc Remove unnecessary javascript from the datepicker initialization.
- In the personal access tokens page.
- Also fix the z-index so it doesn't appear below the token text fields.
2016-04-28 22:28:36 +05:30
Timothy Andrew
25aefde62b Add feature specs for personal access token management. 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
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