[MM-37984] Allow Desktop App to authenticate via external providers outside of the app on supported servers (#24140)
* [MM-37984] Allow Desktop App to authenticate via external providers outside of the app on supported servers * PR feedback * Add support for mattermost-dev protocol for development use * Update server/channels/db/migrations/postgres/000110_create_desktop_tokens.up.sql * Fix silly typo * Update server/channels/db/migrations/postgres/000110_create_desktop_tokens.up.sql * Remove storage of client token, only validate it on the client * Update migrations * Add concurrently create index * Remove CONCURRENTLY for now * Fix issue with changing history * Remove old migration * Use idempotent statement to drop old index * Remove reference to old table
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
105fa4a195
Коммит
a3b194581f
@@ -0,0 +1,16 @@
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
(
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE table_name = 'DesktopTokens'
|
||||
AND table_schema = DATABASE()
|
||||
AND index_name = 'idx_desktoptokens_createat'
|
||||
) > 0,
|
||||
'DROP INDEX idx_desktoptokens_createat ON DesktopTokens;',
|
||||
'SELECT 1'
|
||||
));
|
||||
|
||||
PREPARE removeIndexIfExists FROM @preparedStatement;
|
||||
EXECUTE removeIndexIfExists;
|
||||
DEALLOCATE PREPARE removeIndexIfExists;
|
||||
|
||||
DROP TABLE IF EXISTS DesktopTokens;
|
||||
@@ -0,0 +1,38 @@
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
(
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE table_name = 'DesktopTokens'
|
||||
AND table_schema = DATABASE()
|
||||
AND index_name = 'idx_desktoptokens_createat'
|
||||
) > 0,
|
||||
'DROP INDEX idx_desktoptokens_createat ON DesktopTokens;',
|
||||
'SELECT 1'
|
||||
));
|
||||
|
||||
PREPARE removeIndexIfExists FROM @preparedStatement;
|
||||
EXECUTE removeIndexIfExists;
|
||||
DEALLOCATE PREPARE removeIndexIfExists;
|
||||
|
||||
DROP TABLE IF EXISTS DesktopTokens;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS DesktopTokens (
|
||||
Token varchar(64) NOT NULL,
|
||||
CreateAt bigint NOT NULL,
|
||||
UserId varchar(26) NOT NULL,
|
||||
PRIMARY KEY (Token)
|
||||
);
|
||||
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
(
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE table_name = 'DesktopTokens'
|
||||
AND table_schema = DATABASE()
|
||||
AND index_name = 'idx_desktoptokens_token_createat'
|
||||
) > 0,
|
||||
'SELECT 1',
|
||||
'CREATE INDEX idx_desktoptokens_token_createat ON DesktopTokens(Token, CreateAt);'
|
||||
));
|
||||
|
||||
PREPARE createIndexIfNotExists FROM @preparedStatement;
|
||||
EXECUTE createIndexIfNotExists;
|
||||
DEALLOCATE PREPARE createIndexIfNotExists;
|
||||
Ссылка в новой задаче
Block a user