mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
b45a096aeb
* feat: Implement RFC 9700 hardening against refresh token reuse * tests * Update tests with less mocking, hit actual endpoints
62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
"use strict";
|
|
|
|
/** @type {import("sequelize-cli").Migration} */
|
|
module.exports = {
|
|
async up(queryInterface, Sequelize) {
|
|
await queryInterface.sequelize.transaction(async (transaction) => {
|
|
await queryInterface.addColumn(
|
|
"oauth_authentications",
|
|
"grantId",
|
|
{
|
|
type: Sequelize.UUID,
|
|
allowNull: true,
|
|
},
|
|
{ transaction }
|
|
);
|
|
|
|
await queryInterface.addColumn(
|
|
"oauth_authorization_codes",
|
|
"grantId",
|
|
{
|
|
type: Sequelize.UUID,
|
|
allowNull: true,
|
|
},
|
|
{ transaction }
|
|
);
|
|
|
|
await queryInterface.addIndex("oauth_authentications", ["grantId"], {
|
|
transaction,
|
|
});
|
|
|
|
await queryInterface.addIndex("oauth_authorization_codes", ["grantId"], {
|
|
transaction,
|
|
});
|
|
});
|
|
},
|
|
|
|
async down(queryInterface, Sequelize) {
|
|
await queryInterface.sequelize.transaction(async (transaction) => {
|
|
await queryInterface.removeIndex("oauth_authentications", ["grantId"], {
|
|
transaction,
|
|
});
|
|
await queryInterface.removeIndex(
|
|
"oauth_authorization_codes",
|
|
["grantId"],
|
|
{
|
|
transaction,
|
|
}
|
|
);
|
|
await queryInterface.removeColumn("oauth_authentications", "grantId", {
|
|
transaction,
|
|
});
|
|
await queryInterface.removeColumn(
|
|
"oauth_authorization_codes",
|
|
"grantId",
|
|
{
|
|
transaction,
|
|
}
|
|
);
|
|
});
|
|
},
|
|
};
|