-
Notifications
You must be signed in to change notification settings - Fork 826
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: UAA delete user endpoint returns false error during upgrade cana…
…ry deployment - fixes #2789 (see bug root cause in the issue) - by bringing back the MFA-related tables exactly as they were [#187240345]
- Loading branch information
1 parent
03819dc
commit d702099
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...src/main/resources/org/cloudfoundry/identity/uaa/db/hsqldb/V4_108__Restore_MFA_Tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- These tables were previously dropped in https://github.com/cloudfoundry/uaa/pull/2717 | ||
-- Restoring them here due to https://github.com/cloudfoundry/uaa/issues/2789 | ||
-- Can consider dropping these again in the future (e.g. at UAA V78/79, when most users | ||
-- will no longer experience issue #2789) | ||
CREATE TABLE mfa_providers ( | ||
id CHAR(36) NOT NULL PRIMARY KEY, | ||
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
lastmodified TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
identity_zone_id varchar(36) NOT NULL, | ||
name varchar(255) NOT NULL, | ||
type varchar(255) NOT NULL, | ||
config LONGVARCHAR | ||
); | ||
|
||
CREATE UNIQUE INDEX idx_mfa_unique_name ON mfa_providers (identity_zone_id,name); | ||
|
||
CREATE TABLE user_google_mfa_credentials ( | ||
user_id VARCHAR(36) NOT NULL, | ||
secret_key VARCHAR(255) NOT NULL, | ||
validation_code INTEGER, | ||
scratch_codes VARCHAR(255) NOT NULL, | ||
mfa_provider_id CHAR(36) NOT NULL, | ||
zone_id CHAR(36) NOT NULL, | ||
encryption_key_label VARCHAR(255), | ||
encrypted_validation_code VARCHAR(255) NULL, | ||
PRIMARY KEY (user_id,mfa_provider_id) | ||
); |
27 changes: 27 additions & 0 deletions
27
.../src/main/resources/org/cloudfoundry/identity/uaa/db/mysql/V4_108__Restore_MFA_Tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- These tables were previously dropped in https://github.com/cloudfoundry/uaa/pull/2717 | ||
-- Restoring them here due to https://github.com/cloudfoundry/uaa/issues/2789 | ||
-- Can consider dropping these again in the future (e.g. at UAA V78/79, when most users | ||
-- will no longer experience issue #2789) | ||
CREATE TABLE `mfa_providers` IF NOT EXISTS ( | ||
`id` varchar(36) NOT NULL, | ||
`created` TIMESTAMP default current_timestamp NOT NULL, | ||
`lastModified` TIMESTAMP null, | ||
`identity_zone_id` varchar(36) NOT NULL, | ||
`name` varchar(255) NOT NULL, | ||
`type` varchar(255) NOT NULL, | ||
`config` longtext, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `idx_mfa_unique_name` (`identity_zone_id`,`name`) | ||
); | ||
|
||
CREATE TABLE `user_google_mfa_credentials` IF NOT EXISTS ( | ||
`user_id` VARCHAR(36) NOT NULL, | ||
`secret_key` VARCHAR(255) NOT NULL, | ||
`validation_code` INTEGER NULL, | ||
`scratch_codes` VARCHAR(255) NOT NULL, | ||
`mfa_provider_id` CHAR(36) NOT NULL, | ||
`zone_id` CHAR(36) NOT NULL, | ||
`encryption_key_label` VARCHAR(255), | ||
`encrypted_validation_code` VARCHAR(255) NULL; | ||
PRIMARY KEY (`user_id`,`mfa_provider_id`) | ||
); |
28 changes: 28 additions & 0 deletions
28
...main/resources/org/cloudfoundry/identity/uaa/db/postgresql/V4_108__Restore_MFA_Tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- These tables were previously dropped in https://github.com/cloudfoundry/uaa/pull/2717 | ||
-- Restoring them here due to https://github.com/cloudfoundry/uaa/issues/2789 | ||
-- Can consider dropping these again in the future (e.g. at UAA V78/79, when most users | ||
-- will no longer experience issue #2789) | ||
CREATE TABLE mfa_providers IF NOT EXISTS ( | ||
id VARCHAR(36) NOT NULL PRIMARY KEY, | ||
created TIMESTAMP default current_timestamp NOT NULL, | ||
lastModified TIMESTAMP null, | ||
identity_zone_id VARCHAR(36) NOT NULL, | ||
name VARCHAR(255) NOT NULL, | ||
type VARCHAR(255) NOT NULL, | ||
config TEXT | ||
); | ||
|
||
CREATE UNIQUE INDEX idx_mfa_unique_name ON mfa_providers (identity_zone_id,LOWER(name)); | ||
|
||
CREATE TABLE user_google_mfa_credentials IF NOT EXISTS ( | ||
user_id VARCHAR(36) NOT NULL PRIMARY KEY, | ||
secret_key VARCHAR(255) NOT NULL, | ||
validation_code INTEGER, | ||
scratch_codes VARCHAR(255) NOT NULL, | ||
mfa_provider_id CHAR(36) NOT NULL, | ||
zone_id CHAR(36) NOT NULL, | ||
encryption_key_label VARCHAR(255), | ||
encrypted_validation_code VARCHAR(255) NULL | ||
); | ||
|
||
ALTER TABLE user_google_mfa_credentials ADD PRIMARY KEY (user_id,mfa_provider_id); |