-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth-admin): General mandate delegation type (#16005)
* General Mandate delegation type connected 1 to 1 with custom delegation type * fix migrate/undo for general mandate * fix codegen * fix broken tests due to new delegation type * pr comments fixed * add new model in graphql for general mandate --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e660f32
commit fdee1d0
Showing
8 changed files
with
80 additions
and
1 deletion.
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
31 changes: 31 additions & 0 deletions
31
libs/auth-api-lib/migrations/20240913092844-GeneralMandate-delegation-type.js
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,31 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
async up(queryInterface) { | ||
await queryInterface.sequelize.query(` | ||
BEGIN; | ||
INSERT INTO delegation_type (id, name, provider, description) VALUES ('GeneralMandate', 'General mandate', 'delegationdb', 'General mandate delegation type'); | ||
INSERT INTO client_delegation_types (client_id, delegation_type) select client_id, 'GeneralMandate' from client_delegation_types where delegation_type = 'Custom'; | ||
INSERT INTO api_scope_delegation_types (api_scope_name, delegation_type) select api_scope_name, 'GeneralMandate' from api_scope_delegation_types where delegation_type = 'Custom'; | ||
COMMIT; | ||
`) | ||
}, | ||
|
||
async down(queryInterface) { | ||
await queryInterface.sequelize.query(` | ||
BEGIN; | ||
DELETE FROM client_delegation_types where delegation_type = 'GeneralMandate'; | ||
DELETE FROM api_scope_delegation_types where delegation_type = 'GeneralMandate'; | ||
DELETE FROM delegation_type WHERE id = 'GeneralMandate'; | ||
COMMIT; | ||
`) | ||
}, | ||
} |
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