Allow null GAIA IDs for User objects (#1933)

We were under the mistaken impression before that there was a reliable
way to, out-of-band, get a GAIA ID for a particular email address.
Unfortunately, that isn't the case (at least, not in a scalable way or
one that support agents could use). As a result, we have to allow null
GAIA IDs in the database.

When we (or the support team) create new users, we will only specify the
email address and not the GAIA ID. Then, when the user logs in for the
first time, we will have the GAIA ID from the provided ID token, and we
can populate it then.
This commit is contained in:
gbrodman 2023-02-08 16:10:34 -05:00 committed by GitHub
parent ef3ce79b8a
commit f36d22f4b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 16 deletions

View file

@ -261,11 +261,11 @@ td.section {
</tr>
<tr>
<td class="property_name">generated on</td>
<td class="property_value">2023-01-20 19:50:48.623695</td>
<td class="property_value">2023-02-08 17:40:28.930421</td>
</tr>
<tr>
<td class="property_name">last flyway file</td>
<td id="lastFlywayFile" class="property_value">V134__drop_not_null_request_id_lock_table.sql</td>
<td id="lastFlywayFile" class="property_value">V135__null_gaia_id_user.sql</td>
</tr>
</tbody>
</table>
@ -284,7 +284,7 @@ td.section {
generated on
</text>
<text text-anchor="start" x="3835.5" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
2023-01-20 19:50:48.623695
2023-02-08 17:40:28.930421
</text>
<polygon fill="none" stroke="#888888" points="3748,-4 3748,-44 4013,-44 4013,-4 3748,-4" /> <!-- allocationtoken_a08ccbef -->
<g id="node1" class="node">
@ -3220,7 +3220,7 @@ td.section {
<text text-anchor="start" x="3815.5" y="-3015.8" font-family="Helvetica,sans-Serif" font-size="14.00">
</text>
<text text-anchor="start" x="3823.5" y="-3015.8" font-family="Helvetica,sans-Serif" font-size="14.00">
text not null
text
</text>
<polygon fill="none" stroke="#888888" points="3719,-3009.5 3719,-3106.5 3932,-3106.5 3932,-3009.5 3719,-3009.5" />
</g>
@ -7067,7 +7067,7 @@ td.section {
<tr>
<td class="spacer"></td>
<td class="minwidth">gaia_id</td>
<td class="minwidth">text not null</td>
<td class="minwidth">text</td>
</tr>
<tr>
<td colspan="3"></td>

View file

@ -261,11 +261,11 @@ td.section {
</tr>
<tr>
<td class="property_name">generated on</td>
<td class="property_value">2023-01-20 19:50:45.218406</td>
<td class="property_value">2023-02-08 17:40:26.84563</td>
</tr>
<tr>
<td class="property_name">last flyway file</td>
<td id="lastFlywayFile" class="property_value">V134__drop_not_null_request_id_lock_table.sql</td>
<td id="lastFlywayFile" class="property_value">V135__null_gaia_id_user.sql</td>
</tr>
</tbody>
</table>
@ -274,19 +274,19 @@ td.section {
<svg viewbox="0.00 0.00 4713.00 7236.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="erDiagram" style="overflow: hidden; width: 100%; height: 800px"><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 7232)">
<title>SchemaCrawler_Diagram</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-7232 4709,-7232 4709,4 -4,4" />
<text text-anchor="start" x="4436.5" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
<text text-anchor="start" x="4444.5" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
generated by
</text>
<text text-anchor="start" x="4519.5" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
<text text-anchor="start" x="4527.5" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
SchemaCrawler 16.10.1
</text>
<text text-anchor="start" x="4435.5" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
<text text-anchor="start" x="4443.5" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
generated on
</text>
<text text-anchor="start" x="4519.5" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
2023-01-20 19:50:45.218406
<text text-anchor="start" x="4527.5" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
2023-02-08 17:40:26.84563
</text>
<polygon fill="none" stroke="#888888" points="4432,-4 4432,-44 4697,-44 4697,-4 4432,-4" /> <!-- allocationtoken_a08ccbef -->
<polygon fill="none" stroke="#888888" points="4440,-4 4440,-44 4697,-44 4697,-4 4440,-4" /> <!-- allocationtoken_a08ccbef -->
<g id="node1" class="node">
<title>allocationtoken_a08ccbef</title>
<polygon fill="#ebcef2" stroke="transparent" points="1380.5,-1056.5 1380.5,-1075.5 1579.5,-1075.5 1579.5,-1056.5 1380.5,-1056.5" />
@ -6564,7 +6564,7 @@ td.section {
<text text-anchor="start" x="4502" y="-7133.3" font-family="Helvetica,sans-Serif" font-size="14.00">
</text>
<text text-anchor="start" x="4510" y="-7133.3" font-family="Helvetica,sans-Serif" font-size="14.00">
text not null
text
</text>
<text text-anchor="start" x="4320" y="-7114.3" font-family="Helvetica,sans-Serif" font-size="14.00">
registry_lock_password_hash
@ -14351,7 +14351,7 @@ td.section {
<tr>
<td class="spacer"></td>
<td class="minwidth">gaia_id</td>
<td class="minwidth">text not null</td>
<td class="minwidth">text</td>
</tr>
<tr>
<td class="spacer"></td>

View file

@ -132,3 +132,4 @@ V131__add_default_promo_tokens_to_registry.sql
V132__drop_gae_user_id_from_registrar_poc.sql
V133__add_pull_queue_replace_columns.sql
V134__drop_not_null_request_id_lock_table.sql
V135__null_gaia_id_user.sql

View file

@ -0,0 +1,15 @@
-- Copyright 2023 The Nomulus Authors. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
ALTER TABLE "User" ALTER COLUMN gaia_id DROP NOT NULL;

View file

@ -1085,7 +1085,7 @@ CREATE TABLE public."TmchCrl" (
CREATE TABLE public."User" (
id bigint NOT NULL,
email_address text NOT NULL,
gaia_id text NOT NULL,
gaia_id text,
registry_lock_password_hash text,
registry_lock_password_salt text,
global_role text NOT NULL,