-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use sshkey-handler to allow for more sshkey types
- Loading branch information
1 parent
5585b7e
commit efa31cc
Showing
32 changed files
with
844 additions
and
234 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
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
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
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
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
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,41 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = async function(knex) { | ||
return knex.schema.table('ssh_key', (table) => { | ||
table.string('key_type_new').notNullable().defaultTo('ssh-rsa'); | ||
}).then(() => { | ||
return knex('ssh_key').update({ | ||
key_type_new: knex.ref('key_type') | ||
}); | ||
}).then(function () { | ||
return knex.schema.table('ssh_key', (table) => { | ||
table.dropColumn('key_type'); | ||
table.renameColumn('key_type_new', 'key_type'); | ||
}) | ||
}); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = async function(knex) { | ||
return knex.schema.table('ssh_key', (table) => { | ||
table.enu('key_type_new', ['ssh-rsa', 'ssh-ed25519','ecdsa-sha2-nistp256','ecdsa-sha2-nistp384','ecdsa-sha2-nistp521']).notNullable().defaultTo('ssh-rsa'); | ||
}).then(() => { | ||
return knex('ssh_key') | ||
.whereNotIn('key_type', ['ssh-rsa', 'ssh-ed25519','ecdsa-sha2-nistp256','ecdsa-sha2-nistp384','ecdsa-sha2-nistp521']) | ||
.del(); | ||
}).then(function () { | ||
return knex('ssh_key').update({ | ||
key_type_new: knex.ref('key_type') | ||
}); | ||
}).then(function () { | ||
return knex.schema.table('ssh_key', (table) => { | ||
table.dropColumn('key_type'); | ||
table.renameColumn('key_type_new', 'key_type'); | ||
}) | ||
}); | ||
}; |
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
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
Oops, something went wrong.