Skip to content

Remove length constraint from atlassian_identities

Jessie Young requested to merge jy-atlassian-refresh-token into master

What does this MR do and why?

  • This constraint is breaking our Atlassian OAuth integration for new users.
  • This length constraint was introduced via !40176 (merged)
  • Atlassian does not document their refresh token lengths, but at the time it was determined that 512 chars was long enough: !40176 (comment 401917259)
  • Recently, Atlassian revamped their OAuth and the refresh tokens are now longer. As a result, an error is raised: PG::CheckViolation: ERROR: new row for relation "atlassian_identities" violates check constraint "atlassian_identities_refresh_token_length_constraint"`
  • This MR removes that lenght constraint so that new users can sign up for GitLab via Atlassian OmniAuth.

Screenshots or screen recordings

Data from an Atlassian oauth flow that I ran locally:

> select length(encrypted_token) from atlassian_identities;
 length
--------
   1868
(1 row)

> select length(encrypted_refresh_token) from atlassian_identities;
 length
--------
   1478
(1 row)

How to set up and validate locally

  1. Set up atlassian oauth following the docs at https://docs.gitlab.com/ee/administration/auth/atlassian.html
  2. Confirm that a new user can sign in via Atlassian OAuth and have their GitLab account created

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jessie Young

Merge request reports