From 318a0af6d324cb17dbd88679df1f2abcf6ce933d Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 18:56:08 +0530 Subject: [PATCH 01/89] adding commands to generate the config files for each db type --- DataGateway.Service/CosmosDB_Commands.txt | 6 ++ DataGateway.Service/MsSql_Commands.txt | 97 ++++++++++++++++++++ DataGateway.Service/MySql_Commands.txt | 96 +++++++++++++++++++ DataGateway.Service/PostrgreSql_Commands.txt | 96 +++++++++++++++++++ 4 files changed, 295 insertions(+) create mode 100644 DataGateway.Service/CosmosDB_Commands.txt create mode 100644 DataGateway.Service/MsSql_Commands.txt create mode 100644 DataGateway.Service/MySql_Commands.txt create mode 100644 DataGateway.Service/PostrgreSql_Commands.txt diff --git a/DataGateway.Service/CosmosDB_Commands.txt b/DataGateway.Service/CosmosDB_Commands.txt new file mode 100644 index 0000000000..69ed7dfafe --- /dev/null +++ b/DataGateway.Service/CosmosDB_Commands.txt @@ -0,0 +1,6 @@ +hawaii init --name "hawaii-config.Cosmos" --database-type "cosmos" --connection-string " " --cosmos-database "graphqldb" --cosmos-container "planet" --graphql-schema "schema.gql" --host-mode Development --cors-origin "http://localhost:5000" +hawaii add Planet --name "hawaii-config.Cosmos" --source "graphqldb.planet" --permissions "anonymous:create,read,update,delete" --rest false --graphql true +hawaii update Planet --name "hawaii-config.Cosmos" --permissions "authenticated:create,read,update,delete" +hawaii add Character --name "hawaii-config.Cosmos" --source "graphqldb.character" --permissions "authenticated:create,read,update,delete" --rest false --graphql true +hawaii add Star --name "hawaii-config.Cosmos" --source "graphqldb.star" --permissions "anonymous:create,read,update,delete" --rest false --graphql true +hawaii update Star --name "hawaii-config.Cosmos" --source "graphqldb.star" --permissions "authenticated:create,read,update,delete" diff --git a/DataGateway.Service/MsSql_Commands.txt b/DataGateway.Service/MsSql_Commands.txt new file mode 100644 index 0000000000..5754fbd334 --- /dev/null +++ b/DataGateway.Service/MsSql_Commands.txt @@ -0,0 +1,97 @@ +hawaii init --name "hawaii-config.MsSql" --database-type mssql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +hawaii add Publisher --name "hawaii-config.MsSql" --source publishers --permissions "anonymous:read" +hawaii add Stock --name "hawaii-config.MsSql" --source stocks --permissions "anonymous:create,read,update" +hawaii add Book --name "hawaii-config.MsSql" --source books --permissions "anonymous:read" +hawaii add BookWebsitePlacement --name "hawaii-config.MsSql" --source book_website_placements --permissions "anonymous:read" +hawaii add Author --name "hawaii-config.MsSql" --source authors --permissions "anonymous:read" +hawaii add Review --name "hawaii-config.MsSql" --source reviews --permissions "anonymous:read" +hawaii add Comic --name "hawaii-config.MsSql" --source comics --permissions "anonymous:read" +hawaii add Broker --name "hawaii-config.MsSql" --source brokers --permissions "anonymous:read" +hawaii add WebsiteUser --name "hawaii-config.MsSql" --source website_users --permissions "anonymous:create,read,delete,update" +hawaii add SupportedType --name "hawaii-config.MsSql" --source type_table --permissions "anonymous:create,read,delete,update" +hawaii add stocks_price --name "hawaii-config.MsSql" --source stocks_price --permissions "anonymous:read" +hawaii add Tree --name "hawaii-config.MsSql" --source trees --permissions "anonymous:create,read,update,delete" +hawaii add Shrub --name "hawaii-config.MsSql" --source trees --permissions "anonymous:create,read,update,delete" +hawaii add Fungus --name "hawaii-config.MsSql" --source fungi --permissions "anonymous:create,read,update,delete" +hawaii add books_view_all --name "hawaii-config.MsSql" --source books_view_all --permissions "anonymous:read" +hawaii add stocks_view_selected --name "hawaii-config.MsSql" --source stocks_view_selected --permissions "anonymous:read" +hawaii add books_publishers_view_composite --name "hawaii-config.MsSql" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +hawaii add Empty --name "hawaii-config.MsSql" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +hawaii add Notebook --name "hawaii-config.MsSql" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +hawaii add Journal --name "hawaii-config.MsSql" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +hawaii add ArtOfWar --name "hawaii-config.MsSql" --source "aow" --rest true --permissions "anonymous:*" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_01:create,delete" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_01:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_02:create,delete" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_02:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_03:create,delete" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_03:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_04:create,delete" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_04:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_06:create,delete" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_06:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +hawaii update Stock --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" +hawaii update Book --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" +hawaii update Book --name "hawaii-config.MsSql" --relationship publishers --target.entity Publisher --cardinality one +hawaii update Book --name "hawaii-config.MsSql" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +hawaii update Book --name "hawaii-config.MsSql" --relationship reviews --target.entity Review --cardinality many +hawaii update Book --name "hawaii-config.MsSql" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +hawaii update Book --name "hawaii-config.MsSql" --map "id:id,title:title" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_01:create,delete" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_01:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_02:create,delete" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_02:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_03:create,delete" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_03:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_04:create,delete" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_04:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_05:create,delete" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_05:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_06:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_06:create,delete" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_07:create" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_07:read" --fields.include "*" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_08:create" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_08:read" --fields.include "*" +hawaii update BookWebsitePlacement --name "hawaii-config.MsSql" --permissions "authenticated:create,update" --rest true --graphql true +hawaii update BookWebsitePlacement --name "hawaii-config.MsSql" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +hawaii update Author --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +hawaii update WebsiteUser --name "hawaii-config.MsSql" --permissions "authenticated:create,read,delete,update" --rest false +hawaii update stocks_price --name "hawaii-config.MsSql" --permissions "authenticated:create,read,delete,update" --rest false +hawaii update Comic --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +hawaii update Broker --name "hawaii-config.MsSql" --permissions "authenticated:create,update,read,delete" --graphql false +hawaii update Tree --name "hawaii-config.MsSql" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +hawaii update Shrub --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +hawaii update Fungus --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +hawaii update Fungus --name "hawaii-config.MsSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +hawaii update books_view_all --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +hawaii update stocks_view_selected --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" +hawaii update books_publishers_view_composite --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" +hawaii update BookWebsitePlacement --name "hawaii-config.MsSql" --relationship books --target.entity Book --cardinality one +hawaii update SupportedType --name "hawaii-config.MsSql" --permissions "authenticated:create,read,delete,update" --rest false +hawaii update Author --name "hawaii-config.MsSql" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +hawaii update Notebook --name "hawaii-config.MsSql" --permissions "anonymous:create,update,delete" +hawaii update Journal --name "hawaii-config.MsSql" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" +hawaii update Journal --name "hawaii-config.MsSql" --permissions "authenticated:read" --fields.include "*" +hawaii update Journal --name "hawaii-config.MsSql" --permissions "policy_tester_update_noread:create" +hawaii update Journal --name "hawaii-config.MsSql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +hawaii update Journal --name "hawaii-config.MsSql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +hawaii update Journal --name "hawaii-config.MsSql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +hawaii update Journal --name "hawaii-config.MsSql" --permissions "authorizationHandlerTester:read" +hawaii update ArtOfWar --name "hawaii-config.MsSql" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/DataGateway.Service/MySql_Commands.txt b/DataGateway.Service/MySql_Commands.txt new file mode 100644 index 0000000000..d6ecfcf328 --- /dev/null +++ b/DataGateway.Service/MySql_Commands.txt @@ -0,0 +1,96 @@ +hawaii init --name "hawaii-config.MySql" --database-type mysql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +hawaii add Publisher --name "hawaii-config.MySql" --source publishers --permissions "anonymous:read" +hawaii add Stock --name "hawaii-config.MySql" --source stocks --permissions "anonymous:create,read,update" +hawaii add Book --name "hawaii-config.MySql" --source books --permissions "anonymous:read" +hawaii add BookWebsitePlacement --name "hawaii-config.MySql" --source book_website_placements --permissions "anonymous:read" +hawaii add Author --name "hawaii-config.MySql" --source authors --permissions "anonymous:read" +hawaii add Review --name "hawaii-config.MySql" --source reviews --permissions "anonymous:read" +hawaii add Comic --name "hawaii-config.MySql" --source comics --permissions "anonymous:read" +hawaii add Broker --name "hawaii-config.MySql" --source brokers --permissions "anonymous:read" +hawaii add WebsiteUser --name "hawaii-config.MySql" --source website_users --permissions "anonymous:create,read,delete,update" +hawaii add SupportedType --name "hawaii-config.MySql" --source type_table --permissions "anonymous:create,read,delete,update" +hawaii add stocks_price --name "hawaii-config.MySql" --source stocks_price --permissions "anonymous:read" +hawaii add Tree --name "hawaii-config.MySql" --source trees --permissions "anonymous:create,read,update,delete" +hawaii add Shrub --name "hawaii-config.MySql" --source trees --permissions "anonymous:create,read,update,delete" +hawaii add Fungus --name "hawaii-config.MySql" --source fungi --permissions "anonymous:create,read,update,delete" +hawaii add books_view_all --name "hawaii-config.MySql" --source books_view_all --permissions "anonymous:read" +hawaii add stocks_view_selected --name "hawaii-config.MySql" --source stocks_view_selected --permissions "anonymous:read" +hawaii add books_publishers_view_composite --name "hawaii-config.MySql" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +hawaii add Empty --name "hawaii-config.MySql" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +hawaii add Notebook --name "hawaii-config.MySql" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +hawaii add Journal --name "hawaii-config.MySql" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +hawaii add ArtOfWar --name "hawaii-config.MySql" --source "aow" --rest true --permissions "anonymous:*" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_01:create,delete" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_01:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_02:create,delete" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_02:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_03:create,delete" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_03:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_04:create,delete" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_04:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_06:create,delete" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_06:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +hawaii update Stock --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" +hawaii update Book --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" +hawaii update Book --name "hawaii-config.MySql" --relationship publishers --target.entity Publisher --cardinality one +hawaii update Book --name "hawaii-config.MySql" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +hawaii update Book --name "hawaii-config.MySql" --relationship reviews --target.entity Review --cardinality many +hawaii update Book --name "hawaii-config.MySql" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +hawaii update Book --name "hawaii-config.MySql" --map "id:id,title:title" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_01:create,delete" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_01:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_02:create,delete" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_02:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_03:create,delete" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_03:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_04:create,delete" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_05:create,delete" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_05:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_06:update" --fields.include "*" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_07:create" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_07:read" --fields.include "*" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_08:read" --fields.include "*" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:create" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update BookWebsitePlacement --name "hawaii-config.MySql" --permissions "authenticated:create,update" --rest true --graphql true +hawaii update Author --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +hawaii update WebsiteUser --name "hawaii-config.MySql" --permissions "authenticated:create,read,delete,update" --rest false +hawaii update stocks_price --name "hawaii-config.MySql" --permissions "authenticated:create,read,delete,update" --rest false +hawaii update Comic --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +hawaii update Broker --name "hawaii-config.MySql" --permissions "authenticated:create,update,read,delete" --graphql false +hawaii update Tree --name "hawaii-config.MySql" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +hawaii update Shrub --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +hawaii update Fungus --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +hawaii update Fungus --name "hawaii-config.MySql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +hawaii update books_view_all --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +hawaii update stocks_view_selected --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" +hawaii update books_publishers_view_composite --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" +hawaii update BookWebsitePlacement --name "hawaii-config.MySql" --relationship books --target.entity Book --cardinality one +hawaii update SupportedType --name "hawaii-config.MySql" --permissions "authenticated:create,read,delete,update" --rest false +hawaii update Author --name "hawaii-config.MySql" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +hawaii update Review --name "hawaii-config.MySql" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one +hawaii update Notebook --name "hawaii-config.MySql" --permissions "anonymous:create,update,delete" +hawaii update Journal --name "hawaii-config.MySql" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" +hawaii update Journal --name "hawaii-config.MySql" --permissions "authenticated:read" --fields.include "*" +hawaii update Journal --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:create" +hawaii update Journal --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +hawaii update Journal --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +hawaii update Journal --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +hawaii update Journal --name "hawaii-config.MySql" --permissions "authorizationHandlerTester:read" +hawaii update ArtOfWar --name "hawaii-config.MySql" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/DataGateway.Service/PostrgreSql_Commands.txt b/DataGateway.Service/PostrgreSql_Commands.txt new file mode 100644 index 0000000000..7c7c9394e7 --- /dev/null +++ b/DataGateway.Service/PostrgreSql_Commands.txt @@ -0,0 +1,96 @@ +hawaii init --name "hawaii-config.PostgreSql" --database-type postgresql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +hawaii add Publisher --name "hawaii-config.PostgreSql" --source publishers --permissions "anonymous:read" +hawaii add Stock --name "hawaii-config.PostgreSql" --source stocks --permissions "anonymous:create,read,update" +hawaii add Book --name "hawaii-config.PostgreSql" --source books --permissions "anonymous:read" +hawaii add BookWebsitePlacement --name "hawaii-config.PostgreSql" --source book_website_placements --permissions "anonymous:read" +hawaii add Author --name "hawaii-config.PostgreSql" --source authors --permissions "anonymous:read" +hawaii add Review --name "hawaii-config.PostgreSql" --source reviews --permissions "anonymous:read" +hawaii add Comic --name "hawaii-config.PostgreSql" --source comics --permissions "anonymous:read" +hawaii add Broker --name "hawaii-config.PostgreSql" --source brokers --permissions "anonymous:read" +hawaii add WebsiteUser --name "hawaii-config.PostgreSql" --source website_users --permissions "anonymous:create,read,delete,update" +hawaii add SupportedType --name "hawaii-config.PostgreSql" --source type_table --permissions "anonymous:create,read,delete,update" +hawaii add stocks_price --name "hawaii-config.PostgreSql" --source stocks_price --permissions "anonymous:read" +hawaii add Tree --name "hawaii-config.PostgreSql" --source trees --permissions "anonymous:create,read,update,delete" +hawaii add Shrub --name "hawaii-config.PostgreSql" --source trees --permissions "anonymous:create,read,update,delete" +hawaii add Fungus --name "hawaii-config.PostgreSql" --source fungi --permissions "anonymous:create,read,update,delete" +hawaii add Empty --name "hawaii-config.PostgreSql" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +hawaii add Notebook --name "hawaii-config.PostgreSql" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +hawaii add Journal --name "hawaii-config.PostgreSql" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +hawaii add ArtOfWar --name "hawaii-config.PostgreSql" --source "aow" --rest true --permissions "anonymous:*" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:create,delete" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:create,delete" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:create,delete" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:create,delete" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:create,delete" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:update" --fields.include "*" +hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +hawaii update Stock --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" +hawaii update Book --name "hawaii-config.PostgreSql" --relationship publishers --target.entity Publisher --cardinality one +hawaii update Book --name "hawaii-config.PostgreSql" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +hawaii update Book --name "hawaii-config.PostgreSql" --relationship reviews --target.entity Review --cardinality many +hawaii update Book --name "hawaii-config.PostgreSql" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +hawaii update Book --name "hawaii-config.PostgreSql" --map "id:id,title:title" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:create,delete" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:update" --fields.include "*" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:create,delete" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:update" --fields.include "*" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:create,delete" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:update" --fields.include "*" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:create,delete" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:update" --fields.include "*" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_05:create,delete" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_05:update" --fields.include "*" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:update" --fields.include "*" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:create,delete" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_07:create" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_07:read" --fields.include "*" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_08:create" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_08:read" --fields.include "*" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:create" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 9" +hawaii update BookWebsitePlacement --name "hawaii-config.PostgreSql" --permissions "authenticated:create,update" --rest true --graphql true +hawaii update BookWebsitePlacement --name "hawaii-config.PostgreSql" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +hawaii update Author --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +hawaii update WebsiteUser --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,delete,update" --rest false +hawaii update stocks_price --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,delete,update" --rest false +hawaii update Comic --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +hawaii update Broker --name "hawaii-config.PostgreSql" --permissions "authenticated:create,update,read,delete" --graphql false +hawaii update Tree --name "hawaii-config.PostgreSql" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +hawaii update Shrub --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +hawaii update Fungus --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +hawaii update Fungus --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +hawaii update BookWebsitePlacement --name "hawaii-config.PostgreSql" --relationship books --target.entity Book --cardinality one +hawaii update SupportedType --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,delete,update" --rest false +hawaii update Author --name "hawaii-config.PostgreSql" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +hawaii update Review --name "hawaii-config.PostgreSql" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one +hawaii update Notebook --name "hawaii-config.PostgreSql" --permissions "anonymous:create,update,delete" +hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" +hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "authenticated:read" --fields.include "*" +hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:create" +hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "authorizationHandlerTester:read" +hawaii update ArtOfWar --name "hawaii-config.PostgreSql" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" From e58f34c0ee81839840c9cb88e98970293f155507 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 18:58:00 +0530 Subject: [PATCH 02/89] adding the pipeline tasks to run the script to generate the config files --- .pipelines/cosmos-pipelines.yml | 19 +++++++++++++++++++ .pipelines/mssql-pipelines.yml | 33 +++++++++++++++++++++++++++++++++ .pipelines/mysql-pipelines.yml | 17 +++++++++++++++++ .pipelines/pg-pipelines.yml | 17 +++++++++++++++++ 4 files changed, 86 insertions(+) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 1ea8d07749..37ac5e7352 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -33,6 +33,25 @@ steps: displayName: Restore NuGet packages inputs: restoreSolution: '$(solution)' +-task: DotNetCoreCLI@2 + displayName: Pack the CLI tool + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' +-task: DotNetCoreCLI@2 + displayName: Install the CLI tool + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' +-script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/MySql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + failOnStderr: true + condition: eq( variables['Agent.OS'], 'Windows' ) +-bash: | + .$(System.DefaultWorkingDirectory)/DataGateway.Service/PostrgreSql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + failOnStderr: true + condition: in( variables['Agent.OS'], 'Linux', 'macOs' ) - task: FileTransform@1 displayName: 'Generate hawaii-config.Cosmos.json' inputs: diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 1498432dd5..f6ac41c0f1 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -39,6 +39,23 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu SQL Server Image Docker + -task: DotNetCoreCLI@2 + displayName: Pack the CLI tool + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + + -task: DotNetCoreCLI@2 + displayName: Install the CLI tool + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + + -bash: | + .$(System.DefaultWorkingDirectory)/DataGateway.Service/MsSql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + failOnStderr: true + - task: FileTransform@1 displayName: 'Generate hawaii-config.MsSql.json' inputs: @@ -119,6 +136,22 @@ jobs: SqlLocalDb.exe start MSSQLLocalDB SqlLocalDb.exe info "MSSQLLocalDB" + -task: DotNetCoreCLI@2 + displayName: Pack the CLI tool + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + + -task: DotNetCoreCLI@2 + displayName: Install the CLI tool + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + + -script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/MySql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + failOnStderr: true + - task: FileTransform@1 displayName: 'Generate hawaii-config.MsSql.json' inputs: diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index bc351aaabf..4a67d083a5 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -43,6 +43,23 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu MySql Image Docker + -task: DotNetCoreCLI@2 + displayName: Pack the CLI tool + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + + -task: DotNetCoreCLI@2 + displayName: Install the CLI tool + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + + -bash: | + .$(System.DefaultWorkingDirectory)/DataGateway.Service/MySql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + failOnStderr: true + - task: FileTransform@1 displayName: 'Generate hawaii-config.MySql.json' inputs: diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 00b0271970..2297607443 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -39,6 +39,23 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu Postgres Image Docker + -task: DotNetCoreCLI@2 + displayName: Pack the CLI tool + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + + -task: DotNetCoreCLI@2 + displayName: Install the CLI tool + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + + -bash: | + .$(System.DefaultWorkingDirectory)/DataGateway.Service/PostrgreSql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + failOnStderr: true + - task: FileTransform@1 displayName: 'Generate hawaii-config.PostgreSql.json' inputs: From 39b6b2b150bd48ca9838edbf36f7b4da0687d9ab Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 19:00:06 +0530 Subject: [PATCH 03/89] removing the checked-in config files --- DataGateway.Service/hawaii-config.Cosmos.json | 75 -- DataGateway.Service/hawaii-config.MsSql.json | 797 ----------------- DataGateway.Service/hawaii-config.MySql.json | 824 ------------------ .../hawaii-config.PostgreSql.json | 773 ---------------- 4 files changed, 2469 deletions(-) delete mode 100644 DataGateway.Service/hawaii-config.Cosmos.json delete mode 100644 DataGateway.Service/hawaii-config.MsSql.json delete mode 100644 DataGateway.Service/hawaii-config.MySql.json delete mode 100644 DataGateway.Service/hawaii-config.PostgreSql.json diff --git a/DataGateway.Service/hawaii-config.Cosmos.json b/DataGateway.Service/hawaii-config.Cosmos.json deleted file mode 100644 index 9d41af6a2d..0000000000 --- a/DataGateway.Service/hawaii-config.Cosmos.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "$schema": "../schemas/hawaii.draft-01.schema.json", - "data-source": { - "database-type": "cosmos", - "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" - }, - "cosmos": { - "database": "graphqldb", - "container": "planet", - "schema": "schema.gql" - }, - "runtime": { - "rest": { - "enabled": false - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Planet": { - "source": "graphqldb.planet", - "rest": false, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Character": { - "source": "graphqldb.character", - "rest": false, - "graphql": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Star": { - "source": "graphqldb.star", - "rest": false, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - } - } -} diff --git a/DataGateway.Service/hawaii-config.MsSql.json b/DataGateway.Service/hawaii-config.MsSql.json deleted file mode 100644 index 9bd791c30e..0000000000 --- a/DataGateway.Service/hawaii-config.MsSql.json +++ /dev/null @@ -1,797 +0,0 @@ -{ - "$schema": "../schemas/hawaii.draft-01.schema.json", - "data-source": { - "database-type": "mssql", - "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" - }, - "mssql": { - "set-session-context": false - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "comics": { - "cardinality": "many", - "target.entity": "Comic", - "source.fields": [ "categoryName" ], - "target.fields": [ "categoryName" ] - } - } - }, - "Book": { - "source": "books", - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_05", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 10" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_07", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - } - ] - }, - { - "role": "policy_tester_08", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.region ne 'northeast'" - } - } - ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Notebook": { - "source": "notebooks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - "create", - "update", - "delete" - ] - } - ] - }, - "Journal": { - "source": "journals", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "policy_tester_noupdate", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - "delete" - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - } - ] - }, - { - "role": "authorizationHandlerTester", - "actions": [ "read" ] - } - ] - }, - "books_view_all": { - "source": "books_view_all", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "stocks_view_selected": { - "source": "stocks_view_selected", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "books_publishers_view_composite": { - "source": "books_publishers_view_composite", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "ArtOfWar": { - "source": "aow", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ], - "mappings": { - "DetailAssessmentAndPlanning": "始計", - "WagingWar": "作戰", - "StrategicAttack": "謀攻", - "NoteNum": "┬─┬ノ( º _ ºノ)" - } - } - } -} diff --git a/DataGateway.Service/hawaii-config.MySql.json b/DataGateway.Service/hawaii-config.MySql.json deleted file mode 100644 index 778c2c9380..0000000000 --- a/DataGateway.Service/hawaii-config.MySql.json +++ /dev/null @@ -1,824 +0,0 @@ -{ - "$schema": "../schemas/hawaii.draft-01.schema.json", - "data-source": { - "database-type": "mysql", - "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "comics": { - "cardinality": "many", - "target.entity": "Comic", - "source.fields": [ "categoryName" ], - "target.fields": [ "categoryName" ] - } - } - }, - "Book": { - "source": "books", - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_05", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 10" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_07", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - } - ] - }, - { - "role": "policy_tester_08", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.region ne 'northeast'" - } - } - ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Notebook": { - "source": "notebooks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - "create", - "update", - "delete" - ] - } - ] - }, - "Journal": { - "source": "journals", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "policy_tester_noupdate", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - "delete" - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - } - ] - }, - { - "role": "authorizationHandlerTester", - "actions": [ "read" ] - } - ] - }, - "books_view_all": { - "source": "books_view_all", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "stocks_view_selected": { - "source": "stocks_view_selected", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "books_publishers_view_composite": { - "source": "books_publishers_view_composite", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "ArtOfWar": { - "source": "aow", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ], - "mappings": { - "DetailAssessmentAndPlanning": "始計", - "WagingWar": "作戰", - "StrategicAttack": "謀攻", - "NoteNum": "┬─┬ノ( º _ ºノ)" - } - } - } -} diff --git a/DataGateway.Service/hawaii-config.PostgreSql.json b/DataGateway.Service/hawaii-config.PostgreSql.json deleted file mode 100644 index 5a525e0af7..0000000000 --- a/DataGateway.Service/hawaii-config.PostgreSql.json +++ /dev/null @@ -1,773 +0,0 @@ -{ - "$schema": "../schemas/hawaii.draft-01.schema.json", - "data-source": { - "database-type": "postgresql", - "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "comics": { - "cardinality": "many", - "target.entity": "Comic", - "source.fields": [ "categoryName" ], - "target.fields": [ "categoryName" ] - } - } - }, - "Book": { - "source": "books", - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_05", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 10" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_07", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - } - ] - }, - { - "role": "policy_tester_08", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.region ne 'northeast'" - } - } - ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Notebook": { - "source": "notebooks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - "create", - "update", - "delete" - ] - } - ] - }, - "Journal": { - "source": "journals", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "policy_tester_noupdate", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - "delete" - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - } - ] - }, - { - "role": "authorizationHandlerTester", - "actions": [ "read" ] - } - ] - }, - "ArtOfWar": { - "source": "aow", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ], - "mappings": { - "DetailAssessmentAndPlanning": "始計", - "WagingWar": "作戰", - "StrategicAttack": "謀攻", - "NoteNum": "┬─┬ノ( º _ ºノ)" - } - } - } -} From 77b14a2ac5edb59fb2bd88a40678451f0a333d5a Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 20:16:45 +0530 Subject: [PATCH 04/89] creating config files in a new directory, modifying tests --- .pipelines/cosmos-pipelines.yml | 6 +- .pipelines/mssql-pipelines.yml | 8 +- .pipelines/mysql-pipelines.yml | 4 +- .pipelines/pg-pipelines.yml | 4 +- .../Configuration/ConfigurationTests.cs | 2 +- DataGateway.Service.Tests/TestHelper.cs | 2 +- .../Unittests/RestServiceUnitTests.cs | 2 + .../Unittests/SqlMetadataProviderUnitTests.cs | 67 -- .../{ => ConfigFiles}/CosmosDB_Commands.txt | 0 .../{ => ConfigFiles}/MsSql_Commands.txt | 0 .../{ => ConfigFiles}/MySql_Commands.txt | 0 .../PostrgreSql_Commands.txt | 0 DataGateway.Service/hawaii-config.Cosmos.json | 75 ++ DataGateway.Service/hawaii-config.MsSql.json | 797 +++++++++++++++++ DataGateway.Service/hawaii-config.MySql.json | 824 ++++++++++++++++++ .../hawaii-config.PostgreSql.json | 773 ++++++++++++++++ 16 files changed, 2484 insertions(+), 80 deletions(-) rename DataGateway.Service/{ => ConfigFiles}/CosmosDB_Commands.txt (100%) rename DataGateway.Service/{ => ConfigFiles}/MsSql_Commands.txt (100%) rename DataGateway.Service/{ => ConfigFiles}/MySql_Commands.txt (100%) rename DataGateway.Service/{ => ConfigFiles}/PostrgreSql_Commands.txt (100%) create mode 100644 DataGateway.Service/hawaii-config.Cosmos.json create mode 100644 DataGateway.Service/hawaii-config.MsSql.json create mode 100644 DataGateway.Service/hawaii-config.MySql.json create mode 100644 DataGateway.Service/hawaii-config.PostgreSql.json diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 37ac5e7352..67f4cfe39a 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -43,13 +43,13 @@ steps: custom: 'tool install -g' arguements: '--add-source ./nupkg hawaii-cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' --script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/MySql_Commands.txt +-script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' failOnStderr: true condition: eq( variables['Agent.OS'], 'Windows' ) -bash: | - .$(System.DefaultWorkingDirectory)/DataGateway.Service/PostrgreSql_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true condition: in( variables['Agent.OS'], 'Linux', 'macOs' ) - task: FileTransform@1 diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index f6ac41c0f1..da1c128247 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -52,8 +52,8 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' -bash: | - .$(System.DefaultWorkingDirectory)/DataGateway.Service/MsSql_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true - task: FileTransform@1 @@ -148,8 +148,8 @@ jobs: arguements: '--add-source ./nupkg hawaii-cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - -script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/MySql_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + -script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true - task: FileTransform@1 diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 4a67d083a5..3f8f1072e1 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -56,8 +56,8 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' -bash: | - .$(System.DefaultWorkingDirectory)/DataGateway.Service/MySql_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MySql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true - task: FileTransform@1 diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 2297607443..47dbdbafc8 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -52,8 +52,8 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' -bash: | - .$(System.DefaultWorkingDirectory)/DataGateway.Service/PostrgreSql_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true - task: FileTransform@1 diff --git a/DataGateway.Service.Tests/Configuration/ConfigurationTests.cs b/DataGateway.Service.Tests/Configuration/ConfigurationTests.cs index f1d7d5a028..567f191aa5 100644 --- a/DataGateway.Service.Tests/Configuration/ConfigurationTests.cs +++ b/DataGateway.Service.Tests/Configuration/ConfigurationTests.cs @@ -369,7 +369,7 @@ public void TestRuntimeEnvironmentVariable() ValidateCosmosDbSetup(server); } - [TestMethod("Validates the runtime configuration file.")] + [TestMethod("Validates the runtime configuration file."), TestCategory(TestCategory.MSSQL)] public void TestConfigIsValid() { RuntimeConfigPath configPath = diff --git a/DataGateway.Service.Tests/TestHelper.cs b/DataGateway.Service.Tests/TestHelper.cs index 3c7a1f8e1a..5871146558 100644 --- a/DataGateway.Service.Tests/TestHelper.cs +++ b/DataGateway.Service.Tests/TestHelper.cs @@ -31,7 +31,7 @@ public static RuntimeConfigPath GetRuntimeConfigPath(string environment) }; IConfigurationRoot config = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) + .SetBasePath(Directory.GetCurrentDirectory() + "/ConfigFiles") .AddInMemoryCollection(configFileNameMap) .Build(); diff --git a/DataGateway.Service.Tests/Unittests/RestServiceUnitTests.cs b/DataGateway.Service.Tests/Unittests/RestServiceUnitTests.cs index 60b42bca7f..4b0a21714e 100644 --- a/DataGateway.Service.Tests/Unittests/RestServiceUnitTests.cs +++ b/DataGateway.Service.Tests/Unittests/RestServiceUnitTests.cs @@ -34,6 +34,7 @@ public class RestServiceUnitTests /// The primary key route we /// expect to parse from route. [DataTestMethod] + [TestCategory(TestCategory.MSSQL)] [DataRow("foo", "", "foo", "")] [DataRow("foo/", "", "foo", "")] [DataRow("foo", "/", "foo", "")] @@ -77,6 +78,7 @@ public void ParseEntityNameAndPrimaryKeyTest(string route, /// The route to be parsed. /// An invalid path for the given route. [DataTestMethod] + [TestCategory(TestCategory.MSSQL)] [DataRow("foo", "bar")] [DataRow("\\foo", "foo")] [DataRow("\"foo\"", "foo")] diff --git a/DataGateway.Service.Tests/Unittests/SqlMetadataProviderUnitTests.cs b/DataGateway.Service.Tests/Unittests/SqlMetadataProviderUnitTests.cs index aecd5653aa..aa03ebee70 100644 --- a/DataGateway.Service.Tests/Unittests/SqlMetadataProviderUnitTests.cs +++ b/DataGateway.Service.Tests/Unittests/SqlMetadataProviderUnitTests.cs @@ -56,72 +56,5 @@ public async Task CheckNoExceptionForNoForeignKey() await _sqlMetadataProvider.InitializeAsync(); } - /// - /// Do: Load runtimeConfig and set connection string and db type - /// according to data row. - /// Check: Verify malformed connection string throws correct exception. - /// - [DataTestMethod] - [DataRow(";;;;;fooBarBAZ", DatabaseType.mssql)] - [DataRow(";;;;;fooBarBAZ", DatabaseType.mysql)] - [DataRow(";;;;;fooBarBAZ", DatabaseType.postgresql)] - [DataRow("!&^%*&$$%#$%@$%#@()", DatabaseType.mssql)] - [DataRow("!&^%*&$$%#$%@$%#@()", DatabaseType.mysql)] - [DataRow("!&^%*&$$%#$%@$%#@()", DatabaseType.postgresql)] - [DataRow("Server=<>;Databases=<>;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;", DatabaseType.mssql)] - [DataRow("Server=<>;Databases=<>;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;", DatabaseType.mysql)] - [DataRow("Server=<>;Databases=<>;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;", DatabaseType.postgresql)] - [DataRow("Servers=<>;Database=<>;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;", DatabaseType.mssql)] - [DataRow("Servers=<>;Database=<>;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;", DatabaseType.mysql)] - [DataRow("Servers=<>;Database=<>;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;", DatabaseType.postgresql)] - [DataRow("DO NOT EDIT, look at CONTRIBUTING.md on how to run tests", DatabaseType.mssql)] - [DataRow("DO NOT EDIT, look at CONTRIBUTING.md on how to run tests", DatabaseType.postgresql)] - [DataRow("DO NOT EDIT, look at CONTRIBUTING.md on how to run tests", DatabaseType.mysql)] - [DataRow("", DatabaseType.mssql)] - [DataRow("", DatabaseType.postgresql)] - [DataRow("", DatabaseType.mysql)] - public async Task CheckExceptionForBadConnectionString(string connectionString, DatabaseType db) - { - _runtimeConfig = SqlTestHelper.SetupRuntimeConfig(db.ToString()); - _runtimeConfig.ConnectionString = connectionString; - _sqlMetadataLogger = new Mock>().Object; - _runtimeConfigProvider = TestHelper.GetRuntimeConfigProvider(_runtimeConfig); - switch (db) - { - case DatabaseType.mssql: - _sqlMetadataProvider = - new MsSqlMetadataProvider(_runtimeConfigProvider, - _queryExecutor, - _queryBuilder, - _sqlMetadataLogger); - break; - case DatabaseType.mysql: - _sqlMetadataProvider = - new MySqlMetadataProvider(_runtimeConfigProvider, - _queryExecutor, - _queryBuilder, - _sqlMetadataLogger); - break; - case DatabaseType.postgresql: - _sqlMetadataProvider = - new PostgreSqlMetadataProvider(_runtimeConfigProvider, - _queryExecutor, - _queryBuilder, - _sqlMetadataLogger); - break; - } - - try - { - await _sqlMetadataProvider.InitializeAsync(); - } - catch (DataGatewayException ex) - { - // use contains to correctly cover db/user unique error messaging - Assert.IsTrue(ex.Message.Contains(DataGatewayException.CONNECTION_STRING_ERROR_MESSAGE)); - Assert.AreEqual(HttpStatusCode.ServiceUnavailable, ex.StatusCode); - Assert.AreEqual(DataGatewayException.SubStatusCodes.ErrorInInitialization, ex.SubStatusCode); - } - } } } diff --git a/DataGateway.Service/CosmosDB_Commands.txt b/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt similarity index 100% rename from DataGateway.Service/CosmosDB_Commands.txt rename to DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt diff --git a/DataGateway.Service/MsSql_Commands.txt b/DataGateway.Service/ConfigFiles/MsSql_Commands.txt similarity index 100% rename from DataGateway.Service/MsSql_Commands.txt rename to DataGateway.Service/ConfigFiles/MsSql_Commands.txt diff --git a/DataGateway.Service/MySql_Commands.txt b/DataGateway.Service/ConfigFiles/MySql_Commands.txt similarity index 100% rename from DataGateway.Service/MySql_Commands.txt rename to DataGateway.Service/ConfigFiles/MySql_Commands.txt diff --git a/DataGateway.Service/PostrgreSql_Commands.txt b/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt similarity index 100% rename from DataGateway.Service/PostrgreSql_Commands.txt rename to DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt diff --git a/DataGateway.Service/hawaii-config.Cosmos.json b/DataGateway.Service/hawaii-config.Cosmos.json new file mode 100644 index 0000000000..9ec6264b20 --- /dev/null +++ b/DataGateway.Service/hawaii-config.Cosmos.json @@ -0,0 +1,75 @@ +{ + "$schema": "../schemas/hawaii.draft-01.schema.json", + "data-source": { + "database-type": "cosmos", + "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" + }, + "cosmos": { + "database": "graphqldb", + "container": "planet", + "schema": "schema.gql" + }, + "runtime": { + "rest": { + "enabled": false + }, + "graphql": { + "enabled": true, + "path": "/graphql", + "allow-introspection": true + }, + "host": { + "mode": "development", + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Planet": { + "source": "graphqldb.planet", + "rest": false, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Character": { + "source": "graphqldb.character", + "rest": false, + "graphql": true, + "permissions": [ + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Star": { + "source": "graphqldb.star", + "rest": false, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + } + } + } \ No newline at end of file diff --git a/DataGateway.Service/hawaii-config.MsSql.json b/DataGateway.Service/hawaii-config.MsSql.json new file mode 100644 index 0000000000..2fbbcf4968 --- /dev/null +++ b/DataGateway.Service/hawaii-config.MsSql.json @@ -0,0 +1,797 @@ +{ + "$schema": "../schemas/hawaii.draft-01.schema.json", + "data-source": { + "database-type": "mssql", + "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" + }, + "mssql": { + "set-session-context": false + }, + "runtime": { + "rest": { + "enabled": true, + "path": "/api" + }, + "graphql": { + "enabled": true, + "path": "/graphql", + "allow-introspection": true + }, + "host": { + "mode": "development", + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Publisher": { + "source": "publishers", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book" + } + } + }, + "Stock": { + "source": "stocks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "comics": { + "cardinality": "many", + "target.entity": "Comic", + "source.fields": [ "categoryName" ], + "target.fields": [ "categoryName" ] + } + } + }, + "Book": { + "source": "books", + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_05", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 10" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_07", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + } + ] + }, + { + "role": "policy_tester_08", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + } + ], + "relationships": { + "publishers": { + "cardinality": "one", + "target.entity": "Publisher" + }, + "websiteplacement": { + "cardinality": "one", + "target.entity": "BookWebsitePlacement" + }, + "reviews": { + "cardinality": "many", + "target.entity": "Review" + }, + "authors": { + "cardinality": "many", + "target.entity": "Author", + "linking.object": "book_author_link", + "linking.source.fields": [ "book_id" ], + "linking.target.fields": [ "author_id" ] + } + }, + "mappings": { + "id": "id", + "title": "title" + } + }, + "BookWebsitePlacement": { + "source": "book_website_placements", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "update", + { + "action": "delete", + "policy": { + "database": "@claims.id eq @item.id" + }, + "fields": { + "include": [ "*" ] + } + } + ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Author": { + "source": "authors", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book", + "linking.object": "book_author_link" + } + } + }, + "Review": { + "source": "reviews", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Comic": { + "source": "comics", + "rest": true, + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Broker": { + "source": "brokers", + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "WebsiteUser": { + "source": "website_users", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "SupportedType": { + "source": "type_table", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "stocks_price": { + "source": "stocks_price", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Tree": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "Scientific Name", + "region": "United State's Region" + } + }, + "Shrub": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "fancyName" + } + }, + "Fungus": { + "source": "fungi", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.region ne 'northeast'" + } + } + ] + } + ], + "mappings": { + "spores": "hazards" + } + }, + "Empty": { + "source": "empty_table", + "rest": true, + "permissions": [ + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Notebook": { + "source": "notebooks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + "create", + "update", + "delete" + ] + } + ] + }, + "Journal": { + "source": "journals", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "policy_tester_noupdate", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + "delete" + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + } + ] + }, + { + "role": "authorizationHandlerTester", + "actions": [ "read" ] + } + ] + }, + "books_view_all": { + "source": "books_view_all", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "stocks_view_selected": { + "source": "stocks_view_selected", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "books_publishers_view_composite": { + "source": "books_publishers_view_composite", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "ArtOfWar": { + "source": "aow", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "*" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ], + "mappings": { + "DetailAssessmentAndPlanning": "始計", + "WagingWar": "作戰", + "StrategicAttack": "謀攻", + "NoteNum": "┬─┬ノ( º _ ºノ)" + } + } + } + } \ No newline at end of file diff --git a/DataGateway.Service/hawaii-config.MySql.json b/DataGateway.Service/hawaii-config.MySql.json new file mode 100644 index 0000000000..834660f026 --- /dev/null +++ b/DataGateway.Service/hawaii-config.MySql.json @@ -0,0 +1,824 @@ +{ + "$schema": "../schemas/hawaii.draft-01.schema.json", + "data-source": { + "database-type": "mysql", + "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" + }, + "runtime": { + "rest": { + "enabled": true, + "path": "/api" + }, + "graphql": { + "enabled": true, + "path": "/graphql", + "allow-introspection": true + }, + "host": { + "mode": "development", + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Publisher": { + "source": "publishers", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book" + } + } + }, + "Stock": { + "source": "stocks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "comics": { + "cardinality": "many", + "target.entity": "Comic", + "source.fields": [ "categoryName" ], + "target.fields": [ "categoryName" ] + } + } + }, + "Book": { + "source": "books", + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_05", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 10" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_07", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + } + ] + }, + { + "role": "policy_tester_08", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + } + ], + "relationships": { + "publishers": { + "cardinality": "one", + "target.entity": "Publisher" + }, + "websiteplacement": { + "cardinality": "one", + "target.entity": "BookWebsitePlacement" + }, + "reviews": { + "cardinality": "many", + "target.entity": "Review" + }, + "authors": { + "cardinality": "many", + "target.entity": "Author", + "linking.object": "book_author_link", + "linking.source.fields": [ "book_id" ], + "linking.target.fields": [ "author_id" ] + } + }, + "mappings": { + "id": "id", + "title": "title" + } + }, + "BookWebsitePlacement": { + "source": "book_website_placements", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "update", + { + "action": "delete", + "policy": { + "database": "@claims.id eq @item.id" + }, + "fields": { + "include": [ "*" ] + } + } + ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Author": { + "source": "authors", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book", + "linking.object": "book_author_link" + } + } + }, + "Review": { + "source": "reviews", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Comic": { + "source": "comics", + "rest": true, + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Broker": { + "source": "brokers", + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "WebsiteUser": { + "source": "website_users", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "SupportedType": { + "source": "type_table", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "stocks_price": { + "source": "stocks_price", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Tree": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "Scientific Name", + "region": "United State's Region" + } + }, + "Shrub": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "fancyName" + } + }, + "Fungus": { + "source": "fungi", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.region ne 'northeast'" + } + } + ] + } + ], + "mappings": { + "spores": "hazards" + } + }, + "Empty": { + "source": "empty_table", + "rest": true, + "permissions": [ + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Notebook": { + "source": "notebooks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + "create", + "update", + "delete" + ] + } + ] + }, + "Journal": { + "source": "journals", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "policy_tester_noupdate", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + "delete" + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + } + ] + }, + { + "role": "authorizationHandlerTester", + "actions": [ "read" ] + } + ] + }, + "books_view_all": { + "source": "books_view_all", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "stocks_view_selected": { + "source": "stocks_view_selected", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "books_publishers_view_composite": { + "source": "books_publishers_view_composite", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "ArtOfWar": { + "source": "aow", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "*" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ], + "mappings": { + "DetailAssessmentAndPlanning": "始計", + "WagingWar": "作戰", + "StrategicAttack": "謀攻", + "NoteNum": "┬─┬ノ( º _ ºノ)" + } + } + } + } \ No newline at end of file diff --git a/DataGateway.Service/hawaii-config.PostgreSql.json b/DataGateway.Service/hawaii-config.PostgreSql.json new file mode 100644 index 0000000000..9d5124176b --- /dev/null +++ b/DataGateway.Service/hawaii-config.PostgreSql.json @@ -0,0 +1,773 @@ +{ + "$schema": "../schemas/hawaii.draft-01.schema.json", + "data-source": { + "database-type": "postgresql", + "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" + }, + "runtime": { + "rest": { + "enabled": true, + "path": "/api" + }, + "graphql": { + "enabled": true, + "path": "/graphql", + "allow-introspection": true + }, + "host": { + "mode": "development", + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Publisher": { + "source": "publishers", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book" + } + } + }, + "Stock": { + "source": "stocks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "comics": { + "cardinality": "many", + "target.entity": "Comic", + "source.fields": [ "categoryName" ], + "target.fields": [ "categoryName" ] + } + } + }, + "Book": { + "source": "books", + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_05", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 10" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_07", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + } + ] + }, + { + "role": "policy_tester_08", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + } + ], + "relationships": { + "publishers": { + "cardinality": "one", + "target.entity": "Publisher" + }, + "websiteplacement": { + "cardinality": "one", + "target.entity": "BookWebsitePlacement" + }, + "reviews": { + "cardinality": "many", + "target.entity": "Review" + }, + "authors": { + "cardinality": "many", + "target.entity": "Author", + "linking.object": "book_author_link", + "linking.source.fields": [ "book_id" ], + "linking.target.fields": [ "author_id" ] + } + }, + "mappings": { + "id": "id", + "title": "title" + } + }, + "BookWebsitePlacement": { + "source": "book_website_placements", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "update", + { + "action": "delete", + "policy": { + "database": "@claims.id eq @item.id" + }, + "fields": { + "include": [ "*" ] + } + } + ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Author": { + "source": "authors", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book", + "linking.object": "book_author_link" + } + } + }, + "Review": { + "source": "reviews", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Comic": { + "source": "comics", + "rest": true, + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Broker": { + "source": "brokers", + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "WebsiteUser": { + "source": "website_users", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "stocks_price": { + "source": "stocks_price", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "SupportedType": { + "source": "type_table", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Tree": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "Scientific Name", + "region": "United State's Region" + } + }, + "Shrub": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "fancyName" + } + }, + "Fungus": { + "source": "fungi", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.region ne 'northeast'" + } + } + ] + } + ], + "mappings": { + "spores": "hazards" + } + }, + "Empty": { + "source": "empty_table", + "rest": true, + "permissions": [ + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Notebook": { + "source": "notebooks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + "create", + "update", + "delete" + ] + } + ] + }, + "Journal": { + "source": "journals", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "policy_tester_noupdate", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + "delete" + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + } + ] + }, + { + "role": "authorizationHandlerTester", + "actions": [ "read" ] + } + ] + }, + "ArtOfWar": { + "source": "aow", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "*" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ], + "mappings": { + "DetailAssessmentAndPlanning": "始計", + "WagingWar": "作戰", + "StrategicAttack": "謀攻", + "NoteNum": "┬─┬ノ( º _ ºノ)" + } + } + } + } \ No newline at end of file From b6e304cd6ec53a8d1c1747f7b071f4ef703dcc70 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 20:25:17 +0530 Subject: [PATCH 05/89] removing unnecessary using statements --- .../Unittests/SqlMetadataProviderUnitTests.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/DataGateway.Service.Tests/Unittests/SqlMetadataProviderUnitTests.cs b/DataGateway.Service.Tests/Unittests/SqlMetadataProviderUnitTests.cs index aa03ebee70..1a13755540 100644 --- a/DataGateway.Service.Tests/Unittests/SqlMetadataProviderUnitTests.cs +++ b/DataGateway.Service.Tests/Unittests/SqlMetadataProviderUnitTests.cs @@ -1,12 +1,7 @@ -using System.Net; using System.Threading.Tasks; -using Azure.DataGateway.Config; -using Azure.DataGateway.Service.Exceptions; using Azure.DataGateway.Service.Services; using Azure.DataGateway.Service.Tests.SqlTests; -using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Moq; namespace Azure.DataGateway.Service.Tests.UnitTests { From 05d5dbb60a0c74ce17bd59f5121d5ec4d4258fb3 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 21:23:25 +0530 Subject: [PATCH 06/89] fixing errors in pipeline yml files --- .pipelines/cosmos-pipelines.yml | 34 +++++++++++++++------------- .pipelines/mssql-pipelines.yml | 40 ++++++++++++++++++--------------- .pipelines/mysql-pipelines.yml | 20 +++++++++-------- .pipelines/pg-pipelines.yml | 20 +++++++++-------- 4 files changed, 62 insertions(+), 52 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 67f4cfe39a..b1a4199447 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -33,25 +33,27 @@ steps: displayName: Restore NuGet packages inputs: restoreSolution: '$(solution)' --task: DotNetCoreCLI@2 +- task: DotNetCoreCLI@2 displayName: Pack the CLI tool - command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' --task: DotNetCoreCLI@2 + inputs: + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' +- task: DotNetCoreCLI@2 displayName: Install the CLI tool - command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' --script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' - failOnStderr: true - condition: eq( variables['Agent.OS'], 'Windows' ) --bash: | + inputs: + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' +- script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' + failOnStderr: true + condition: eq( variables['Agent.OS'], 'Windows' ) +- bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' - failOnStderr: true - condition: in( variables['Agent.OS'], 'Linux', 'macOs' ) + workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' + failOnStderr: true + condition: in( variables['Agent.OS'], 'Linux', 'macOs' ) - task: FileTransform@1 displayName: 'Generate hawaii-config.Cosmos.json' inputs: diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index da1c128247..a98f58a85f 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -39,19 +39,21 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu SQL Server Image Docker - -task: DotNetCoreCLI@2 + - task: DotNetCoreCLI@2 displayName: Pack the CLI tool - command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + inputs: + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - -task: DotNetCoreCLI@2 + - task: DotNetCoreCLI@2 displayName: Install the CLI tool - command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + inputs: + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - -bash: | + - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true @@ -136,19 +138,21 @@ jobs: SqlLocalDb.exe start MSSQLLocalDB SqlLocalDb.exe info "MSSQLLocalDB" - -task: DotNetCoreCLI@2 + - task: DotNetCoreCLI@2 displayName: Pack the CLI tool - command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + inputs: + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - -task: DotNetCoreCLI@2 + - task: DotNetCoreCLI@2 displayName: Install the CLI tool - command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + inputs: + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - -script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt + - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 3f8f1072e1..a4cf61c66c 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -43,19 +43,21 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu MySql Image Docker - -task: DotNetCoreCLI@2 + - task: DotNetCoreCLI@2 displayName: Pack the CLI tool - command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + inputs: + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - -task: DotNetCoreCLI@2 + - task: DotNetCoreCLI@2 displayName: Install the CLI tool - command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + inputs: + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - -bash: | + - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MySql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 47dbdbafc8..1182656c9f 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -39,19 +39,21 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu Postgres Image Docker - -task: DotNetCoreCLI@2 + - task: DotNetCoreCLI@2 displayName: Pack the CLI tool - command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + inputs: + command: pack + projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - -task: DotNetCoreCLI@2 + - task: DotNetCoreCLI@2 displayName: Install the CLI tool - command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + inputs: + command: custom + custom: 'tool install -g' + arguements: '--add-source ./nupkg hawaii-cli' + workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - -bash: | + - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true From 70f00fca1356cedcb65f9f8ce6f4678734695b5b Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 21:31:22 +0530 Subject: [PATCH 07/89] fixing mistake in dotnet command --- .pipelines/cosmos-pipelines.yml | 4 ++-- .pipelines/mssql-pipelines.yml | 8 ++++---- .pipelines/mysql-pipelines.yml | 4 ++-- .pipelines/pg-pipelines.yml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index b1a4199447..67390c09b6 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -42,8 +42,8 @@ steps: displayName: Install the CLI tool inputs: command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' + custom: 'tool install' + arguements: '-g --add-source ./nupkg hawaii-cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index a98f58a85f..284d665976 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -49,8 +49,8 @@ jobs: displayName: Install the CLI tool inputs: command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' + custom: 'tool install' + arguements: '-g --add-source ./nupkg hawaii-cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - bash: | @@ -148,8 +148,8 @@ jobs: displayName: Install the CLI tool inputs: command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' + custom: 'tool install' + arguements: '-g --add-source ./nupkg hawaii-cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index a4cf61c66c..82342f4600 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -53,8 +53,8 @@ jobs: displayName: Install the CLI tool inputs: command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' + custom: 'tool install' + arguements: '-g --add-source ./nupkg hawaii-cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - bash: | diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 1182656c9f..026d1ef40d 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -49,8 +49,8 @@ jobs: displayName: Install the CLI tool inputs: command: custom - custom: 'tool install -g' - arguements: '--add-source ./nupkg hawaii-cli' + custom: 'tool install' + arguements: '-g --add-source ./nupkg hawaii-cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - bash: | From ed6e9d20b3e6bd4adeab51ce126e85bd3f613f41 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 21:47:56 +0530 Subject: [PATCH 08/89] fixing install command --- .pipelines/cosmos-pipelines.yml | 2 +- .pipelines/mssql-pipelines.yml | 4 ++-- .pipelines/mysql-pipelines.yml | 2 +- .pipelines/pg-pipelines.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 67390c09b6..062f60c124 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -43,7 +43,7 @@ steps: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii-cli' + arguements: '-g --add-source ./nupkg hawaii.cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 284d665976..cf26de9565 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -50,7 +50,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii-cli' + arguements: '-g --add-source ./nupkg hawaii.cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - bash: | @@ -149,7 +149,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii-cli' + arguements: '-g --add-source ./nupkg hawaii.cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 82342f4600..a8b92b72a9 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -54,7 +54,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii-cli' + arguements: '-g --add-source ./nupkg hawaii.cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - bash: | diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 026d1ef40d..887b64f833 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -50,7 +50,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii-cli' + arguements: '-g --add-source ./nupkg hawaii.cli' workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - bash: | From dce1f542e6fa798c0b2270db81bdfb0ebdcd4fa0 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 22:23:34 +0530 Subject: [PATCH 09/89] changing the install command arguements --- .pipelines/cosmos-pipelines.yml | 3 +-- .pipelines/mssql-pipelines.yml | 8 +++----- .pipelines/mysql-pipelines.yml | 5 ++--- .pipelines/pg-pipelines.yml | 5 ++--- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 062f60c124..783f2e48f9 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -43,8 +43,7 @@ steps: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii.cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' failOnStderr: true diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index cf26de9565..f868736510 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -50,8 +50,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii.cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt @@ -149,9 +148,8 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii.cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - + arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' + - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' failOnStderr: true diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index a8b92b72a9..22e1613e99 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -54,9 +54,8 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii.cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - + arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' + - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MySql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 887b64f833..257de55d10 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -50,9 +50,8 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source ./nupkg hawaii.cli' - workingDirectory: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' - + arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' + - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' From 31496b4402e03d39bd59a831714c58454561b5a5 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 23:16:28 +0530 Subject: [PATCH 10/89] adding required options with pack command --- .pipelines/cosmos-pipelines.yml | 13 +++++++------ .pipelines/mssql-pipelines.yml | 14 ++++++++------ .pipelines/mysql-pipelines.yml | 7 ++++--- .pipelines/pg-pipelines.yml | 9 +++++---- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 783f2e48f9..6db02b60c1 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -37,20 +37,21 @@ steps: displayName: Pack the CLI tool inputs: command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + packagesToPack: '**/Hawaii.Cli.csproj' + packDirectory: '$(Build.ArtifactStagingDirectory)' - task: DotNetCoreCLI@2 displayName: Install the CLI tool inputs: command: custom custom: 'tool install' - arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' -- script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt + arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' +- script: cmd < DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' failOnStderr: true condition: eq( variables['Agent.OS'], 'Windows' ) - bash: | - .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' + .**/CosmosDB_Commands.txt + workingDirectory: './DataGateway.Service/ConfigFiles' failOnStderr: true condition: in( variables['Agent.OS'], 'Linux', 'macOs' ) - task: FileTransform@1 @@ -58,7 +59,7 @@ steps: inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'DataGateway.Service/hawaii-config.Cosmos.json' + targetFiles: 'DataGateway.Service/ConfigFiles/hawaii-config.Cosmos.json' - task: DotNetCoreCLI@2 displayName: Build inputs: diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index f868736510..d00874678f 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -43,14 +43,15 @@ jobs: displayName: Pack the CLI tool inputs: command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + packagesToPack: '**/Hawaii.Cli.csproj' + packDirectory: '$(Build.ArtifactStagingDirectory)' - task: DotNetCoreCLI@2 displayName: Install the CLI tool inputs: command: custom custom: 'tool install' - arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' + arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt @@ -62,7 +63,7 @@ jobs: inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'DataGateway.Service/hawaii-config.MsSql.json' + targetFiles: 'DataGateway.Service/ConfigFiles/hawaii-config.MsSql.json' - task: DotNetCoreCLI@2 displayName: Build @@ -141,14 +142,15 @@ jobs: displayName: Pack the CLI tool inputs: command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + packagesToPack: '**/Hawaii.Cli.csproj' + packDirectory: '$(Build.ArtifactStagingDirectory)' - task: DotNetCoreCLI@2 displayName: Install the CLI tool inputs: command: custom custom: 'tool install' - arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' + arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' @@ -159,7 +161,7 @@ jobs: inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'DataGateway.Service/hawaii-config.MsSql.json' + targetFiles: 'DataGateway.Service/ConfigFiles/hawaii-config.MsSql.json' - task: DotNetCoreCLI@2 displayName: Build diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 22e1613e99..30cbc43595 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -47,14 +47,15 @@ jobs: displayName: Pack the CLI tool inputs: command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + packagesToPack: '**/Hawaii.Cli.csproj' + packDirectory: '$(Build.ArtifactStagingDirectory)' - task: DotNetCoreCLI@2 displayName: Install the CLI tool inputs: command: custom custom: 'tool install' - arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' + arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MySql_Commands.txt @@ -66,7 +67,7 @@ jobs: inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'DataGateway.Service/hawaii-config.MySql.json' + targetFiles: 'DataGateway.Service/ConfigFiles/hawaii-config.MySql.json' - task: DotNetCoreCLI@2 displayName: Build diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 257de55d10..7dd546c399 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -43,14 +43,15 @@ jobs: displayName: Pack the CLI tool inputs: command: pack - projects: '$(System.DefaultWorkingDirectory)/Hawaii-Cli/src' + packagesToPack: '**/Hawaii.Cli.csproj' + packDirectory: '$(Build.ArtifactStagingDirectory)' - task: DotNetCoreCLI@2 displayName: Install the CLI tool inputs: command: custom - custom: 'tool install' - arguements: '-g --add-source $(System.DefaultWorkingDirectory)/Hawaii-Cli/src/nupkg hawaii.cli' + custom: tool install + arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt @@ -62,7 +63,7 @@ jobs: inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'DataGateway.Service/hawaii-config.PostgreSql.json' + targetFiles: 'DataGateway.Service/ConfigFiles/hawaii-config.PostgreSql.json' - task: DotNetCoreCLI@2 displayName: Build From a569b151d35da7f0632a236bb5b634b17fb206e6 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 23:32:13 +0530 Subject: [PATCH 11/89] fixing typo in arguments field --- .pipelines/mssql-pipelines.yml | 4 ++-- .pipelines/mysql-pipelines.yml | 2 +- .pipelines/pg-pipelines.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index d00874678f..bf03b6e1be 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -51,7 +51,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt @@ -150,7 +150,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 30cbc43595..16cdf8a706 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -55,7 +55,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MySql_Commands.txt diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 7dd546c399..624b914480 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -51,7 +51,7 @@ jobs: inputs: command: custom custom: tool install - arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt From 7360720ad15b250784e185e84cee3ecf32216512 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 23:32:48 +0530 Subject: [PATCH 12/89] adding cosmos pipeline for the same change --- .pipelines/cosmos-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 6db02b60c1..78f8a3a9eb 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -44,7 +44,7 @@ steps: inputs: command: custom custom: 'tool install' - arguements: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' - script: cmd < DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' failOnStderr: true From c30f6eab9afb0885e0012705aa6f9727c3758130 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 23:42:28 +0530 Subject: [PATCH 13/89] changing the path for the nupkg file --- .pipelines/cosmos-pipelines.yml | 2 +- .pipelines/mssql-pipelines.yml | 4 ++-- .pipelines/mysql-pipelines.yml | 2 +- .pipelines/pg-pipelines.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 78f8a3a9eb..a38564d9e4 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -44,7 +44,7 @@ steps: inputs: command: custom custom: 'tool install' - arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' - script: cmd < DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' failOnStderr: true diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index bf03b6e1be..b2bbe940c3 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -51,7 +51,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt @@ -150,7 +150,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 16cdf8a706..80cd141608 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -55,7 +55,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MySql_Commands.txt diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 624b914480..df2f577375 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -51,7 +51,7 @@ jobs: inputs: command: custom custom: tool install - arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt From 6059343c6c98f8d5a5778795b5de5c5e83996025 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 8 Aug 2022 23:54:21 +0530 Subject: [PATCH 14/89] figuring the right path for cli nupkg --- .pipelines/mysql-pipelines.yml | 2 +- .pipelines/pg-pipelines.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 80cd141608..e6b5d974e0 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -55,7 +55,7 @@ jobs: inputs: command: custom custom: 'tool install' - arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii-cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MySql_Commands.txt diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index df2f577375..4605e8a9e3 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -51,7 +51,7 @@ jobs: inputs: command: custom custom: tool install - arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' + arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii-cli' - bash: | .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt From 4f968772eeb1e05fb886b33d0c37ccda3307a729 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 14 Aug 2022 10:58:13 +0530 Subject: [PATCH 15/89] mrege conflict changes --- .pipelines/pg-pipelines.yml | 21 +--- .../ConfigFiles/CosmosDB_Commands.txt | 6 -- .../ConfigFiles/MsSql_Commands.txt | 97 ------------------- .../ConfigFiles/MySql_Commands.txt | 96 ------------------ .../ConfigFiles/PostrgreSql_Commands.txt | 96 ------------------ src/Service.Tests/TestHelper.cs | 2 +- .../Unittests/RestServiceUnitTests.cs | 2 - 7 files changed, 2 insertions(+), 318 deletions(-) delete mode 100644 DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt delete mode 100644 DataGateway.Service/ConfigFiles/MsSql_Commands.txt delete mode 100644 DataGateway.Service/ConfigFiles/MySql_Commands.txt delete mode 100644 DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index ed0c7fa88f..a3b746ade7 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -38,26 +38,7 @@ jobs: -d postgres condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu Postgres Image Docker - - - task: DotNetCoreCLI@2 - displayName: Pack the CLI tool - inputs: - command: pack - packagesToPack: '**/Hawaii.Cli.csproj' - packDirectory: '$(Build.ArtifactStagingDirectory)' - - - task: DotNetCoreCLI@2 - displayName: Install the CLI tool - inputs: - command: custom - custom: tool install - arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii-cli' - - - bash: | - .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' - failOnStderr: true - + - task: FileTransform@1 displayName: 'Generate dab-config.PostgreSql.json' inputs: diff --git a/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt b/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt deleted file mode 100644 index 69ed7dfafe..0000000000 --- a/DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt +++ /dev/null @@ -1,6 +0,0 @@ -hawaii init --name "hawaii-config.Cosmos" --database-type "cosmos" --connection-string " " --cosmos-database "graphqldb" --cosmos-container "planet" --graphql-schema "schema.gql" --host-mode Development --cors-origin "http://localhost:5000" -hawaii add Planet --name "hawaii-config.Cosmos" --source "graphqldb.planet" --permissions "anonymous:create,read,update,delete" --rest false --graphql true -hawaii update Planet --name "hawaii-config.Cosmos" --permissions "authenticated:create,read,update,delete" -hawaii add Character --name "hawaii-config.Cosmos" --source "graphqldb.character" --permissions "authenticated:create,read,update,delete" --rest false --graphql true -hawaii add Star --name "hawaii-config.Cosmos" --source "graphqldb.star" --permissions "anonymous:create,read,update,delete" --rest false --graphql true -hawaii update Star --name "hawaii-config.Cosmos" --source "graphqldb.star" --permissions "authenticated:create,read,update,delete" diff --git a/DataGateway.Service/ConfigFiles/MsSql_Commands.txt b/DataGateway.Service/ConfigFiles/MsSql_Commands.txt deleted file mode 100644 index 5754fbd334..0000000000 --- a/DataGateway.Service/ConfigFiles/MsSql_Commands.txt +++ /dev/null @@ -1,97 +0,0 @@ -hawaii init --name "hawaii-config.MsSql" --database-type mssql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" -hawaii add Publisher --name "hawaii-config.MsSql" --source publishers --permissions "anonymous:read" -hawaii add Stock --name "hawaii-config.MsSql" --source stocks --permissions "anonymous:create,read,update" -hawaii add Book --name "hawaii-config.MsSql" --source books --permissions "anonymous:read" -hawaii add BookWebsitePlacement --name "hawaii-config.MsSql" --source book_website_placements --permissions "anonymous:read" -hawaii add Author --name "hawaii-config.MsSql" --source authors --permissions "anonymous:read" -hawaii add Review --name "hawaii-config.MsSql" --source reviews --permissions "anonymous:read" -hawaii add Comic --name "hawaii-config.MsSql" --source comics --permissions "anonymous:read" -hawaii add Broker --name "hawaii-config.MsSql" --source brokers --permissions "anonymous:read" -hawaii add WebsiteUser --name "hawaii-config.MsSql" --source website_users --permissions "anonymous:create,read,delete,update" -hawaii add SupportedType --name "hawaii-config.MsSql" --source type_table --permissions "anonymous:create,read,delete,update" -hawaii add stocks_price --name "hawaii-config.MsSql" --source stocks_price --permissions "anonymous:read" -hawaii add Tree --name "hawaii-config.MsSql" --source trees --permissions "anonymous:create,read,update,delete" -hawaii add Shrub --name "hawaii-config.MsSql" --source trees --permissions "anonymous:create,read,update,delete" -hawaii add Fungus --name "hawaii-config.MsSql" --source fungi --permissions "anonymous:create,read,update,delete" -hawaii add books_view_all --name "hawaii-config.MsSql" --source books_view_all --permissions "anonymous:read" -hawaii add stocks_view_selected --name "hawaii-config.MsSql" --source stocks_view_selected --permissions "anonymous:read" -hawaii add books_publishers_view_composite --name "hawaii-config.MsSql" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true -hawaii add Empty --name "hawaii-config.MsSql" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true -hawaii add Notebook --name "hawaii-config.MsSql" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" -hawaii add Journal --name "hawaii-config.MsSql" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" -hawaii add ArtOfWar --name "hawaii-config.MsSql" --source "aow" --rest true --permissions "anonymous:*" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_01:create,delete" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_01:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_02:create,delete" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_02:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_03:create,delete" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_03:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_04:create,delete" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_04:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_06:create,delete" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_06:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MsSql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -hawaii update Stock --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" -hawaii update Book --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" -hawaii update Book --name "hawaii-config.MsSql" --relationship publishers --target.entity Publisher --cardinality one -hawaii update Book --name "hawaii-config.MsSql" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one -hawaii update Book --name "hawaii-config.MsSql" --relationship reviews --target.entity Review --cardinality many -hawaii update Book --name "hawaii-config.MsSql" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -hawaii update Book --name "hawaii-config.MsSql" --map "id:id,title:title" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_01:create,delete" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_01:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_02:create,delete" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_02:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_03:create,delete" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_03:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_04:create,delete" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_04:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_05:create,delete" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_05:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_06:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_06:create,delete" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_07:create" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_07:read" --fields.include "*" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_08:create" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update Book --name "hawaii-config.MsSql" --permissions "policy_tester_08:read" --fields.include "*" -hawaii update BookWebsitePlacement --name "hawaii-config.MsSql" --permissions "authenticated:create,update" --rest true --graphql true -hawaii update BookWebsitePlacement --name "hawaii-config.MsSql" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" -hawaii update Author --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -hawaii update WebsiteUser --name "hawaii-config.MsSql" --permissions "authenticated:create,read,delete,update" --rest false -hawaii update stocks_price --name "hawaii-config.MsSql" --permissions "authenticated:create,read,delete,update" --rest false -hawaii update Comic --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql false -hawaii update Broker --name "hawaii-config.MsSql" --permissions "authenticated:create,update,read,delete" --graphql false -hawaii update Tree --name "hawaii-config.MsSql" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -hawaii update Shrub --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -hawaii update Fungus --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true -hawaii update Fungus --name "hawaii-config.MsSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" -hawaii update books_view_all --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -hawaii update stocks_view_selected --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" -hawaii update books_publishers_view_composite --name "hawaii-config.MsSql" --permissions "authenticated:create,read,update,delete" -hawaii update BookWebsitePlacement --name "hawaii-config.MsSql" --relationship books --target.entity Book --cardinality one -hawaii update SupportedType --name "hawaii-config.MsSql" --permissions "authenticated:create,read,delete,update" --rest false -hawaii update Author --name "hawaii-config.MsSql" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -hawaii update Notebook --name "hawaii-config.MsSql" --permissions "anonymous:create,update,delete" -hawaii update Journal --name "hawaii-config.MsSql" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" -hawaii update Journal --name "hawaii-config.MsSql" --permissions "authenticated:read" --fields.include "*" -hawaii update Journal --name "hawaii-config.MsSql" --permissions "policy_tester_update_noread:create" -hawaii update Journal --name "hawaii-config.MsSql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" -hawaii update Journal --name "hawaii-config.MsSql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -hawaii update Journal --name "hawaii-config.MsSql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" -hawaii update Journal --name "hawaii-config.MsSql" --permissions "authorizationHandlerTester:read" -hawaii update ArtOfWar --name "hawaii-config.MsSql" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/DataGateway.Service/ConfigFiles/MySql_Commands.txt b/DataGateway.Service/ConfigFiles/MySql_Commands.txt deleted file mode 100644 index d6ecfcf328..0000000000 --- a/DataGateway.Service/ConfigFiles/MySql_Commands.txt +++ /dev/null @@ -1,96 +0,0 @@ -hawaii init --name "hawaii-config.MySql" --database-type mysql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" -hawaii add Publisher --name "hawaii-config.MySql" --source publishers --permissions "anonymous:read" -hawaii add Stock --name "hawaii-config.MySql" --source stocks --permissions "anonymous:create,read,update" -hawaii add Book --name "hawaii-config.MySql" --source books --permissions "anonymous:read" -hawaii add BookWebsitePlacement --name "hawaii-config.MySql" --source book_website_placements --permissions "anonymous:read" -hawaii add Author --name "hawaii-config.MySql" --source authors --permissions "anonymous:read" -hawaii add Review --name "hawaii-config.MySql" --source reviews --permissions "anonymous:read" -hawaii add Comic --name "hawaii-config.MySql" --source comics --permissions "anonymous:read" -hawaii add Broker --name "hawaii-config.MySql" --source brokers --permissions "anonymous:read" -hawaii add WebsiteUser --name "hawaii-config.MySql" --source website_users --permissions "anonymous:create,read,delete,update" -hawaii add SupportedType --name "hawaii-config.MySql" --source type_table --permissions "anonymous:create,read,delete,update" -hawaii add stocks_price --name "hawaii-config.MySql" --source stocks_price --permissions "anonymous:read" -hawaii add Tree --name "hawaii-config.MySql" --source trees --permissions "anonymous:create,read,update,delete" -hawaii add Shrub --name "hawaii-config.MySql" --source trees --permissions "anonymous:create,read,update,delete" -hawaii add Fungus --name "hawaii-config.MySql" --source fungi --permissions "anonymous:create,read,update,delete" -hawaii add books_view_all --name "hawaii-config.MySql" --source books_view_all --permissions "anonymous:read" -hawaii add stocks_view_selected --name "hawaii-config.MySql" --source stocks_view_selected --permissions "anonymous:read" -hawaii add books_publishers_view_composite --name "hawaii-config.MySql" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true -hawaii add Empty --name "hawaii-config.MySql" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true -hawaii add Notebook --name "hawaii-config.MySql" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" -hawaii add Journal --name "hawaii-config.MySql" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" -hawaii add ArtOfWar --name "hawaii-config.MySql" --source "aow" --rest true --permissions "anonymous:*" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_01:create,delete" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_01:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_02:create,delete" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_02:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_03:create,delete" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_03:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_04:create,delete" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_04:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_06:create,delete" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_06:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.MySql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -hawaii update Stock --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" -hawaii update Book --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" -hawaii update Book --name "hawaii-config.MySql" --relationship publishers --target.entity Publisher --cardinality one -hawaii update Book --name "hawaii-config.MySql" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one -hawaii update Book --name "hawaii-config.MySql" --relationship reviews --target.entity Review --cardinality many -hawaii update Book --name "hawaii-config.MySql" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -hawaii update Book --name "hawaii-config.MySql" --map "id:id,title:title" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_01:create,delete" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_01:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_02:create,delete" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_02:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_03:create,delete" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_03:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_04:create,delete" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_05:create,delete" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_05:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_06:update" --fields.include "*" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_07:create" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_07:read" --fields.include "*" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_08:read" --fields.include "*" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:create" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -hawaii update Book --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update BookWebsitePlacement --name "hawaii-config.MySql" --permissions "authenticated:create,update" --rest true --graphql true -hawaii update Author --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -hawaii update WebsiteUser --name "hawaii-config.MySql" --permissions "authenticated:create,read,delete,update" --rest false -hawaii update stocks_price --name "hawaii-config.MySql" --permissions "authenticated:create,read,delete,update" --rest false -hawaii update Comic --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql false -hawaii update Broker --name "hawaii-config.MySql" --permissions "authenticated:create,update,read,delete" --graphql false -hawaii update Tree --name "hawaii-config.MySql" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -hawaii update Shrub --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -hawaii update Fungus --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true -hawaii update Fungus --name "hawaii-config.MySql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" -hawaii update books_view_all --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -hawaii update stocks_view_selected --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" -hawaii update books_publishers_view_composite --name "hawaii-config.MySql" --permissions "authenticated:create,read,update,delete" -hawaii update BookWebsitePlacement --name "hawaii-config.MySql" --relationship books --target.entity Book --cardinality one -hawaii update SupportedType --name "hawaii-config.MySql" --permissions "authenticated:create,read,delete,update" --rest false -hawaii update Author --name "hawaii-config.MySql" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -hawaii update Review --name "hawaii-config.MySql" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one -hawaii update Notebook --name "hawaii-config.MySql" --permissions "anonymous:create,update,delete" -hawaii update Journal --name "hawaii-config.MySql" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" -hawaii update Journal --name "hawaii-config.MySql" --permissions "authenticated:read" --fields.include "*" -hawaii update Journal --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:create" -hawaii update Journal --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" -hawaii update Journal --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -hawaii update Journal --name "hawaii-config.MySql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" -hawaii update Journal --name "hawaii-config.MySql" --permissions "authorizationHandlerTester:read" -hawaii update ArtOfWar --name "hawaii-config.MySql" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt b/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt deleted file mode 100644 index 7c7c9394e7..0000000000 --- a/DataGateway.Service/ConfigFiles/PostrgreSql_Commands.txt +++ /dev/null @@ -1,96 +0,0 @@ -hawaii init --name "hawaii-config.PostgreSql" --database-type postgresql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" -hawaii add Publisher --name "hawaii-config.PostgreSql" --source publishers --permissions "anonymous:read" -hawaii add Stock --name "hawaii-config.PostgreSql" --source stocks --permissions "anonymous:create,read,update" -hawaii add Book --name "hawaii-config.PostgreSql" --source books --permissions "anonymous:read" -hawaii add BookWebsitePlacement --name "hawaii-config.PostgreSql" --source book_website_placements --permissions "anonymous:read" -hawaii add Author --name "hawaii-config.PostgreSql" --source authors --permissions "anonymous:read" -hawaii add Review --name "hawaii-config.PostgreSql" --source reviews --permissions "anonymous:read" -hawaii add Comic --name "hawaii-config.PostgreSql" --source comics --permissions "anonymous:read" -hawaii add Broker --name "hawaii-config.PostgreSql" --source brokers --permissions "anonymous:read" -hawaii add WebsiteUser --name "hawaii-config.PostgreSql" --source website_users --permissions "anonymous:create,read,delete,update" -hawaii add SupportedType --name "hawaii-config.PostgreSql" --source type_table --permissions "anonymous:create,read,delete,update" -hawaii add stocks_price --name "hawaii-config.PostgreSql" --source stocks_price --permissions "anonymous:read" -hawaii add Tree --name "hawaii-config.PostgreSql" --source trees --permissions "anonymous:create,read,update,delete" -hawaii add Shrub --name "hawaii-config.PostgreSql" --source trees --permissions "anonymous:create,read,update,delete" -hawaii add Fungus --name "hawaii-config.PostgreSql" --source fungi --permissions "anonymous:create,read,update,delete" -hawaii add Empty --name "hawaii-config.PostgreSql" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true -hawaii add Notebook --name "hawaii-config.PostgreSql" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" -hawaii add Journal --name "hawaii-config.PostgreSql" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" -hawaii add ArtOfWar --name "hawaii-config.PostgreSql" --source "aow" --rest true --permissions "anonymous:*" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:create,delete" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:create,delete" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:create,delete" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:create,delete" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:create,delete" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:update" --fields.include "*" -hawaii update Publisher --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -hawaii update Stock --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" -hawaii update Book --name "hawaii-config.PostgreSql" --relationship publishers --target.entity Publisher --cardinality one -hawaii update Book --name "hawaii-config.PostgreSql" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one -hawaii update Book --name "hawaii-config.PostgreSql" --relationship reviews --target.entity Review --cardinality many -hawaii update Book --name "hawaii-config.PostgreSql" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -hawaii update Book --name "hawaii-config.PostgreSql" --map "id:id,title:title" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:create,delete" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:update" --fields.include "*" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:create,delete" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:update" --fields.include "*" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:create,delete" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:update" --fields.include "*" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:create,delete" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:update" --fields.include "*" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_05:create,delete" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_05:update" --fields.include "*" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:update" --fields.include "*" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:create,delete" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_07:create" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_07:read" --fields.include "*" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_08:create" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_08:read" --fields.include "*" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:create" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -hawaii update Book --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 9" -hawaii update BookWebsitePlacement --name "hawaii-config.PostgreSql" --permissions "authenticated:create,update" --rest true --graphql true -hawaii update BookWebsitePlacement --name "hawaii-config.PostgreSql" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" -hawaii update Author --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -hawaii update WebsiteUser --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,delete,update" --rest false -hawaii update stocks_price --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,delete,update" --rest false -hawaii update Comic --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --rest true --graphql false -hawaii update Broker --name "hawaii-config.PostgreSql" --permissions "authenticated:create,update,read,delete" --graphql false -hawaii update Tree --name "hawaii-config.PostgreSql" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -hawaii update Shrub --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -hawaii update Fungus --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true -hawaii update Fungus --name "hawaii-config.PostgreSql" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" -hawaii update BookWebsitePlacement --name "hawaii-config.PostgreSql" --relationship books --target.entity Book --cardinality one -hawaii update SupportedType --name "hawaii-config.PostgreSql" --permissions "authenticated:create,read,delete,update" --rest false -hawaii update Author --name "hawaii-config.PostgreSql" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -hawaii update Review --name "hawaii-config.PostgreSql" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one -hawaii update Notebook --name "hawaii-config.PostgreSql" --permissions "anonymous:create,update,delete" -hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" -hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "authenticated:read" --fields.include "*" -hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:create" -hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" -hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" -hawaii update Journal --name "hawaii-config.PostgreSql" --permissions "authorizationHandlerTester:read" -hawaii update ArtOfWar --name "hawaii-config.PostgreSql" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/src/Service.Tests/TestHelper.cs b/src/Service.Tests/TestHelper.cs index 7d1438e724..83609ab8a2 100644 --- a/src/Service.Tests/TestHelper.cs +++ b/src/Service.Tests/TestHelper.cs @@ -33,7 +33,7 @@ public static RuntimeConfigPath GetRuntimeConfigPath(string environment) }; IConfigurationRoot config = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory() + "/ConfigFiles") + .SetBasePath(Directory.GetCurrentDirectory()) .AddInMemoryCollection(configFileNameMap) .Build(); diff --git a/src/Service.Tests/Unittests/RestServiceUnitTests.cs b/src/Service.Tests/Unittests/RestServiceUnitTests.cs index c462679310..2e0b398b66 100644 --- a/src/Service.Tests/Unittests/RestServiceUnitTests.cs +++ b/src/Service.Tests/Unittests/RestServiceUnitTests.cs @@ -34,7 +34,6 @@ public class RestServiceUnitTests /// The primary key route we /// expect to parse from route. [DataTestMethod] - [TestCategory(TestCategory.MSSQL)] [DataRow("foo", "", "foo", "")] [DataRow("foo/", "", "foo", "")] [DataRow("foo", "/", "foo", "")] @@ -78,7 +77,6 @@ public void ParseEntityNameAndPrimaryKeyTest(string route, /// The route to be parsed. /// An invalid path for the given route. [DataTestMethod] - [TestCategory(TestCategory.MSSQL)] [DataRow("foo", "bar")] [DataRow("\\foo", "foo")] [DataRow("\"foo\"", "foo")] From 96d757126630febb207f68cbb3526b5015ab8f1f Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 14 Aug 2022 17:55:13 +0530 Subject: [PATCH 16/89] adding scripts to generate config files using dab commands --- configGenerator.ps1 | 12 ++++++++++++ configGenerator.sh | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 configGenerator.ps1 create mode 100644 configGenerator.sh diff --git a/configGenerator.ps1 b/configGenerator.ps1 new file mode 100644 index 0000000000..02ca2cc471 --- /dev/null +++ b/configGenerator.ps1 @@ -0,0 +1,12 @@ +param( + [Parameter (Mandatory=$true)][string] $databaseType +) + +$fileName = $databaseType + "Commands.txt"; +$pathToDabExe = Get-ChildItem -Path .\src\out\cli\ -Recurse -include "dab.exe" | %{$_.FullName} ; + +# Generating the config files using dab commands +foreach($command in Get-Content $fileName){ + $commandToExecute = $pathToDabExe + " " + $command; + Invoke-Expression $commandToExecute; +} diff --git a/configGenerator.sh b/configGenerator.sh new file mode 100644 index 0000000000..ffb017615f --- /dev/null +++ b/configGenerator.sh @@ -0,0 +1,12 @@ +#!/bin/bash +databaseType=$1; +fileName="${databaseType}Commands.txt"; +#Fetching the path to dab dll +pathToDLL=$(find ./src/out/cli -name dab.dll) +#Generating the config using dab commands +echo "Generating config file using dab commands"; +while read -r command; do + cmd="dotnet ${pathToDLL} ${command}"; + eval $cmd; +done <$fileName; +echo "Successfully generated the config file." From 25a2e1547060827396b77563990ce03a9da661d0 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 14 Aug 2022 18:05:03 +0530 Subject: [PATCH 17/89] adding commands to generate cosmos config file --- CosmosCommands.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 CosmosCommands.txt diff --git a/CosmosCommands.txt b/CosmosCommands.txt new file mode 100644 index 0000000000..8a5fd5376a --- /dev/null +++ b/CosmosCommands.txt @@ -0,0 +1,6 @@ +init --config "dab-config.Cosmos.json" --database-type "cosmos" --connection-string " " --cosmos-database "graphqldb" --cosmos-container "planet" --graphql-schema "schema.gql" --host-mode Development --cors-origin "http://localhost:5000" +add Planet --config "dab-config.Cosmos.json" --source "graphqldb.planet" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Planet:Planets" +update Planet --config "dab-config.Cosmos.json" --permissions "authenticated:create,read,update,delete" +add Character --config "dab-config.Cosmos.json" --source "graphqldb.character" --permissions "authenticated:create,read,update,delete" --rest false --graphql "Character:Characters" +add Star --config "dab-config.Cosmos.json" --source "graphqldb.star" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Star:Stars" +update Star --config "dab-config.Cosmos.json" --source "graphqldb.star" --permissions "authenticated:create,read,update,delete" From 5063ebd09d84cb3d91424847275137e880471a49 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 14 Aug 2022 19:11:25 +0530 Subject: [PATCH 18/89] adding commands for MsSql config --- MsSqlCommands.txt | 98 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 MsSqlCommands.txt diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt new file mode 100644 index 0000000000..703ed57c7c --- /dev/null +++ b/MsSqlCommands.txt @@ -0,0 +1,98 @@ +init --config "dab-config.MsSql.json" --database-type mssql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +add Publisher --config "dab-config.MsSql.json" --source publishers --permissions "anonymous:read" +add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonymous:create,read,update" +add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:read" +add BookWebsitePlacement --config "dab-config.MsSql.json" --source book_website_placements --permissions "anonymous:read" +add Author --config "dab-config.MsSql.json" --source authors --permissions "anonymous:read" +add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:read" --graphql "review:reviews" +add Comic --config "dab-config.MsSql.json" --source comics --permissions "anonymous:read" +add Broker --config "dab-config.MsSql.json" --source brokers --permissions "anonymous:read" +add WebsiteUser --config "dab-config.MsSql.json" --source website_users --permissions "anonymous:create,read,delete,update" +add SupportedType --config "dab-config.MsSql.json" --source type_table --permissions "anonymous:create,read,delete,update" +add stocks_price --config "dab-config.MsSql.json" --source stocks_price --permissions "anonymous:read" +add Tree --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.MsSql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" +add books_view_all --config "dab-config.MsSql.json" --source books_view_all --permissions "anonymous:read" +add stocks_view_selected --config "dab-config.MsSql.json" --source stocks_view_selected --permissions "anonymous:read" +add books_publishers_view_composite --config "dab-config.MsSql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +add Empty --config "dab-config.MsSql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +add Notebook --config "dab-config.MsSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +add Journal --config "dab-config.MsSql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +add ArtOfWar --config "dab-config.MsSql.json" --source "aow" --rest true --permissions "anonymous:*" +update Publisher --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_02:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_03:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_04:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Stock --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Book --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" +update Book --config "dab-config.MsSql.json" --relationship publishers --target.entity Publisher --cardinality one +update Book --config "dab-config.MsSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +update Book --config "dab-config.MsSql.json" --relationship reviews --target.entity Review --cardinality many +update Book --config "dab-config.MsSql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.MsSql.json" --map "id:id,title:title" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_02:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_03:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_05:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_05:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_06:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:read" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:create" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Review --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality one +update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "authenticated:create,update" --rest true --graphql true +update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +update Author --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update WebsiteUser --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" +update stocks_price --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Comic --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Broker --config "dab-config.MsSql.json" --permissions "authenticated:create,update,read,delete" --graphql false +update Tree --config "dab-config.MsSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +update Fungus --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +update books_view_all --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update stocks_view_selected --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" +update books_publishers_view_composite --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" +update BookWebsitePlacement --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality one +update SupportedType --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Author --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Notebook --config "dab-config.MsSql.json" --permissions "anonymous:create,update,delete" +update Journal --config "dab-config.MsSql.json" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.MsSql.json" --permissions "authenticated:read" --fields.include "*" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:create" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.MsSql.json" --permissions "authorizationHandlerTester:read" +update ArtOfWar --config "dab-config.MsSql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" From 49d3de6a9d0dead45803d2a8ec3f5d1ba521d028 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 14 Aug 2022 19:27:39 +0530 Subject: [PATCH 19/89] adding commands for Mssql and PostgreSql, updating MsSql commands --- MsSqlCommands.txt | 2 +- MySqlCommands.txt | 96 ++++++++++++++++++++++++++++++++++++++++++ PostgreSqlCommands.txt | 96 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 MySqlCommands.txt create mode 100644 PostgreSqlCommands.txt diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index 703ed57c7c..ac53b15968 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -1,7 +1,7 @@ init --config "dab-config.MsSql.json" --database-type mssql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" add Publisher --config "dab-config.MsSql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:read" +add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:read" --graphql "book:books" add BookWebsitePlacement --config "dab-config.MsSql.json" --source book_website_placements --permissions "anonymous:read" add Author --config "dab-config.MsSql.json" --source authors --permissions "anonymous:read" add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:read" --graphql "review:reviews" diff --git a/MySqlCommands.txt b/MySqlCommands.txt new file mode 100644 index 0000000000..292f49c47d --- /dev/null +++ b/MySqlCommands.txt @@ -0,0 +1,96 @@ +init --config "dab-config.MySql.json" --database-type mysql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +add Publisher --config "dab-config.MySql.json" --source publishers --permissions "anonymous:read" +add Stock --config "dab-config.MySql.json" --source stocks --permissions "anonymous:create,read,update" +add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add BookWebsitePlacement --config "dab-config.MySql.json" --source book_website_placements --permissions "anonymous:read" +add Author --config "dab-config.MySql.json" --source authors --permissions "anonymous:read" +add Review --config "dab-config.MySql.json" --source reviews --permissions "anonymous:read" --graphql "review:reviews" +add Comic --config "dab-config.MySql.json" --source comics --permissions "anonymous:read" +add Broker --config "dab-config.MySql.json" --source brokers --permissions "anonymous:read" +add WebsiteUser --config "dab-config.MySql.json" --source website_users --permissions "anonymous:create,read,delete,update" +add SupportedType --config "dab-config.MySql.json" --source type_table --permissions "anonymous:create,read,delete,update" +add stocks_price --config "dab-config.MySql.json" --source stocks_price --permissions "anonymous:read" +add Tree --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.MySql.json" --source fungi --permissions "anonymous:create,read,update,delete" +add books_view_all --config "dab-config.MySql.json" --source books_view_all --permissions "anonymous:read" +add stocks_view_selected --config "dab-config.MySql.json" --source stocks_view_selected --permissions "anonymous:read" +add books_publishers_view_composite --config "dab-config.MySql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +add Empty --config "dab-config.MySql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +add Notebook --config "dab-config.MySql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +add Journal --config "dab-config.MySql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +add ArtOfWar --config "dab-config.MySql.json" --source "aow" --rest true --permissions "anonymous:*" +update Publisher --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_02:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_03:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_04:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Stock --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" +update Book --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" +update Book --config "dab-config.MySql.json" --relationship publishers --target.entity Publisher --cardinality one +update Book --config "dab-config.MySql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +update Book --config "dab-config.MySql.json" --relationship reviews --target.entity Review --cardinality many +update Book --config "dab-config.MySql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.MySql.json" --map "id:id,title:title" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_01:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:read" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:create" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 9" +update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:create,update" --rest true --graphql true +update Author --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update WebsiteUser --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" +update stocks_price --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Comic --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Broker --config "dab-config.MySql.json" --permissions "authenticated:create,update,read,delete" --graphql false +update Tree --config "dab-config.MySql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true --graphql "fungus:fungi" +update Fungus --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +update books_view_all --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update stocks_view_selected --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" +update books_publishers_view_composite --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" +update BookWebsitePlacement --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one +update SupportedType --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Author --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Review --config "dab-config.MySql.json" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one +update Notebook --config "dab-config.MySql.json" --permissions "anonymous:create,update,delete" +update Journal --config "dab-config.MySql.json" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.MySql.json" --permissions "authenticated:read" --fields.include "*" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:create" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.MySql.json" --permissions "authorizationHandlerTester:read" +update ArtOfWar --config "dab-config.MySql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt new file mode 100644 index 0000000000..abebca1a3f --- /dev/null +++ b/PostgreSqlCommands.txt @@ -0,0 +1,96 @@ +init --config "dab-config.PostgreSql.json" --database-type postgresql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +add Publisher --config "dab-config.PostgreSql.json" --source publishers --permissions "anonymous:read" +add Stock --config "dab-config.PostgreSql.json" --source stocks --permissions "anonymous:create,read,update" +add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add BookWebsitePlacement --config "dab-config.PostgreSql.json" --source book_website_placements --permissions "anonymous:read" +add Author --config "dab-config.PostgreSql.json" --source authors --permissions "anonymous:read" +add Review --config "dab-config.PostgreSql.json" --source reviews --permissions "anonymous:read" --graphql "review:reviews" +add Comic --config "dab-config.PostgreSql.json" --source comics --permissions "anonymous:read" +add Broker --config "dab-config.PostgreSql.json" --source brokers --permissions "anonymous:read" +add WebsiteUser --config "dab-config.PostgreSql.json" --source website_users --permissions "anonymous:create,read,delete,update" +add SupportedType --config "dab-config.PostgreSql.json" --source type_table --permissions "anonymous:create,read,delete,update" +add stocks_price --config "dab-config.PostgreSql.json" --source stocks_price --permissions "anonymous:read" +add Tree --config "dab-config.PostgreSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.PostgreSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.PostgreSql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" +add Empty --config "dab-config.PostgreSql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +add Notebook --config "dab-config.PostgreSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +add Journal --config "dab-config.PostgreSql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +add ArtOfWar --config "dab-config.PostgreSql.json" --source "aow" --rest true --permissions "anonymous:*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Stock --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" +update Book --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" +update Book --config "dab-config.PostgreSql.json" --relationship publishers --target.entity Publisher --cardinality one +update Book --config "dab-config.PostgreSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +update Book --config "dab-config.PostgreSql.json" --relationship reviews --target.entity Review --cardinality many +update Book --config "dab-config.PostgreSql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.PostgreSql.json" --map "id:id,title:title" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_05:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_05:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:read" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:create" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:create" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 9" +update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update" --rest true --graphql true +update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +update Author --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update WebsiteUser --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" +update stocks_price --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Comic --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Broker --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update,read,delete" --graphql false +update Tree --config "dab-config.PostgreSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +update Fungus --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +update BookWebsitePlacement --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one +update SupportedType --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Author --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Review --config "dab-config.PostgreSql.json" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one +update Notebook --config "dab-config.PostgreSql.json" --permissions "anonymous:create,update,delete" +update Journal --config "dab-config.PostgreSql.json" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.PostgreSql.json" --permissions "authenticated:read" --fields.include "*" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:create" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.PostgreSql.json" --permissions "authorizationHandlerTester:read" +update ArtOfWar --config "dab-config.PostgreSql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" From a4e78179622724ab03d686e49d4856820beb706d Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 14 Aug 2022 21:06:23 +0530 Subject: [PATCH 20/89] modifying scripts to use full path to read from .txt files --- configGenerator.ps1 | 5 +++-- configGenerator.sh | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/configGenerator.ps1 b/configGenerator.ps1 index 02ca2cc471..618e8049d2 100644 --- a/configGenerator.ps1 +++ b/configGenerator.ps1 @@ -2,11 +2,12 @@ param( [Parameter (Mandatory=$true)][string] $databaseType ) -$fileName = $databaseType + "Commands.txt"; +$commandsFileName = $databaseType + "Commands.txt"; +$commandsFileWithPath = $PSScriptRoot + "\" + $commandsFileName; $pathToDabExe = Get-ChildItem -Path .\src\out\cli\ -Recurse -include "dab.exe" | %{$_.FullName} ; # Generating the config files using dab commands -foreach($command in Get-Content $fileName){ +foreach($command in Get-Content $commandsFileWithPath){ $commandToExecute = $pathToDabExe + " " + $command; Invoke-Expression $commandToExecute; } diff --git a/configGenerator.sh b/configGenerator.sh index ffb017615f..52713342e6 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -1,12 +1,15 @@ #!/bin/bash databaseType=$1; -fileName="${databaseType}Commands.txt"; +commandsFileName="${databaseType}Commands.txt"; +absolutePath=$(pwd -P); +commandsFileNameWithPath="$absolutePath/$commandsFileName"; + #Fetching the path to dab dll pathToDLL=$(find ./src/out/cli -name dab.dll) + #Generating the config using dab commands echo "Generating config file using dab commands"; while read -r command; do cmd="dotnet ${pathToDLL} ${command}"; eval $cmd; -done <$fileName; -echo "Successfully generated the config file." +done <$commandsFileNameWithPath; From d9ddfabbf7ac225f942bed32f770e236811d6911 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 01:09:47 +0530 Subject: [PATCH 21/89] removing empty lines in shell script --- configGenerator.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/configGenerator.sh b/configGenerator.sh index 52713342e6..053a0aa916 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -3,10 +3,8 @@ databaseType=$1; commandsFileName="${databaseType}Commands.txt"; absolutePath=$(pwd -P); commandsFileNameWithPath="$absolutePath/$commandsFileName"; - #Fetching the path to dab dll pathToDLL=$(find ./src/out/cli -name dab.dll) - #Generating the config using dab commands echo "Generating config file using dab commands"; while read -r command; do From 5bc9c6b24f0537521e1ccd8218321de4519d91cc Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 01:41:13 +0530 Subject: [PATCH 22/89] adding pipeline tasks --- .pipelines/mssql-pipelines.yml | 71 +++++++++++++--------------------- .pipelines/mysql-pipelines.yml | 34 ++++++---------- .pipelines/pg-pipelines.yml | 21 ++++++---- configGenerator.sh | 2 +- 4 files changed, 52 insertions(+), 76 deletions(-) diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index b44197f026..0631a043df 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -40,37 +40,26 @@ jobs: displayName: Get and Start Ubuntu SQL Server Image Docker - task: DotNetCoreCLI@2 - displayName: Pack the CLI tool + displayName: Build inputs: - command: pack - packagesToPack: '**/Hawaii.Cli.csproj' - packDirectory: '$(Build.ArtifactStagingDirectory)' + command: build + projects: '**/*.csproj' + arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - task: DotNetCoreCLI@2 - displayName: Install the CLI tool + - task: ShellScript@2 + displayName: 'Generate dab-config.MsSql.json' inputs: - command: custom - custom: 'tool install' - arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' - - - bash: | - .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' - failOnStderr: true + scriptPath: configGenerator.sh + args: 'MsSql' + workingDirectory: 'src/out/tests/net6.0/' + failOnStandardError: true - task: FileTransform@1 - displayName: 'Generate dab-config.MsSql.json' + displayName: 'Transform dab-config.MsSql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/Service/dab-config.MsSql.json' - - - task: DotNetCoreCLI@2 - displayName: Build - inputs: - command: build - projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' # Update this to match your need + targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' @@ -139,36 +128,28 @@ jobs: SqlLocalDb.exe info "MSSQLLocalDB" - task: DotNetCoreCLI@2 - displayName: Pack the CLI tool + displayName: Build inputs: - command: pack - packagesToPack: '**/Hawaii.Cli.csproj' - packDirectory: '$(Build.ArtifactStagingDirectory)' + command: build + projects: '**/*.csproj' + arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - task: DotNetCoreCLI@2 - displayName: Install the CLI tool + - task: PowerShell@2 + displayName: 'Generate dab-config.MsSql.json' inputs: - command: custom - custom: 'tool install' - arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' - - - script: cmd < $(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MsSql_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' - failOnStderr: true + targetType: 'filePath' + filePath: configGenerator.ps1 + arguments: 'MsSql' + errorActionPreference: 'stop' + failOnStderr: true + workingDirectory: 'src/out/tests/net6.0/' - task: FileTransform@1 - displayName: 'Generate dab-config.MsSql.json' + displayName: 'Transform dab-config.MsSql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/Service/dab-config.MsSql.json' - - - task: DotNetCoreCLI@2 - displayName: Build - inputs: - command: build - projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' # Update this to match your need + targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index d4303ba29b..7b8768e9d6 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -44,38 +44,26 @@ jobs: displayName: Get and Start Ubuntu MySql Image Docker - task: DotNetCoreCLI@2 - displayName: Pack the CLI tool + displayName: Build inputs: - command: pack - packagesToPack: '**/Hawaii.Cli.csproj' - packDirectory: '$(Build.ArtifactStagingDirectory)' + command: build + projects: '**/*.csproj' + arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - task: DotNetCoreCLI@2 - displayName: Install the CLI tool + - task: ShellScript@2 inputs: - command: custom - custom: 'tool install' - arguments: '-g --add-source $(Build.ArtifactStagingDirectory) hawaii-cli' - - - bash: | - .$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles/MySql_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/ConfigFiles' - failOnStderr: true + scriptPath: configGenerator.sh + args: 'MySql' + workingDirectory: 'src/out/tests/net6.0/' + failOnStandardError: true - task: FileTransform@1 displayName: 'Generate dab-config.MySql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/Service/dab-config.MySql.json' - - - task: DotNetCoreCLI@2 - displayName: Build - inputs: - command: build - projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' # Update this to match your need - + targetFiles: 'src/out/tests/net6.0/dab-config.MySql.json' + - task: DotNetCoreCLI@2 displayName: 'Run MySql Integration Tests' inputs: diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index a3b746ade7..f35362149f 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -39,13 +39,6 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu Postgres Image Docker - - task: FileTransform@1 - displayName: 'Generate dab-config.PostgreSql.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/Service/dab-config.PostgreSql.json' - - task: DotNetCoreCLI@2 displayName: Build inputs: @@ -53,6 +46,20 @@ jobs: projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need + - task: ShellScript@2 + inputs: + scriptPath: configGenerator.sh + args: 'PostgreSql' + workingDirectory: 'src/out/tests/net6.0/' + failOnStandardError: true + + - task: FileTransform@1 + displayName: 'Generate dab-config.PostgreSql.json' + inputs: + folderPath: '$(System.DefaultWorkingDirectory)' + fileType: 'json' + targetFiles: 'src/out/tests/net6.0/dab-config.PostgreSql.json' + - task: DotNetCoreCLI@2 displayName: 'Run Postgres Integration Tests' inputs: diff --git a/configGenerator.sh b/configGenerator.sh index 053a0aa916..78736da305 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -1,7 +1,7 @@ #!/bin/bash databaseType=$1; commandsFileName="${databaseType}Commands.txt"; -absolutePath=$(pwd -P); +absolutePath="$( cd "$(dirname "$0")" ; pwd -P )"; commandsFileNameWithPath="$absolutePath/$commandsFileName"; #Fetching the path to dab dll pathToDLL=$(find ./src/out/cli -name dab.dll) From 429afb6a1c53c8083b256faf902397e4b759e44a Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 01:43:19 +0530 Subject: [PATCH 23/89] removing copy of dab-config files to output after build --- src/Service/Azure.DataApiBuilder.Service.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index 18d7dec283..cd295d5d85 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -35,9 +35,9 @@ $(CopyToOutputDirectoryAction) - + $(CopyToOutputDirectoryAction) From 529432e18d3ac63e70fc82f900eee3ef529705c9 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 01:56:37 +0530 Subject: [PATCH 24/89] removing dab-config checked-in files --- src/Service/dab-config.Cosmos.json | 90 --- src/Service/dab-config.MsSql.json | 813 ------------------------ src/Service/dab-config.MySql.json | 840 ------------------------- src/Service/dab-config.PostgreSql.json | 789 ----------------------- 4 files changed, 2532 deletions(-) delete mode 100644 src/Service/dab-config.Cosmos.json delete mode 100644 src/Service/dab-config.MsSql.json delete mode 100644 src/Service/dab-config.MySql.json delete mode 100644 src/Service/dab-config.PostgreSql.json diff --git a/src/Service/dab-config.Cosmos.json b/src/Service/dab-config.Cosmos.json deleted file mode 100644 index af6220a14e..0000000000 --- a/src/Service/dab-config.Cosmos.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "cosmos", - "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" - }, - "cosmos": { - "database": "graphqldb", - "container": "planet", - "schema": "schema.gql" - }, - "runtime": { - "rest": { - "enabled": false - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Planet": { - "source": "graphqldb.planet", - "rest": false, - "graphql": { - "type": { - "singular": "Planet", - "plural": "Planets" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Character": { - "source": "graphqldb.character", - "rest": false, - "graphql": { - "type": { - "singular": "Character", - "plural": "Characters" - } - }, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Star": { - "source": "graphqldb.star", - "rest": false, - "graphql": { - "type": { - "singular": "Star", - "plural": "Stars" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - } - } -} diff --git a/src/Service/dab-config.MsSql.json b/src/Service/dab-config.MsSql.json deleted file mode 100644 index 98e2c4cf99..0000000000 --- a/src/Service/dab-config.MsSql.json +++ /dev/null @@ -1,813 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "mssql", - "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" - }, - "mssql": { - "set-session-context": false - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Book": { - "source": "books", - "graphql": { - "type": { - "singular": "book", - "plural": "books" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_05", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 10" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_07", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - } - ] - }, - { - "role": "policy_tester_08", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "graphql": { - "type": { - "singular": "review", - "plural": "reviews" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "graphql": { - "type": { - "singular": "websiteUser", - "plural": "websiteUsers" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "graphql": { - "type": { - "singular": "fungus", - "plural": "fungi" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.region ne 'northeast'" - } - } - ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Notebook": { - "source": "notebooks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - "create", - "update", - "delete" - ] - } - ] - }, - "Journal": { - "source": "journals", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "policy_tester_noupdate", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - "delete" - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - } - ] - }, - { - "role": "authorizationHandlerTester", - "actions": [ "read" ] - } - ] - }, - "books_view_all": { - "source": "books_view_all", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "stocks_view_selected": { - "source": "stocks_view_selected", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "books_publishers_view_composite": { - "source": "books_publishers_view_composite", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "ArtOfWar": { - "source": "aow", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ], - "mappings": { - "DetailAssessmentAndPlanning": "始計", - "WagingWar": "作戰", - "StrategicAttack": "謀攻", - "NoteNum": "┬─┬ノ( º _ ºノ)" - } - } - } -} \ No newline at end of file diff --git a/src/Service/dab-config.MySql.json b/src/Service/dab-config.MySql.json deleted file mode 100644 index dc51f998da..0000000000 --- a/src/Service/dab-config.MySql.json +++ /dev/null @@ -1,840 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "mysql", - "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Book": { - "source": "books", - "graphql": { - "type": { - "singular": "book", - "plural": "books" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_05", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 10" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_07", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - } - ] - }, - { - "role": "policy_tester_08", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "graphql": { - "type": { - "singular": "review", - "plural": "reviews" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "graphql": { - "type": { - "singular": "websiteUser", - "plural": "websiteUsers" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "graphql": { - "type": { - "singular": "fungus", - "plural": "fungi" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.region ne 'northeast'" - } - } - ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Notebook": { - "source": "notebooks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - "create", - "update", - "delete" - ] - } - ] - }, - "Journal": { - "source": "journals", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "policy_tester_noupdate", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - "delete" - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - } - ] - }, - { - "role": "authorizationHandlerTester", - "actions": [ "read" ] - } - ] - }, - "books_view_all": { - "source": "books_view_all", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "stocks_view_selected": { - "source": "stocks_view_selected", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "books_publishers_view_composite": { - "source": "books_publishers_view_composite", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "ArtOfWar": { - "source": "aow", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ], - "mappings": { - "DetailAssessmentAndPlanning": "始計", - "WagingWar": "作戰", - "StrategicAttack": "謀攻", - "NoteNum": "┬─┬ノ( º _ ºノ)" - } - } - } -} diff --git a/src/Service/dab-config.PostgreSql.json b/src/Service/dab-config.PostgreSql.json deleted file mode 100644 index 127e6ec26f..0000000000 --- a/src/Service/dab-config.PostgreSql.json +++ /dev/null @@ -1,789 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "postgresql", - "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Book": { - "source": "books", - "graphql": { - "type": { - "singular": "book", - "plural": "books" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_05", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 10" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_07", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - } - ] - }, - { - "role": "policy_tester_08", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "graphql": { - "type": { - "singular": "review", - "plural": "reviews" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "graphql": { - "type": { - "singular": "websiteUser", - "plural": "websiteUsers" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "graphql": { - "type": { - "singular": "fungus", - "plural": "fungi" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.region ne 'northeast'" - } - } - ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Notebook": { - "source": "notebooks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - "create", - "update", - "delete" - ] - } - ] - }, - "Journal": { - "source": "journals", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "policy_tester_noupdate", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - "delete" - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - } - ] - }, - { - "role": "authorizationHandlerTester", - "actions": [ "read" ] - } - ] - }, - "ArtOfWar": { - "source": "aow", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ], - "mappings": { - "DetailAssessmentAndPlanning": "始計", - "WagingWar": "作戰", - "StrategicAttack": "謀攻", - "NoteNum": "┬─┬ノ( º _ ºノ)" - } - } - } -} From e64eef4ef204f5bdf72c676301ff03c0f3c63469 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 02:06:03 +0530 Subject: [PATCH 25/89] changing pipeline input to cwd --- .pipelines/mssql-pipelines.yml | 2 +- .pipelines/mysql-pipelines.yml | 2 +- .pipelines/pg-pipelines.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 0631a043df..1b394cc8c1 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -51,7 +51,7 @@ jobs: inputs: scriptPath: configGenerator.sh args: 'MsSql' - workingDirectory: 'src/out/tests/net6.0/' + cwd: 'src/out/tests/net6.0/' failOnStandardError: true - task: FileTransform@1 diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 7b8768e9d6..697a0dc324 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -54,7 +54,7 @@ jobs: inputs: scriptPath: configGenerator.sh args: 'MySql' - workingDirectory: 'src/out/tests/net6.0/' + cwd: 'src/out/tests/net6.0/' failOnStandardError: true - task: FileTransform@1 diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index f35362149f..ec60f5ced2 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -50,7 +50,7 @@ jobs: inputs: scriptPath: configGenerator.sh args: 'PostgreSql' - workingDirectory: 'src/out/tests/net6.0/' + cwd: 'src/out/tests/net6.0/' failOnStandardError: true - task: FileTransform@1 From ef021d535f9a7899400681fe407a1dec059d33e9 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 11:21:26 +0530 Subject: [PATCH 26/89] adding a condition to ensure script runs after build --- .pipelines/mssql-pipelines.yml | 1 + .pipelines/mysql-pipelines.yml | 1 + .pipelines/pg-pipelines.yml | 2 ++ 3 files changed, 4 insertions(+) diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 1b394cc8c1..b02946c0e9 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -53,6 +53,7 @@ jobs: args: 'MsSql' cwd: 'src/out/tests/net6.0/' failOnStandardError: true + condition: succeeded() - task: FileTransform@1 displayName: 'Transform dab-config.MsSql.json' diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 697a0dc324..2278263d45 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -56,6 +56,7 @@ jobs: args: 'MySql' cwd: 'src/out/tests/net6.0/' failOnStandardError: true + condition: succeeded() - task: FileTransform@1 displayName: 'Generate dab-config.MySql.json' diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index ec60f5ced2..b10b60fda6 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -52,6 +52,7 @@ jobs: args: 'PostgreSql' cwd: 'src/out/tests/net6.0/' failOnStandardError: true + condition: succeeded() - task: FileTransform@1 displayName: 'Generate dab-config.PostgreSql.json' @@ -59,6 +60,7 @@ jobs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' targetFiles: 'src/out/tests/net6.0/dab-config.PostgreSql.json' + condition: succeeded() - task: DotNetCoreCLI@2 displayName: 'Run Postgres Integration Tests' From 8ef2aa97ac8bbe2363c6d929747e52c941ce701f Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 11:33:32 +0530 Subject: [PATCH 27/89] using absolute path to find dll path --- configGenerator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configGenerator.sh b/configGenerator.sh index 78736da305..c1a18cbe2f 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -4,7 +4,7 @@ commandsFileName="${databaseType}Commands.txt"; absolutePath="$( cd "$(dirname "$0")" ; pwd -P )"; commandsFileNameWithPath="$absolutePath/$commandsFileName"; #Fetching the path to dab dll -pathToDLL=$(find ./src/out/cli -name dab.dll) +pathToDLL="$(find "$absolutePath/src/out/cli" -name dab.dll)"; #Generating the config using dab commands echo "Generating config file using dab commands"; while read -r command; do From 8c6276c8e6ebb89c26216a9202ad81f7f5b3a0b7 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 11:41:33 +0530 Subject: [PATCH 28/89] removing succeedeed condition on shell script --- .pipelines/mysql-pipelines.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 2278263d45..8edc9ea69c 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -54,10 +54,9 @@ jobs: inputs: scriptPath: configGenerator.sh args: 'MySql' - cwd: 'src/out/tests/net6.0/' + cwd: '$(System.DefaultWorkingDirectory)/src/out/tests/net6.0/' failOnStandardError: true - condition: succeeded() - + - task: FileTransform@1 displayName: 'Generate dab-config.MySql.json' inputs: From 1334663a4cb5ab4e0d38894592f71063e86c2a71 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 12:12:53 +0530 Subject: [PATCH 29/89] fixing ps1 script,adding right steps in cosmos pipeline, adding display names to pipeline tasks --- .pipelines/cosmos-pipelines.yml | 55 ++++++++++++++++++--------------- .pipelines/mssql-pipelines.yml | 1 - .pipelines/mysql-pipelines.yml | 5 +-- .pipelines/pg-pipelines.yml | 9 +++--- configGenerator.ps1 | 3 +- 5 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 0ca7807b06..55e895737a 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -23,49 +23,54 @@ variables: buildPlatform: 'Any CPU' buildConfiguration: 'Release' steps: + - task: UseDotNet@2 displayName: Setup .NET SDK v6.0.x inputs: packageType: sdk version: 6.0.x + - task: NuGetToolInstaller@1 + - task: NuGetCommand@2 displayName: Restore NuGet packages inputs: restoreSolution: '$(solution)' + - task: DotNetCoreCLI@2 - displayName: Pack the CLI tool + displayName: Build inputs: - command: pack - packagesToPack: '**/Hawaii.Cli.csproj' - packDirectory: '$(Build.ArtifactStagingDirectory)' -- task: DotNetCoreCLI@2 - displayName: Install the CLI tool + command: build + projects: '**/*.csproj' + arguments: '--configuration $(buildConfiguration)' # Update this to match your need + +- task: PowerShell@2 + displayName: 'Generate dab-config.Cosmos.json' inputs: - command: custom - custom: 'tool install' - arguments: '-g --add-source $(Build.ArtifactStagingDirectory)/nupkg hawaii.cli' -- script: cmd < DataGateway.Service/ConfigFiles/CosmosDB_Commands.txt - workingDirectory: '$(System.DefaultWorkingDirectory)/DataGateway.Service/' - failOnStderr: true - condition: eq( variables['Agent.OS'], 'Windows' ) -- bash: | - .**/CosmosDB_Commands.txt - workingDirectory: './DataGateway.Service/ConfigFiles' - failOnStderr: true - condition: in( variables['Agent.OS'], 'Linux', 'macOs' ) -- task: FileTransform@1 + targetType: 'filePath' + filePath: configGenerator.ps1 + arguments: 'cosmos' + errorActionPreference: 'stop' + failOnStderr: true + workingDirectory: 'src/out/tests/net6.0/' + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + +- task: ShellScript@2 displayName: 'Generate dab-config.Cosmos.json' + inputs: + scriptPath: configGenerator.sh + args: 'cosmos' + cwd: 'src/out/tests/net6.0/' + failOnStandardError: true + condition: ne( variables['Agent.OS'], 'Windows_NT' ) + +- task: FileTransform@1 + displayName: 'Transform dab-config.Cosmos.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' targetFiles: 'src/Service/dab-config.Cosmos.json' -- task: DotNetCoreCLI@2 - displayName: Build - inputs: - command: build - projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' # Update this to match your need + - task: DotNetCoreCLI@2 displayName: 'Run Cosmos DB Integration Tests' inputs: diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index b02946c0e9..1b394cc8c1 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -53,7 +53,6 @@ jobs: args: 'MsSql' cwd: 'src/out/tests/net6.0/' failOnStandardError: true - condition: succeeded() - task: FileTransform@1 displayName: 'Transform dab-config.MsSql.json' diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 8edc9ea69c..3c8c9b0068 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -51,14 +51,15 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: ShellScript@2 + displayName: 'Generate dab-config.MySql.json' inputs: scriptPath: configGenerator.sh args: 'MySql' cwd: '$(System.DefaultWorkingDirectory)/src/out/tests/net6.0/' failOnStandardError: true - + - task: FileTransform@1 - displayName: 'Generate dab-config.MySql.json' + displayName: 'Transform dab-config.MySql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index b10b60fda6..4e19171413 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -47,21 +47,20 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: ShellScript@2 + displayName: 'Generate dab-config.PostgreSql.json' inputs: scriptPath: configGenerator.sh args: 'PostgreSql' cwd: 'src/out/tests/net6.0/' failOnStandardError: true - condition: succeeded() - + - task: FileTransform@1 - displayName: 'Generate dab-config.PostgreSql.json' + displayName: 'Transform dab-config.PostgreSql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' targetFiles: 'src/out/tests/net6.0/dab-config.PostgreSql.json' - condition: succeeded() - + - task: DotNetCoreCLI@2 displayName: 'Run Postgres Integration Tests' inputs: diff --git a/configGenerator.ps1 b/configGenerator.ps1 index 618e8049d2..974c77b94a 100644 --- a/configGenerator.ps1 +++ b/configGenerator.ps1 @@ -4,7 +4,8 @@ param( $commandsFileName = $databaseType + "Commands.txt"; $commandsFileWithPath = $PSScriptRoot + "\" + $commandsFileName; -$pathToDabExe = Get-ChildItem -Path .\src\out\cli\ -Recurse -include "dab.exe" | %{$_.FullName} ; +$pathToCLIBuildOutput = $PSScriptRoot + "\src\out\cli"; +$pathToDabExe = Get-ChildItem -Path $pathToCLIBuildOutput -Recurse -include "dab.exe" | %{$_.FullName} ; # Generating the config files using dab commands foreach($command in Get-Content $commandsFileWithPath){ From e187e9d1a59022f9955cc94794c76980cced3485 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 12:23:25 +0530 Subject: [PATCH 30/89] fixing file transform task file path --- .pipelines/cosmos-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 55e895737a..4de82ae8cf 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -69,7 +69,7 @@ steps: inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/Service/dab-config.Cosmos.json' + targetFiles: 'src/out/tests/net6.0/dab-config.Cosmos.json' - task: DotNetCoreCLI@2 displayName: 'Run Cosmos DB Integration Tests' From 3f728c6eac0ab04c7b66d03253e15e663d383e69 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 17:30:39 +0530 Subject: [PATCH 31/89] updating MsSql commands --- MsSqlCommands.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index ac53b15968..77a8550094 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -4,7 +4,7 @@ add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonym add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:read" --graphql "book:books" add BookWebsitePlacement --config "dab-config.MsSql.json" --source book_website_placements --permissions "anonymous:read" add Author --config "dab-config.MsSql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:read" --graphql "review:reviews" +add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" add Comic --config "dab-config.MsSql.json" --source comics --permissions "anonymous:read" add Broker --config "dab-config.MsSql.json" --source brokers --permissions "anonymous:read" add WebsiteUser --config "dab-config.MsSql.json" --source website_users --permissions "anonymous:create,read,delete,update" From af9a9f19419cacb1c65b2ba07ca1e627c7857220 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 18:23:00 +0530 Subject: [PATCH 32/89] updating commands, json serialization options --- MsSqlCommands.txt | 5 +++-- MySqlCommands.txt | 5 +++-- PostgreSqlCommands.txt | 5 +++-- src/Cli/src/Utils.cs | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index 77a8550094..e40d1c0eb0 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -69,6 +69,7 @@ update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:cre update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Review --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" update Review --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality one update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "authenticated:create,update" --rest true --graphql true update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" @@ -88,8 +89,8 @@ update BookWebsitePlacement --config "dab-config.MsSql.json" --relationship book update SupportedType --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false update Author --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link update Notebook --config "dab-config.MsSql.json" --permissions "anonymous:create,update,delete" -update Journal --config "dab-config.MsSql.json" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" -update Journal --config "dab-config.MsSql.json" --permissions "authenticated:read" --fields.include "*" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:create" update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" diff --git a/MySqlCommands.txt b/MySqlCommands.txt index 292f49c47d..3447dd6709 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -84,10 +84,11 @@ update books_publishers_view_composite --config "dab-config.MySql.json" --permis update BookWebsitePlacement --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one update SupportedType --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false update Author --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Review --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" update Review --config "dab-config.MySql.json" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one update Notebook --config "dab-config.MySql.json" --permissions "anonymous:create,update,delete" -update Journal --config "dab-config.MySql.json" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" -update Journal --config "dab-config.MySql.json" --permissions "authenticated:read" --fields.include "*" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:create" update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index abebca1a3f..1dafb348bc 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -84,10 +84,11 @@ update Fungus --config "dab-config.PostgreSql.json" --permissions "policy_tester update BookWebsitePlacement --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one update SupportedType --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false update Author --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Review --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" update Review --config "dab-config.PostgreSql.json" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one update Notebook --config "dab-config.PostgreSql.json" --permissions "anonymous:create,update,delete" -update Journal --config "dab-config.PostgreSql.json" --permissions "authenticated:update" --fields.include "*" --policy-database "@item.id ne 1" -update Journal --config "dab-config.PostgreSql.json" --permissions "authenticated:read" --fields.include "*" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:create" update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" diff --git a/src/Cli/src/Utils.cs b/src/Cli/src/Utils.cs index b6e60b8468..a32b3a5a8c 100644 --- a/src/Cli/src/Utils.cs +++ b/src/Cli/src/Utils.cs @@ -233,7 +233,7 @@ public static JsonSerializerOptions GetSerializationOptions() { JsonSerializerOptions? options = new() { - Encoder = JavaScriptEncoder.Create(UnicodeRanges.All), + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, PropertyNamingPolicy = new LowerCaseNamingPolicy() From 0ae21b2e6d7ac70c6e91c3044755f8ca79379295 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 18:57:46 +0530 Subject: [PATCH 33/89] fixing commands for pgsql and mysql --- MySqlCommands.txt | 24 +++++++++++++----------- PostgreSqlCommands.txt | 14 +++++--------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/MySqlCommands.txt b/MySqlCommands.txt index 3447dd6709..afb6f5bd02 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -1,10 +1,10 @@ -init --config "dab-config.MySql.json" --database-type mysql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.MySql.json" --database-type mssql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" add Publisher --config "dab-config.MySql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.MySql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:read" --graphql "book:books" add BookWebsitePlacement --config "dab-config.MySql.json" --source book_website_placements --permissions "anonymous:read" add Author --config "dab-config.MySql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.MySql.json" --source reviews --permissions "anonymous:read" --graphql "review:reviews" +add Review --config "dab-config.MySql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" add Comic --config "dab-config.MySql.json" --source comics --permissions "anonymous:read" add Broker --config "dab-config.MySql.json" --source brokers --permissions "anonymous:read" add WebsiteUser --config "dab-config.MySql.json" --source website_users --permissions "anonymous:create,read,delete,update" @@ -12,7 +12,7 @@ add SupportedType --config "dab-config.MySql.json" --source type_table --permiss add stocks_price --config "dab-config.MySql.json" --source stocks_price --permissions "anonymous:read" add Tree --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" add Shrub --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Fungus --config "dab-config.MySql.json" --source fungi --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.MySql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" add books_view_all --config "dab-config.MySql.json" --source books_view_all --permissions "anonymous:read" add stocks_view_selected --config "dab-config.MySql.json" --source stocks_view_selected --permissions "anonymous:read" add books_publishers_view_composite --config "dab-config.MySql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true @@ -36,7 +36,7 @@ update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_0 update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:create,delete" update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:update" --fields.include "*" update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" +update Stock --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update Book --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" update Book --config "dab-config.MySql.json" --relationship publishers --target.entity Publisher --cardinality one update Book --config "dab-config.MySql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one @@ -51,24 +51,28 @@ update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:upd update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:create,delete" update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:update" --fields.include "*" update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:create,delete" update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:update" --fields.include "*" update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:create,delete" update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:read" --fields.include "*" update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:create" update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:create" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Review --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:create,update" --rest true --graphql true +update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" update Author --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update WebsiteUser --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" update stocks_price --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false @@ -76,7 +80,7 @@ update Comic --config "dab-config.MySql.json" --permissions "authenticated:creat update Broker --config "dab-config.MySql.json" --permissions "authenticated:create,update,read,delete" --graphql false update Tree --config "dab-config.MySql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" update Shrub --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -update Fungus --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true --graphql "fungus:fungi" +update Fungus --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true update Fungus --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" update books_view_all --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update stocks_view_selected --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" @@ -84,8 +88,6 @@ update books_publishers_view_composite --config "dab-config.MySql.json" --permis update BookWebsitePlacement --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one update SupportedType --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false update Author --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -update Review --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" -update Review --config "dab-config.MySql.json" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one update Notebook --config "dab-config.MySql.json" --permissions "anonymous:create,update,delete" update Journal --config "dab-config.MySql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" update Journal --config "dab-config.MySql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index 1dafb348bc..19bf5f7c01 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -1,10 +1,10 @@ -init --config "dab-config.PostgreSql.json" --database-type postgresql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.PostgreSql.json" --database-type mssql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" add Publisher --config "dab-config.PostgreSql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.PostgreSql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:read" --graphql "book:books" add BookWebsitePlacement --config "dab-config.PostgreSql.json" --source book_website_placements --permissions "anonymous:read" add Author --config "dab-config.PostgreSql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.PostgreSql.json" --source reviews --permissions "anonymous:read" --graphql "review:reviews" +add Review --config "dab-config.PostgreSql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" add Comic --config "dab-config.PostgreSql.json" --source comics --permissions "anonymous:read" add Broker --config "dab-config.PostgreSql.json" --source brokers --permissions "anonymous:read" add WebsiteUser --config "dab-config.PostgreSql.json" --source website_users --permissions "anonymous:create,read,delete,update" @@ -33,7 +33,7 @@ update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tes update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:create,delete" update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:update" --fields.include "*" update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship comics --target.entity Comic --cardinality many --relationship.fields "categoryName:categoryName" +update Stock --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update Book --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" update Book --config "dab-config.PostgreSql.json" --relationship publishers --target.entity Publisher --cardinality one update Book --config "dab-config.PostgreSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one @@ -66,10 +66,8 @@ update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_0 update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:create" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Review --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update" --rest true --graphql true update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" update Author --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true @@ -84,8 +82,6 @@ update Fungus --config "dab-config.PostgreSql.json" --permissions "policy_tester update BookWebsitePlacement --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one update SupportedType --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false update Author --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -update Review --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" -update Review --config "dab-config.PostgreSql.json" --rest true --permissions "authenticated:create,read,update,delete" --relationship books --target.entity Book --cardinality one update Notebook --config "dab-config.PostgreSql.json" --permissions "anonymous:create,update,delete" update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" From c24f4af0caa503a308dcb62124c93147856fc805 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 19:30:19 +0530 Subject: [PATCH 34/89] passing right arguement for cosmos --- .pipelines/cosmos-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 4de82ae8cf..79e01bd425 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -49,7 +49,7 @@ steps: inputs: targetType: 'filePath' filePath: configGenerator.ps1 - arguments: 'cosmos' + arguments: 'Cosmos' errorActionPreference: 'stop' failOnStderr: true workingDirectory: 'src/out/tests/net6.0/' @@ -59,7 +59,7 @@ steps: displayName: 'Generate dab-config.Cosmos.json' inputs: scriptPath: configGenerator.sh - args: 'cosmos' + args: 'Cosmos' cwd: 'src/out/tests/net6.0/' failOnStandardError: true condition: ne( variables['Agent.OS'], 'Windows_NT' ) From bc3685db6f43e43f6d41b911dd84ed730391abbe Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 15 Aug 2022 19:38:28 +0530 Subject: [PATCH 35/89] reverting the javascript encoder --- src/Cli/src/Utils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cli/src/Utils.cs b/src/Cli/src/Utils.cs index a32b3a5a8c..b6e60b8468 100644 --- a/src/Cli/src/Utils.cs +++ b/src/Cli/src/Utils.cs @@ -233,7 +233,7 @@ public static JsonSerializerOptions GetSerializationOptions() { JsonSerializerOptions? options = new() { - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + Encoder = JavaScriptEncoder.Create(UnicodeRanges.All), WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, PropertyNamingPolicy = new LowerCaseNamingPolicy() From 0620e7f145b4e814fb00fa0715ce6c1bfb698882 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 16 Aug 2022 14:24:49 +0530 Subject: [PATCH 36/89] adding test category to unit tests that read a file, setting encoding option to utf-8 --- configGenerator.ps1 | 2 ++ .../Configuration/ConfigurationTests.cs | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/configGenerator.ps1 b/configGenerator.ps1 index 974c77b94a..dec83d0a0a 100644 --- a/configGenerator.ps1 +++ b/configGenerator.ps1 @@ -2,6 +2,8 @@ param( [Parameter (Mandatory=$true)][string] $databaseType ) +$PSDefaultParameterValues['*:Encoding'] = 'utf8'; + $commandsFileName = $databaseType + "Commands.txt"; $commandsFileWithPath = $PSScriptRoot + "\" + $commandsFileName; $pathToCLIBuildOutput = $PSScriptRoot + "\src\out\cli"; diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index b8bad5abf6..30c43110b0 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -92,6 +92,7 @@ public async Task TestNoConfigReturnsServiceUnavailable(string[] args) } [TestMethod("Validates that once the configuration is set, the config controller isn't reachable.")] + [TestCategory(TestCategory.COSMOS)] public async Task TestConflictAlreadySetConfiguration() { TestServer server = new(Program.CreateWebHostFromInMemoryUpdateableConfBuilder(Array.Empty())); @@ -107,6 +108,7 @@ public async Task TestConflictAlreadySetConfiguration() } [TestMethod("Validates that the config controller returns a conflict when using local configuration.")] + [TestCategory(TestCategory.COSMOS)] public async Task TestConflictLocalConfiguration() { Environment.SetEnvironmentVariable @@ -124,6 +126,7 @@ public async Task TestConflictLocalConfiguration() } [TestMethod("Validates setting the configuration at runtime.")] + [TestCategory(TestCategory.COSMOS)] public async Task TestSettingConfigurations() { TestServer server = new(Program.CreateWebHostFromInMemoryUpdateableConfBuilder(Array.Empty())); @@ -137,6 +140,7 @@ public async Task TestSettingConfigurations() } [TestMethod("Validates that local cosmos settings can be loaded and the correct classes are in the service provider.")] + [TestCategory(TestCategory.COSMOS)] public void TestLoadingLocalCosmosSettings() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, COSMOS_ENVIRONMENT); @@ -146,6 +150,7 @@ public void TestLoadingLocalCosmosSettings() } [TestMethod("Validates that local MsSql settings can be loaded and the correct classes are in the service provider."), TestCategory(TestCategory.MSSQL)] + [TestCategory(TestCategory.MSSQL)] public void TestLoadingLocalMsSqlSettings() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, MSSQL_ENVIRONMENT); @@ -168,6 +173,7 @@ public void TestLoadingLocalMsSqlSettings() } [TestMethod("Validates that local PostgreSql settings can be loaded and the correct classes are in the service provider."), TestCategory(TestCategory.POSTGRESQL)] + [TestCategory(TestCategory.POSTGRESQL)] public void TestLoadingLocalPostgresSettings() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, POSTGRESQL_ENVIRONMENT); @@ -190,6 +196,7 @@ public void TestLoadingLocalPostgresSettings() } [TestMethod("Validates that local MySql settings can be loaded and the correct classes are in the service provider."), TestCategory(TestCategory.MYSQL)] + [TestCategory(TestCategory.MYSQL)] public void TestLoadingLocalMySqlSettings() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, MYSQL_ENVIRONMENT); @@ -212,6 +219,7 @@ public void TestLoadingLocalMySqlSettings() } [TestMethod("Validates that trying to override configs that are already set fail.")] + [TestCategory(TestCategory.COSMOS)] public async Task TestOverridingLocalSettingsFails() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, COSMOS_ENVIRONMENT); @@ -225,6 +233,7 @@ public async Task TestOverridingLocalSettingsFails() } [TestMethod("Validates that setting the configuration at runtime will instantiate the proper classes.")] + [TestCategory(TestCategory.COSMOS)] public async Task TestSettingConfigurationCreatesCorrectClasses() { TestServer server = new(Program.CreateWebHostFromInMemoryUpdateableConfBuilder(Array.Empty())); @@ -372,6 +381,7 @@ public void TestReadingRuntimeConfig() /// precendence than default configuration file dab-config.json /// [TestMethod("Validates command line configuration provider.")] + [TestCategory(TestCategory.COSMOS)] public void TestCommandLineConfigurationProvider() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, MSSQL_ENVIRONMENT); @@ -391,6 +401,7 @@ public void TestCommandLineConfigurationProvider() /// takes precendence than ASPNETCORE_ENVIRONMENT for the configuration file. /// [TestMethod("Validates precedence is given to DAB_ENVIRONMENT environment variable name.")] + [TestCategory(TestCategory.COSMOS)] public void TestRuntimeEnvironmentVariable() { Environment.SetEnvironmentVariable( @@ -426,6 +437,7 @@ public void TestConfigIsValid() // has highest precedence irrespective of what the connection string is in the config file. /// [TestMethod("Validates that environment variable DAB_CONNSTRING has highest precedence.")] + [TestCategory(TestCategory.COSMOS)] public void TestConnectionStringEnvVarHasHighestPrecedence() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, COSMOS_ENVIRONMENT); From 5e86b38f32ea12bbce52ebe8806e0fd9f5ba888d Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 16 Aug 2022 14:42:57 +0530 Subject: [PATCH 37/89] removing overrides.json files --- .../Azure.DataApiBuilder.Service.csproj | 18 - .../dab-config.Cosmos.overrides.example.json | 52 --- .../dab-config.MsSql.overrides.example.json | 374 ------------------ .../dab-config.MySql.overrides.example.json | 371 ----------------- ...b-config.PostgreSql.overrides.example.json | 320 --------------- 5 files changed, 1135 deletions(-) delete mode 100644 src/Service/dab-config.Cosmos.overrides.example.json delete mode 100644 src/Service/dab-config.MsSql.overrides.example.json delete mode 100644 src/Service/dab-config.MySql.overrides.example.json delete mode 100644 src/Service/dab-config.PostgreSql.overrides.example.json diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index cd295d5d85..24edeb6297 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -35,34 +35,16 @@ $(CopyToOutputDirectoryAction) - $(CopyToOutputDirectoryAction) - - - - - - - - - - - - - - - diff --git a/src/Service/dab-config.Cosmos.overrides.example.json b/src/Service/dab-config.Cosmos.overrides.example.json deleted file mode 100644 index 802e837961..0000000000 --- a/src/Service/dab-config.Cosmos.overrides.example.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "cosmos", - "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" - }, - "cosmos": { - "database": "graphqldb", - "container": "planet", - "schema": "schema.gql" - }, - "runtime": { - "rest": { - "enabled": false - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:3000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Planet": { - "source": "planet", - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - } - ] - }, - "Character": { - "source": "planet", - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - } - ] - } - } -} diff --git a/src/Service/dab-config.MsSql.overrides.example.json b/src/Service/dab-config.MsSql.overrides.example.json deleted file mode 100644 index 4f5aad5185..0000000000 --- a/src/Service/dab-config.MsSql.overrides.example.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "mssql", - "connection-string": "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" - }, - "mssql": { - "set-session-context": false - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "comics": { - "cardinality": "many", - "target.entity": "Comic", - "source.fields": [ "categoryName" ], - "target.fields": [ "categoryName" ] - } - } - }, - "Book": { - "source": "books", - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "books_view_all": { - "source": "books_view_all", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "stocks_view_selected": { - "source": "stocks_view_selected", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "books_publishers_view_composite": { - "source": "books_publishers_view_composite", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - } - } -} diff --git a/src/Service/dab-config.MySql.overrides.example.json b/src/Service/dab-config.MySql.overrides.example.json deleted file mode 100644 index aa615989e1..0000000000 --- a/src/Service/dab-config.MySql.overrides.example.json +++ /dev/null @@ -1,371 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "mysql", - "connection-string": "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "comics": { - "cardinality": "many", - "target.entity": "Comic", - "source.fields": [ "categoryName" ], - "target.fields": [ "categoryName" ] - } - } - }, - "Book": { - "source": "books", - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "books_view_all": { - "source": "books_view_all", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "stocks_view_selected": { - "source": "stocks_view_selected", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "books_publishers_view_composite": { - "source": "books_publishers_view_composite", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - } - } -} diff --git a/src/Service/dab-config.PostgreSql.overrides.example.json b/src/Service/dab-config.PostgreSql.overrides.example.json deleted file mode 100644 index 8d0ecacb77..0000000000 --- a/src/Service/dab-config.PostgreSql.overrides.example.json +++ /dev/null @@ -1,320 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "postgresql", - "connection-string": "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "comics": { - "cardinality": "many", - "target.entity": "Comic", - "source.fields": [ "categoryName" ], - "target.fields": [ "categoryName" ] - } - } - }, - "Book": { - "source": "books", - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - } - } -} From 9f49094564f2a28cdccb47dc6068170fa67e1065 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 25 Aug 2022 00:29:56 +0530 Subject: [PATCH 38/89] adding a postbuild task to see if it runs on linux --- src/Service/Azure.DataApiBuilder.Service.csproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index 24edeb6297..f7776a3129 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -74,4 +74,10 @@ + + + + + + From 5c7de14be442df2c66a6dfc3b417481259c662ff Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 25 Aug 2022 20:26:31 +0530 Subject: [PATCH 39/89] adding a postbuild event to generate config files --- .pipelines/build-pipelines.yml | 5 ++++ .pipelines/cosmos-pipelines.yml | 27 ++++-------------- .pipelines/mssql-pipelines.yml | 28 +++++++------------ .pipelines/mysql-pipelines.yml | 13 ++++----- .pipelines/pg-pipelines.yml | 13 ++++----- CosmosCommands.txt | 2 +- MsSqlCommands.txt | 2 +- MySqlCommands.txt | 2 +- PostgreSqlCommands.txt | 2 +- configGenerator.ps1 | 24 ++++++++-------- configGenerator.sh | 13 --------- .../Azure.DataApiBuilder.Service.csproj | 17 ++++++++--- 12 files changed, 60 insertions(+), 88 deletions(-) delete mode 100644 configGenerator.sh diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index c109f28e2a..7067892d4e 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -58,6 +58,11 @@ steps: projects: '$(solution)' arguments: '--verify-no-changes' +- task: DotNetCoreCLI@2 + inputs: + command: custom + custom: 'tool install PowerShell' + - task: DotNetCoreCLI@2 displayName: Build inputs: diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 79e01bd425..eba1cae0eb 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -37,6 +37,11 @@ steps: inputs: restoreSolution: '$(solution)' +- task: DotNetCoreCLI@2 + inputs: + command: custom + custom: 'tool install PowerShell' + - task: DotNetCoreCLI@2 displayName: Build inputs: @@ -44,26 +49,6 @@ steps: projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need -- task: PowerShell@2 - displayName: 'Generate dab-config.Cosmos.json' - inputs: - targetType: 'filePath' - filePath: configGenerator.ps1 - arguments: 'Cosmos' - errorActionPreference: 'stop' - failOnStderr: true - workingDirectory: 'src/out/tests/net6.0/' - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - -- task: ShellScript@2 - displayName: 'Generate dab-config.Cosmos.json' - inputs: - scriptPath: configGenerator.sh - args: 'Cosmos' - cwd: 'src/out/tests/net6.0/' - failOnStandardError: true - condition: ne( variables['Agent.OS'], 'Windows_NT' ) - - task: FileTransform@1 displayName: 'Transform dab-config.Cosmos.json' inputs: @@ -77,7 +62,7 @@ steps: command: test arguments: '--filter "TestCategory=Cosmos" --configuration $(buildConfiguration) $(ADDITIONAL_TEST_ARGS)' projects: '**/*Tests/*.csproj' - + # '/XPlat Code coverage --results-directory /home/vsts/work/1/s/TestResults/' - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage' diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 1b394cc8c1..696de3495c 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -28,6 +28,11 @@ jobs: inputs: restoreSolution: '$(solution)' + - task: DotNetCoreCLI@2 + inputs: + command: custom + custom: 'tool install PowerShell' + - task: DockerInstaller@0 displayName: Docker Installer inputs: @@ -46,14 +51,6 @@ jobs: projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - task: ShellScript@2 - displayName: 'Generate dab-config.MsSql.json' - inputs: - scriptPath: configGenerator.sh - args: 'MsSql' - cwd: 'src/out/tests/net6.0/' - failOnStandardError: true - - task: FileTransform@1 displayName: 'Transform dab-config.MsSql.json' inputs: @@ -104,6 +101,11 @@ jobs: inputs: restoreSolution: '$(solution)' + - task: DotNetCoreCLI@2 + inputs: + command: custom + custom: 'tool install PowerShell' + - task: PowerShell@2 displayName: Install SQL LocalDB inputs: @@ -134,16 +136,6 @@ jobs: projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - task: PowerShell@2 - displayName: 'Generate dab-config.MsSql.json' - inputs: - targetType: 'filePath' - filePath: configGenerator.ps1 - arguments: 'MsSql' - errorActionPreference: 'stop' - failOnStderr: true - workingDirectory: 'src/out/tests/net6.0/' - - task: FileTransform@1 displayName: 'Transform dab-config.MsSql.json' inputs: diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 3c8c9b0068..4488e46a81 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -29,6 +29,11 @@ jobs: inputs: restoreSolution: '$(solution)' + - task: DotNetCoreCLI@2 + inputs: + command: custom + custom: 'tool install PowerShell' + - task: DockerInstaller@0 displayName: Docker Installer inputs: @@ -50,14 +55,6 @@ jobs: projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - task: ShellScript@2 - displayName: 'Generate dab-config.MySql.json' - inputs: - scriptPath: configGenerator.sh - args: 'MySql' - cwd: '$(System.DefaultWorkingDirectory)/src/out/tests/net6.0/' - failOnStandardError: true - - task: FileTransform@1 displayName: 'Transform dab-config.MySql.json' inputs: diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 4e19171413..2f1447a2d7 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -25,6 +25,11 @@ jobs: inputs: restoreSolution: '$(solution)' + - task: DotNetCoreCLI@2 + inputs: + command: custom + custom: 'tool install PowerShell' + - task: DockerInstaller@0 displayName: Docker Installer inputs: @@ -45,14 +50,6 @@ jobs: command: build projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - - task: ShellScript@2 - displayName: 'Generate dab-config.PostgreSql.json' - inputs: - scriptPath: configGenerator.sh - args: 'PostgreSql' - cwd: 'src/out/tests/net6.0/' - failOnStandardError: true - task: FileTransform@1 displayName: 'Transform dab-config.PostgreSql.json' diff --git a/CosmosCommands.txt b/CosmosCommands.txt index 8a5fd5376a..5dbf433cc7 100644 --- a/CosmosCommands.txt +++ b/CosmosCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.Cosmos.json" --database-type "cosmos" --connection-string " " --cosmos-database "graphqldb" --cosmos-container "planet" --graphql-schema "schema.gql" --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.Cosmos.json" --database-type "cosmos" --connection-string "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" --cosmos-database "graphqldb" --cosmos-container "planet" --graphql-schema "schema.gql" --host-mode Development --cors-origin "http://localhost:5000" add Planet --config "dab-config.Cosmos.json" --source "graphqldb.planet" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Planet:Planets" update Planet --config "dab-config.Cosmos.json" --permissions "authenticated:create,read,update,delete" add Character --config "dab-config.Cosmos.json" --source "graphqldb.character" --permissions "authenticated:create,read,update,delete" --rest false --graphql "Character:Characters" diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index e40d1c0eb0..94ac5fe98f 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.MsSql.json" --database-type mssql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.MsSql.json" --database-type mssql --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" add Publisher --config "dab-config.MsSql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:read" --graphql "book:books" diff --git a/MySqlCommands.txt b/MySqlCommands.txt index afb6f5bd02..55123bcef5 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.MySql.json" --database-type mssql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.MySql.json" --database-type mssql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" add Publisher --config "dab-config.MySql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.MySql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:read" --graphql "book:books" diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index 19bf5f7c01..48a7389f9d 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.PostgreSql.json" --database-type mssql --connection-string " " --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.PostgreSql.json" --database-type mssql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" add Publisher --config "dab-config.PostgreSql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.PostgreSql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:read" --graphql "book:books" diff --git a/configGenerator.ps1 b/configGenerator.ps1 index dec83d0a0a..6d6e460285 100644 --- a/configGenerator.ps1 +++ b/configGenerator.ps1 @@ -1,16 +1,16 @@ -param( - [Parameter (Mandatory=$true)][string] $databaseType -) - $PSDefaultParameterValues['*:Encoding'] = 'utf8'; -$commandsFileName = $databaseType + "Commands.txt"; -$commandsFileWithPath = $PSScriptRoot + "\" + $commandsFileName; +$commandFiles = "MsSqlCommands.txt", "MySqlCommands.txt", "PostgreSqlCommands.txt", "CosmosCommands.txt"; $pathToCLIBuildOutput = $PSScriptRoot + "\src\out\cli"; -$pathToDabExe = Get-ChildItem -Path $pathToCLIBuildOutput -Recurse -include "dab.exe" | %{$_.FullName} ; +$pathToDabDLL = Get-ChildItem -Path $pathToCLIBuildOutput -Recurse -include "dab.dll" | %{$_.FullName} ; -# Generating the config files using dab commands -foreach($command in Get-Content $commandsFileWithPath){ - $commandToExecute = $pathToDabExe + " " + $command; - Invoke-Expression $commandToExecute; -} +foreach($file in $commandFiles) +{ + $commandsFileWithPath = $PSScriptRoot + "\" + $file; + + # Generating the config files using dab commands + foreach($command in Get-Content $commandsFileWithPath){ + $commandToExecute = "dotnet " + $pathToDabDLL + " " + $command; + Invoke-Expression $commandToExecute; + } +} \ No newline at end of file diff --git a/configGenerator.sh b/configGenerator.sh deleted file mode 100644 index c1a18cbe2f..0000000000 --- a/configGenerator.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -databaseType=$1; -commandsFileName="${databaseType}Commands.txt"; -absolutePath="$( cd "$(dirname "$0")" ; pwd -P )"; -commandsFileNameWithPath="$absolutePath/$commandsFileName"; -#Fetching the path to dab dll -pathToDLL="$(find "$absolutePath/src/out/cli" -name dab.dll)"; -#Generating the config using dab commands -echo "Generating config file using dab commands"; -while read -r command; do - cmd="dotnet ${pathToDLL} ${command}"; - eval $cmd; -done <$commandsFileNameWithPath; diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index f7776a3129..459fa98d07 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -35,6 +35,9 @@ $(CopyToOutputDirectoryAction) + + $(CopyToOutputDirectoryAction) + $(CopyToOutputDirectoryAction) @@ -45,6 +48,14 @@ + + + + + + + + @@ -74,10 +85,8 @@ - - - + + - From b6095516f375a2e1dc38dbb456329d837bae9602 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 25 Aug 2022 20:38:27 +0530 Subject: [PATCH 40/89] removing test category in unit tests --- .../Configuration/ConfigurationTests.cs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index c2b0fa4050..2fe94112ae 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -92,7 +92,6 @@ public async Task TestNoConfigReturnsServiceUnavailable(string[] args) } [TestMethod("Validates that once the configuration is set, the config controller isn't reachable.")] - [TestCategory(TestCategory.COSMOS)] public async Task TestConflictAlreadySetConfiguration() { TestServer server = new(Program.CreateWebHostFromInMemoryUpdateableConfBuilder(Array.Empty())); @@ -108,7 +107,6 @@ public async Task TestConflictAlreadySetConfiguration() } [TestMethod("Validates that the config controller returns a conflict when using local configuration.")] - [TestCategory(TestCategory.COSMOS)] public async Task TestConflictLocalConfiguration() { Environment.SetEnvironmentVariable @@ -126,7 +124,6 @@ public async Task TestConflictLocalConfiguration() } [TestMethod("Validates setting the configuration at runtime.")] - [TestCategory(TestCategory.COSMOS)] public async Task TestSettingConfigurations() { TestServer server = new(Program.CreateWebHostFromInMemoryUpdateableConfBuilder(Array.Empty())); @@ -140,7 +137,6 @@ public async Task TestSettingConfigurations() } [TestMethod("Validates that local cosmos settings can be loaded and the correct classes are in the service provider.")] - [TestCategory(TestCategory.COSMOS)] public void TestLoadingLocalCosmosSettings() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, COSMOS_ENVIRONMENT); @@ -150,7 +146,6 @@ public void TestLoadingLocalCosmosSettings() } [TestMethod("Validates that local MsSql settings can be loaded and the correct classes are in the service provider."), TestCategory(TestCategory.MSSQL)] - [TestCategory(TestCategory.MSSQL)] public void TestLoadingLocalMsSqlSettings() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, MSSQL_ENVIRONMENT); @@ -173,7 +168,6 @@ public void TestLoadingLocalMsSqlSettings() } [TestMethod("Validates that local PostgreSql settings can be loaded and the correct classes are in the service provider."), TestCategory(TestCategory.POSTGRESQL)] - [TestCategory(TestCategory.POSTGRESQL)] public void TestLoadingLocalPostgresSettings() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, POSTGRESQL_ENVIRONMENT); @@ -196,7 +190,6 @@ public void TestLoadingLocalPostgresSettings() } [TestMethod("Validates that local MySql settings can be loaded and the correct classes are in the service provider."), TestCategory(TestCategory.MYSQL)] - [TestCategory(TestCategory.MYSQL)] public void TestLoadingLocalMySqlSettings() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, MYSQL_ENVIRONMENT); @@ -219,7 +212,6 @@ public void TestLoadingLocalMySqlSettings() } [TestMethod("Validates that trying to override configs that are already set fail.")] - [TestCategory(TestCategory.COSMOS)] public async Task TestOverridingLocalSettingsFails() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, COSMOS_ENVIRONMENT); @@ -233,7 +225,6 @@ public async Task TestOverridingLocalSettingsFails() } [TestMethod("Validates that setting the configuration at runtime will instantiate the proper classes.")] - [TestCategory(TestCategory.COSMOS)] public async Task TestSettingConfigurationCreatesCorrectClasses() { TestServer server = new(Program.CreateWebHostFromInMemoryUpdateableConfBuilder(Array.Empty())); @@ -381,7 +372,6 @@ public void TestReadingRuntimeConfig() /// precendence than default configuration file dab-config.json /// [TestMethod("Validates command line configuration provider.")] - [TestCategory(TestCategory.COSMOS)] public void TestCommandLineConfigurationProvider() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, MSSQL_ENVIRONMENT); @@ -401,7 +391,6 @@ public void TestCommandLineConfigurationProvider() /// takes precendence than ASPNETCORE_ENVIRONMENT for the configuration file. /// [TestMethod("Validates precedence is given to DAB_ENVIRONMENT environment variable name.")] - [TestCategory(TestCategory.COSMOS)] public void TestRuntimeEnvironmentVariable() { Environment.SetEnvironmentVariable( @@ -414,7 +403,7 @@ public void TestRuntimeEnvironmentVariable() ValidateCosmosDbSetup(server); } - [TestMethod("Validates the runtime configuration file."), TestCategory(TestCategory.MSSQL)] + [TestMethod("Validates the runtime configuration file.")] public void TestConfigIsValid() { RuntimeConfigPath configPath = @@ -437,7 +426,6 @@ public void TestConfigIsValid() // has highest precedence irrespective of what the connection string is in the config file. /// [TestMethod("Validates that environment variable DAB_CONNSTRING has highest precedence.")] - [TestCategory(TestCategory.COSMOS)] public void TestConnectionStringEnvVarHasHighestPrecedence() { Environment.SetEnvironmentVariable(ASP_NET_CORE_ENVIRONMENT_VAR_NAME, COSMOS_ENVIRONMENT); @@ -522,4 +510,4 @@ private bool HandleException(Exception e) where T : Exception return false; } } -} +} \ No newline at end of file From b97d6bc77c5d495ea920aae1ef8d86e8a943d898 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 25 Aug 2022 20:44:30 +0530 Subject: [PATCH 41/89] adding global arguement for pwsh install command --- .pipelines/build-pipelines.yml | 1 + .pipelines/cosmos-pipelines.yml | 1 + .pipelines/mssql-pipelines.yml | 2 ++ .pipelines/mysql-pipelines.yml | 1 + .pipelines/pg-pipelines.yml | 1 + 5 files changed, 6 insertions(+) diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index 567fb21ffe..57ad043201 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -51,6 +51,7 @@ steps: inputs: command: custom custom: 'tool install PowerShell' + arguments: '--global' - task: NuGetToolInstaller@1 diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index a6526c5a28..f47ceeeeae 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -36,6 +36,7 @@ steps: inputs: command: custom custom: 'tool install PowerShell' + arguments: '--global' - task: NuGetToolInstaller@1 diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 8748c21480..ee99a216c2 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -37,6 +37,7 @@ jobs: inputs: command: custom custom: 'tool install PowerShell' + arguments: '--global' - task: DockerInstaller@0 displayName: Docker Installer @@ -115,6 +116,7 @@ jobs: inputs: command: custom custom: 'tool install PowerShell' + arguments: '--global' - task: PowerShell@2 displayName: Install SQL LocalDB diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index d39d8b7b23..ad1c1cd9e4 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -29,6 +29,7 @@ jobs: inputs: command: custom custom: 'tool install PowerShell' + arguments: '--global' - task: NuGetToolInstaller@1 diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 93a77c7fc3..87ba6dc185 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -25,6 +25,7 @@ jobs: inputs: command: custom custom: 'tool install PowerShell' + arguments: '--global' - task: NuGetToolInstaller@1 From 7a4a85ef4bc91b2063a0cb0dde26f5fedb72c7e7 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Fri, 26 Aug 2022 16:19:10 +0530 Subject: [PATCH 42/89] moving powershell install after nuget install --- .pipelines/build-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index 57ad043201..7029655cdf 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -47,12 +47,6 @@ steps: version: 6.0.x installationPath: $(Agent.ToolsDirectory)/dotnet -- task: DotNetCoreCLI@2 - inputs: - command: custom - custom: 'tool install PowerShell' - arguments: '--global' - - task: NuGetToolInstaller@1 - task: NuGetCommand@2 @@ -61,6 +55,12 @@ steps: feedsToUse: config nugetConfigPath: Nuget.config +- task: DotNetCoreCLI@2 + inputs: + command: custom + custom: 'tool install PowerShell' + arguments: '--global' + - task: DotNetCoreCLI@2 displayName: Check formatting inputs: From 89d1da4e18a96777ec7288aa32714cd839ecc7c1 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Fri, 26 Aug 2022 17:29:48 +0530 Subject: [PATCH 43/89] adding postbuild tasks, scripts to generate config for linux/macOs, removing pipeline tasks for powershell installation --- .pipelines/build-pipelines.yml | 8 +------- .pipelines/cosmos-pipelines.yml | 8 +------- .pipelines/mssql-pipelines.yml | 14 +------------- .pipelines/mysql-pipelines.yml | 6 ------ .pipelines/pg-pipelines.yml | 8 +------- configGenerator.ps1 | 4 +++- configGenerator.sh | 15 +++++++++++++++ src/Service/Azure.DataApiBuilder.Service.csproj | 3 ++- 8 files changed, 24 insertions(+), 42 deletions(-) create mode 100644 configGenerator.sh diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index 7029655cdf..1af3729c41 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -54,13 +54,7 @@ steps: restoreSolution: '$(solution)' feedsToUse: config nugetConfigPath: Nuget.config - -- task: DotNetCoreCLI@2 - inputs: - command: custom - custom: 'tool install PowerShell' - arguments: '--global' - + - task: DotNetCoreCLI@2 displayName: Check formatting inputs: diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index f47ceeeeae..5e337ed712 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -31,13 +31,7 @@ steps: inputs: packageType: sdk version: 6.0.x - -- task: DotNetCoreCLI@2 - inputs: - command: custom - custom: 'tool install PowerShell' - arguments: '--global' - + - task: NuGetToolInstaller@1 - task: NuGetCommand@2 diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index ee99a216c2..b86ef4e516 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -33,12 +33,6 @@ jobs: feedsToUse: config nugetConfigPath: Nuget.config - - task: DotNetCoreCLI@2 - inputs: - command: custom - custom: 'tool install PowerShell' - arguments: '--global' - - task: DockerInstaller@0 displayName: Docker Installer inputs: @@ -111,13 +105,7 @@ jobs: restoreSolution: '$(solution)' feedsToUse: config nugetConfigPath: Nuget.config - - - task: DotNetCoreCLI@2 - inputs: - command: custom - custom: 'tool install PowerShell' - arguments: '--global' - + - task: PowerShell@2 displayName: Install SQL LocalDB inputs: diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index ad1c1cd9e4..7ae0bda74b 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -25,12 +25,6 @@ jobs: packageType: sdk version: 6.0.x - - task: DotNetCoreCLI@2 - inputs: - command: custom - custom: 'tool install PowerShell' - arguments: '--global' - - task: NuGetToolInstaller@1 - task: NuGetCommand@2 diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 87ba6dc185..dca562e90b 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -20,13 +20,7 @@ jobs: inputs: packageType: sdk version: 6.0.x - - - task: DotNetCoreCLI@2 - inputs: - command: custom - custom: 'tool install PowerShell' - arguments: '--global' - + - task: NuGetToolInstaller@1 - task: NuGetCommand@2 diff --git a/configGenerator.ps1 b/configGenerator.ps1 index 6d6e460285..7969a711a9 100644 --- a/configGenerator.ps1 +++ b/configGenerator.ps1 @@ -2,7 +2,9 @@ $PSDefaultParameterValues['*:Encoding'] = 'utf8'; $commandFiles = "MsSqlCommands.txt", "MySqlCommands.txt", "PostgreSqlCommands.txt", "CosmosCommands.txt"; $pathToCLIBuildOutput = $PSScriptRoot + "\src\out\cli"; -$pathToDabDLL = Get-ChildItem -Path $pathToCLIBuildOutput -Recurse -include "dab.dll" | %{$_.FullName} ; + +#Fetching the absolute path of dab.dll from build output directory +$pathToDabDLL = Get-ChildItem -Path $pathToCLIBuildOutput -Recurse -include "dab.dll" | ForEach-Object{$_.FullName}; foreach($file in $commandFiles) { diff --git a/configGenerator.sh b/configGenerator.sh new file mode 100644 index 0000000000..4f9632dba8 --- /dev/null +++ b/configGenerator.sh @@ -0,0 +1,15 @@ +#!/bin/bash +commandFiles=("MsSqlCommands.txt" "MySqlCommands.txt" "PostgreSqlCommands.txt" "CosmosCommands.txt") +absolutePath=$(pwd -P); +#Fetching the path to dab dll +pathToDLL=$(find ./src/out/cli -name dab.dll) +#Generating the config using dab commands +echo "Generating config file using dab commands"; +for file in "${commandFiles[@]}" +do + commandsFileNameWithPath="$absolutePath/$file"; + while read -r command; do + cmd="dotnet ${pathToDLL} ${command}"; + eval $cmd; + done <$commandsFileNameWithPath; +done \ No newline at end of file diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index 459fa98d07..31d1015f58 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -86,7 +86,8 @@ - + + From 16eb98c12ec00c24b4fd3edc4c9fc7c42eb03ba7 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Fri, 26 Aug 2022 17:50:24 +0530 Subject: [PATCH 44/89] fixing absolute path in bash script --- configGenerator.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configGenerator.sh b/configGenerator.sh index 4f9632dba8..599e225e9e 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -1,8 +1,9 @@ #!/bin/bash commandFiles=("MsSqlCommands.txt" "MySqlCommands.txt" "PostgreSqlCommands.txt" "CosmosCommands.txt") -absolutePath=$(pwd -P); +absolutePath="$( cd "$(dirname "$0")" ; pwd -P )"; +cliOutputPath="$absolutePath/src/out/cli"; #Fetching the path to dab dll -pathToDLL=$(find ./src/out/cli -name dab.dll) +pathToDLL=$(find $cliOutputPath -name dab.dll) #Generating the config using dab commands echo "Generating config file using dab commands"; for file in "${commandFiles[@]}" From 9b54a1a670a90c34c3256f6c3b0650bcb52ed391 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Fri, 26 Aug 2022 17:59:41 +0530 Subject: [PATCH 45/89] adding comments in sh script --- configGenerator.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configGenerator.sh b/configGenerator.sh index 599e225e9e..d221a241cd 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -1,8 +1,9 @@ #!/bin/bash commandFiles=("MsSqlCommands.txt" "MySqlCommands.txt" "PostgreSqlCommands.txt" "CosmosCommands.txt") +#Fetching absolute path of this script absolutePath="$( cd "$(dirname "$0")" ; pwd -P )"; cliOutputPath="$absolutePath/src/out/cli"; -#Fetching the path to dab dll +#Fetching the path of dab dll pathToDLL=$(find $cliOutputPath -name dab.dll) #Generating the config using dab commands echo "Generating config file using dab commands"; From 857ef1e79c0fccf8710612f28cc5f5f4aba2c74d Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Fri, 26 Aug 2022 18:08:20 +0530 Subject: [PATCH 46/89] changing comments in bash --- configGenerator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configGenerator.sh b/configGenerator.sh index d221a241cd..01badb8da6 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -3,7 +3,7 @@ commandFiles=("MsSqlCommands.txt" "MySqlCommands.txt" "PostgreSqlCommands.txt" " #Fetching absolute path of this script absolutePath="$( cd "$(dirname "$0")" ; pwd -P )"; cliOutputPath="$absolutePath/src/out/cli"; -#Fetching the path of dab dll +#Fetching the path of dab dll file pathToDLL=$(find $cliOutputPath -name dab.dll) #Generating the config using dab commands echo "Generating config file using dab commands"; From ea02410d9184cccc2015706eb5a6f173662a6704 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Fri, 26 Aug 2022 18:22:11 +0530 Subject: [PATCH 47/89] setting commandprocessor property as false --- configGenerator.sh | 4 ++-- src/Service/Azure.DataApiBuilder.Service.csproj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configGenerator.sh b/configGenerator.sh index 01badb8da6..4b2b09b065 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -11,7 +11,7 @@ for file in "${commandFiles[@]}" do commandsFileNameWithPath="$absolutePath/$file"; while read -r command; do - cmd="dotnet ${pathToDLL} ${command}"; - eval $cmd; + command="dotnet ${pathToDLL} ${command}"; + eval $command; done <$commandsFileNameWithPath; done \ No newline at end of file diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index 31d1015f58..2d79dff711 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -87,7 +87,7 @@ - + From c7602851da17d92693c1498f94adb89ce6bfbbc5 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sat, 27 Aug 2022 23:23:37 +0530 Subject: [PATCH 48/89] trying to invoke sh script with bash command --- src/Service/Azure.DataApiBuilder.Service.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index 2d79dff711..afc877a99c 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -87,7 +87,7 @@ - + From 3539ee40234c00d1f61f93e40ca8eeeafef4d62f Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 28 Aug 2022 17:43:15 +0530 Subject: [PATCH 49/89] moving postbuild to cli, renaming Sql to sql --- .pipelines/cosmos-pipelines.yml | 3 - .pipelines/mssql-pipelines.yml | 8 +- .pipelines/mysql-pipelines.yml | 4 +- .pipelines/pg-pipelines.yml | 4 +- MsSqlCommands.txt | 198 +++++++++--------- MySqlCommands.txt | 198 +++++++++--------- PostgreSqlCommands.txt | 186 ++++++++-------- configGenerator.ps1 | 8 +- configGenerator.sh | 5 +- src/Cli/src/Cli.csproj | 5 + .../Azure.DataApiBuilder.Service.csproj | 10 +- 11 files changed, 318 insertions(+), 311 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 5e337ed712..97cc55167f 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -40,9 +40,6 @@ steps: restoreSolution: '$(solution)' feedsToUse: config nugetConfigPath: Nuget.config - -- task: FileTransform@1 - displayName: 'Generate dab-config.Cosmos.json' - task: DotNetCoreCLI@2 displayName: Build diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index b86ef4e516..01ee5b713e 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -52,11 +52,11 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1 - displayName: 'Transform dab-config.MsSql.json' + displayName: 'Transform dab-config.Mssql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' + targetFiles: 'src/out/tests/net6.0/dab-config.Mssql.json' - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' @@ -137,11 +137,11 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1 - displayName: 'Transform dab-config.MsSql.json' + displayName: 'Transform dab-config.Mssql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' + targetFiles: 'src/out/tests/net6.0/dab-config.Mssql.json' - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 7ae0bda74b..03e3e843c4 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -56,11 +56,11 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1 - displayName: 'Transform dab-config.MySql.json' + displayName: 'Transform dab-config.Mysql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.MySql.json' + targetFiles: 'src/out/tests/net6.0/dab-config.Mysql.json' - task: DotNetCoreCLI@2 displayName: 'Run MySql Integration Tests' diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index dca562e90b..fb64d46295 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -52,11 +52,11 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1 - displayName: 'Transform dab-config.PostgreSql.json' + displayName: 'Transform dab-config.Postgresql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.PostgreSql.json' + targetFiles: 'src/out/tests/net6.0/dab-config.Postgresql.json' - task: DotNetCoreCLI@2 displayName: 'Run Postgres Integration Tests' diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index 94ac5fe98f..9d1af8021f 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -1,99 +1,99 @@ -init --config "dab-config.MsSql.json" --database-type mssql --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" -add Publisher --config "dab-config.MsSql.json" --source publishers --permissions "anonymous:read" -add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:read" --graphql "book:books" -add BookWebsitePlacement --config "dab-config.MsSql.json" --source book_website_placements --permissions "anonymous:read" -add Author --config "dab-config.MsSql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" -add Comic --config "dab-config.MsSql.json" --source comics --permissions "anonymous:read" -add Broker --config "dab-config.MsSql.json" --source brokers --permissions "anonymous:read" -add WebsiteUser --config "dab-config.MsSql.json" --source website_users --permissions "anonymous:create,read,delete,update" -add SupportedType --config "dab-config.MsSql.json" --source type_table --permissions "anonymous:create,read,delete,update" -add stocks_price --config "dab-config.MsSql.json" --source stocks_price --permissions "anonymous:read" -add Tree --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Shrub --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Fungus --config "dab-config.MsSql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" -add books_view_all --config "dab-config.MsSql.json" --source books_view_all --permissions "anonymous:read" -add stocks_view_selected --config "dab-config.MsSql.json" --source stocks_view_selected --permissions "anonymous:read" -add books_publishers_view_composite --config "dab-config.MsSql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true -add Empty --config "dab-config.MsSql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true -add Notebook --config "dab-config.MsSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" -add Journal --config "dab-config.MsSql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" -add ArtOfWar --config "dab-config.MsSql.json" --source "aow" --rest true --permissions "anonymous:*" -update Publisher --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_02:create,delete" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_03:create,delete" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_04:create,delete" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:create,delete" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update Book --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" -update Book --config "dab-config.MsSql.json" --relationship publishers --target.entity Publisher --cardinality one -update Book --config "dab-config.MsSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one -update Book --config "dab-config.MsSql.json" --relationship reviews --target.entity Review --cardinality many -update Book --config "dab-config.MsSql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -update Book --config "dab-config.MsSql.json" --map "id:id,title:title" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_02:create,delete" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_03:create,delete" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_04:create,delete" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_05:create,delete" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_05:update" --fields.include "*" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_06:create,delete" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:create" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:read" --fields.include "*" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:create" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Review --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" -update Review --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality one -update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "authenticated:create,update" --rest true --graphql true -update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" -update Author --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update WebsiteUser --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" -update stocks_price --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false -update Broker --config "dab-config.MsSql.json" --permissions "authenticated:create,update,read,delete" --graphql false -update Tree --config "dab-config.MsSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -update Shrub --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -update Fungus --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true -update Fungus --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" -update books_view_all --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update stocks_view_selected --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" -update books_publishers_view_composite --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" -update BookWebsitePlacement --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality one -update SupportedType --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Author --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -update Notebook --config "dab-config.MsSql.json" --permissions "anonymous:create,update,delete" -update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" -update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" -update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:create" -update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.MsSql.json" --permissions "authorizationHandlerTester:read" -update ArtOfWar --config "dab-config.MsSql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" +init --config "dab-config.Mssql.json" --database-type mssql --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" +add Publisher --config "dab-config.Mssql.json" --source publishers --permissions "anonymous:read" +add Stock --config "dab-config.Mssql.json" --source stocks --permissions "anonymous:create,read,update" +add Book --config "dab-config.Mssql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add BookWebsitePlacement --config "dab-config.Mssql.json" --source book_website_placements --permissions "anonymous:read" +add Author --config "dab-config.Mssql.json" --source authors --permissions "anonymous:read" +add Review --config "dab-config.Mssql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" +add Comic --config "dab-config.Mssql.json" --source comics --permissions "anonymous:read" +add Broker --config "dab-config.Mssql.json" --source brokers --permissions "anonymous:read" +add WebsiteUser --config "dab-config.Mssql.json" --source website_users --permissions "anonymous:create,read,delete,update" +add SupportedType --config "dab-config.Mssql.json" --source type_table --permissions "anonymous:create,read,delete,update" +add stocks_price --config "dab-config.Mssql.json" --source stocks_price --permissions "anonymous:read" +add Tree --config "dab-config.Mssql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.Mssql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.Mssql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" +add books_view_all --config "dab-config.Mssql.json" --source books_view_all --permissions "anonymous:read" +add stocks_view_selected --config "dab-config.Mssql.json" --source stocks_view_selected --permissions "anonymous:read" +add books_publishers_view_composite --config "dab-config.Mssql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +add Empty --config "dab-config.Mssql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +add Notebook --config "dab-config.Mssql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +add Journal --config "dab-config.Mssql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +add ArtOfWar --config "dab-config.Mssql.json" --source "aow" --rest true --permissions "anonymous:*" +update Publisher --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_01:create,delete" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_02:create,delete" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_03:create,delete" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_04:create,delete" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_06:create,delete" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Stock --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Book --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" +update Book --config "dab-config.Mssql.json" --relationship publishers --target.entity Publisher --cardinality one +update Book --config "dab-config.Mssql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +update Book --config "dab-config.Mssql.json" --relationship reviews --target.entity Review --cardinality many +update Book --config "dab-config.Mssql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.Mssql.json" --map "id:id,title:title" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_01:create,delete" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_02:create,delete" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_03:create,delete" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_05:create,delete" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_05:update" --fields.include "*" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_06:create,delete" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_07:read" --fields.include "*" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_08:create" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.Mssql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Review --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.Mssql.json" --relationship books --target.entity Book --cardinality one +update BookWebsitePlacement --config "dab-config.Mssql.json" --permissions "authenticated:create,update" --rest true --graphql true +update BookWebsitePlacement --config "dab-config.Mssql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +update Author --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update WebsiteUser --config "dab-config.Mssql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" +update stocks_price --config "dab-config.Mssql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Comic --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Broker --config "dab-config.Mssql.json" --permissions "authenticated:create,update,read,delete" --graphql false +update Tree --config "dab-config.Mssql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +update Fungus --config "dab-config.Mssql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +update books_view_all --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update stocks_view_selected --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" +update books_publishers_view_composite --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" +update BookWebsitePlacement --config "dab-config.Mssql.json" --relationship books --target.entity Book --cardinality one +update SupportedType --config "dab-config.Mssql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Author --config "dab-config.Mssql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Notebook --config "dab-config.Mssql.json" --permissions "anonymous:create,update,delete" +update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" +update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_update_noread:create" +update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.Mssql.json" --permissions "authorizationHandlerTester:read" +update ArtOfWar --config "dab-config.Mssql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/MySqlCommands.txt b/MySqlCommands.txt index 55123bcef5..4769aa5d34 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -1,99 +1,99 @@ -init --config "dab-config.MySql.json" --database-type mssql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" -add Publisher --config "dab-config.MySql.json" --source publishers --permissions "anonymous:read" -add Stock --config "dab-config.MySql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:read" --graphql "book:books" -add BookWebsitePlacement --config "dab-config.MySql.json" --source book_website_placements --permissions "anonymous:read" -add Author --config "dab-config.MySql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.MySql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" -add Comic --config "dab-config.MySql.json" --source comics --permissions "anonymous:read" -add Broker --config "dab-config.MySql.json" --source brokers --permissions "anonymous:read" -add WebsiteUser --config "dab-config.MySql.json" --source website_users --permissions "anonymous:create,read,delete,update" -add SupportedType --config "dab-config.MySql.json" --source type_table --permissions "anonymous:create,read,delete,update" -add stocks_price --config "dab-config.MySql.json" --source stocks_price --permissions "anonymous:read" -add Tree --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Shrub --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Fungus --config "dab-config.MySql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" -add books_view_all --config "dab-config.MySql.json" --source books_view_all --permissions "anonymous:read" -add stocks_view_selected --config "dab-config.MySql.json" --source stocks_view_selected --permissions "anonymous:read" -add books_publishers_view_composite --config "dab-config.MySql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true -add Empty --config "dab-config.MySql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true -add Notebook --config "dab-config.MySql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" -add Journal --config "dab-config.MySql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" -add ArtOfWar --config "dab-config.MySql.json" --source "aow" --rest true --permissions "anonymous:*" -update Publisher --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:create,delete" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_02:create,delete" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_03:create,delete" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_04:create,delete" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:create,delete" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update Book --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" -update Book --config "dab-config.MySql.json" --relationship publishers --target.entity Publisher --cardinality one -update Book --config "dab-config.MySql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one -update Book --config "dab-config.MySql.json" --relationship reviews --target.entity Review --cardinality many -update Book --config "dab-config.MySql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -update Book --config "dab-config.MySql.json" --map "id:id,title:title" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_01:create,delete" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:create,delete" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:create,delete" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:create,delete" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:create,delete" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:update" --fields.include "*" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:create,delete" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:create" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:read" --fields.include "*" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:create" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Review --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" -update Review --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one -update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:create,update" --rest true --graphql true -update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" -update Author --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update WebsiteUser --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" -update stocks_price --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false -update Broker --config "dab-config.MySql.json" --permissions "authenticated:create,update,read,delete" --graphql false -update Tree --config "dab-config.MySql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -update Shrub --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -update Fungus --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true -update Fungus --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" -update books_view_all --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update stocks_view_selected --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" -update books_publishers_view_composite --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" -update BookWebsitePlacement --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one -update SupportedType --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Author --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -update Notebook --config "dab-config.MySql.json" --permissions "anonymous:create,update,delete" -update Journal --config "dab-config.MySql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" -update Journal --config "dab-config.MySql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" -update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:create" -update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.MySql.json" --permissions "authorizationHandlerTester:read" -update ArtOfWar --config "dab-config.MySql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" +init --config "dab-config.Mysql.json" --database-type mssql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" +add Publisher --config "dab-config.Mysql.json" --source publishers --permissions "anonymous:read" +add Stock --config "dab-config.Mysql.json" --source stocks --permissions "anonymous:create,read,update" +add Book --config "dab-config.Mysql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add BookWebsitePlacement --config "dab-config.Mysql.json" --source book_website_placements --permissions "anonymous:read" +add Author --config "dab-config.Mysql.json" --source authors --permissions "anonymous:read" +add Review --config "dab-config.Mysql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" +add Comic --config "dab-config.Mysql.json" --source comics --permissions "anonymous:read" +add Broker --config "dab-config.Mysql.json" --source brokers --permissions "anonymous:read" +add WebsiteUser --config "dab-config.Mysql.json" --source website_users --permissions "anonymous:create,read,delete,update" +add SupportedType --config "dab-config.Mysql.json" --source type_table --permissions "anonymous:create,read,delete,update" +add stocks_price --config "dab-config.Mysql.json" --source stocks_price --permissions "anonymous:read" +add Tree --config "dab-config.Mysql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.Mysql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.Mysql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" +add books_view_all --config "dab-config.Mysql.json" --source books_view_all --permissions "anonymous:read" +add stocks_view_selected --config "dab-config.Mysql.json" --source stocks_view_selected --permissions "anonymous:read" +add books_publishers_view_composite --config "dab-config.Mysql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +add Empty --config "dab-config.Mysql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +add Notebook --config "dab-config.Mysql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +add Journal --config "dab-config.Mysql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +add ArtOfWar --config "dab-config.Mysql.json" --source "aow" --rest true --permissions "anonymous:*" +update Publisher --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_01:create,delete" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_02:create,delete" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_03:create,delete" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_04:create,delete" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_06:create,delete" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Stock --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Book --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" +update Book --config "dab-config.Mysql.json" --relationship publishers --target.entity Publisher --cardinality one +update Book --config "dab-config.Mysql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +update Book --config "dab-config.Mysql.json" --relationship reviews --target.entity Review --cardinality many +update Book --config "dab-config.Mysql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.Mysql.json" --map "id:id,title:title" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_01:create,delete" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_02:create,delete" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_03:create,delete" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_05:create,delete" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_05:update" --fields.include "*" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_06:create,delete" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_07:read" --fields.include "*" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_08:create" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.Mysql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Review --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.Mysql.json" --relationship books --target.entity Book --cardinality one +update BookWebsitePlacement --config "dab-config.Mysql.json" --permissions "authenticated:create,update" --rest true --graphql true +update BookWebsitePlacement --config "dab-config.Mysql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +update Author --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update WebsiteUser --config "dab-config.Mysql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" +update stocks_price --config "dab-config.Mysql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Comic --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Broker --config "dab-config.Mysql.json" --permissions "authenticated:create,update,read,delete" --graphql false +update Tree --config "dab-config.Mysql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +update Fungus --config "dab-config.Mysql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +update books_view_all --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update stocks_view_selected --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" +update books_publishers_view_composite --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" +update BookWebsitePlacement --config "dab-config.Mysql.json" --relationship books --target.entity Book --cardinality one +update SupportedType --config "dab-config.Mysql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Author --config "dab-config.Mysql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Notebook --config "dab-config.Mysql.json" --permissions "anonymous:create,update,delete" +update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" +update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_update_noread:create" +update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.Mysql.json" --permissions "authorizationHandlerTester:read" +update ArtOfWar --config "dab-config.Mysql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index 48a7389f9d..8703c2db9c 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -1,93 +1,93 @@ -init --config "dab-config.PostgreSql.json" --database-type mssql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" -add Publisher --config "dab-config.PostgreSql.json" --source publishers --permissions "anonymous:read" -add Stock --config "dab-config.PostgreSql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:read" --graphql "book:books" -add BookWebsitePlacement --config "dab-config.PostgreSql.json" --source book_website_placements --permissions "anonymous:read" -add Author --config "dab-config.PostgreSql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.PostgreSql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" -add Comic --config "dab-config.PostgreSql.json" --source comics --permissions "anonymous:read" -add Broker --config "dab-config.PostgreSql.json" --source brokers --permissions "anonymous:read" -add WebsiteUser --config "dab-config.PostgreSql.json" --source website_users --permissions "anonymous:create,read,delete,update" -add SupportedType --config "dab-config.PostgreSql.json" --source type_table --permissions "anonymous:create,read,delete,update" -add stocks_price --config "dab-config.PostgreSql.json" --source stocks_price --permissions "anonymous:read" -add Tree --config "dab-config.PostgreSql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Shrub --config "dab-config.PostgreSql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Fungus --config "dab-config.PostgreSql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" -add Empty --config "dab-config.PostgreSql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true -add Notebook --config "dab-config.PostgreSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" -add Journal --config "dab-config.PostgreSql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" -add ArtOfWar --config "dab-config.PostgreSql.json" --source "aow" --rest true --permissions "anonymous:*" -update Publisher --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:create,delete" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:create,delete" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:create,delete" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:create,delete" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:create,delete" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update Book --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" -update Book --config "dab-config.PostgreSql.json" --relationship publishers --target.entity Publisher --cardinality one -update Book --config "dab-config.PostgreSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one -update Book --config "dab-config.PostgreSql.json" --relationship reviews --target.entity Review --cardinality many -update Book --config "dab-config.PostgreSql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -update Book --config "dab-config.PostgreSql.json" --map "id:id,title:title" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:create,delete" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:create,delete" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:create,delete" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:create,delete" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_05:create,delete" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_05:update" --fields.include "*" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:create,delete" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:create" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:read" --fields.include "*" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:create" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Review --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" -update Review --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one -update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update" --rest true --graphql true -update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" -update Author --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update WebsiteUser --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" -update stocks_price --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false -update Broker --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update,read,delete" --graphql false -update Tree --config "dab-config.PostgreSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -update Shrub --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -update Fungus --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true -update Fungus --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" -update BookWebsitePlacement --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one -update SupportedType --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Author --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -update Notebook --config "dab-config.PostgreSql.json" --permissions "anonymous:create,update,delete" -update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" -update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" -update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:create" -update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.PostgreSql.json" --permissions "authorizationHandlerTester:read" -update ArtOfWar --config "dab-config.PostgreSql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" +init --config "dab-config.Postgresql.json" --database-type mssql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" +add Publisher --config "dab-config.Postgresql.json" --source publishers --permissions "anonymous:read" +add Stock --config "dab-config.Postgresql.json" --source stocks --permissions "anonymous:create,read,update" +add Book --config "dab-config.Postgresql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add BookWebsitePlacement --config "dab-config.Postgresql.json" --source book_website_placements --permissions "anonymous:read" +add Author --config "dab-config.Postgresql.json" --source authors --permissions "anonymous:read" +add Review --config "dab-config.Postgresql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" +add Comic --config "dab-config.Postgresql.json" --source comics --permissions "anonymous:read" +add Broker --config "dab-config.Postgresql.json" --source brokers --permissions "anonymous:read" +add WebsiteUser --config "dab-config.Postgresql.json" --source website_users --permissions "anonymous:create,read,delete,update" +add SupportedType --config "dab-config.Postgresql.json" --source type_table --permissions "anonymous:create,read,delete,update" +add stocks_price --config "dab-config.Postgresql.json" --source stocks_price --permissions "anonymous:read" +add Tree --config "dab-config.Postgresql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.Postgresql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.Postgresql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" +add Empty --config "dab-config.Postgresql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +add Notebook --config "dab-config.Postgresql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +add Journal --config "dab-config.Postgresql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +add ArtOfWar --config "dab-config.Postgresql.json" --source "aow" --rest true --permissions "anonymous:*" +update Publisher --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_01:create,delete" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_02:create,delete" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_03:create,delete" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_04:create,delete" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_06:create,delete" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Stock --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Book --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" +update Book --config "dab-config.Postgresql.json" --relationship publishers --target.entity Publisher --cardinality one +update Book --config "dab-config.Postgresql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +update Book --config "dab-config.Postgresql.json" --relationship reviews --target.entity Review --cardinality many +update Book --config "dab-config.Postgresql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.Postgresql.json" --map "id:id,title:title" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_01:create,delete" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_02:create,delete" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_03:create,delete" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_05:create,delete" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_05:update" --fields.include "*" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_06:create,delete" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_07:read" --fields.include "*" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_08:create" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Review --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.Postgresql.json" --relationship books --target.entity Book --cardinality one +update BookWebsitePlacement --config "dab-config.Postgresql.json" --permissions "authenticated:create,update" --rest true --graphql true +update BookWebsitePlacement --config "dab-config.Postgresql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +update Author --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update WebsiteUser --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" +update stocks_price --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Comic --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Broker --config "dab-config.Postgresql.json" --permissions "authenticated:create,update,read,delete" --graphql false +update Tree --config "dab-config.Postgresql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +update Fungus --config "dab-config.Postgresql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +update BookWebsitePlacement --config "dab-config.Postgresql.json" --relationship books --target.entity Book --cardinality one +update SupportedType --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Author --config "dab-config.Postgresql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Notebook --config "dab-config.Postgresql.json" --permissions "anonymous:create,update,delete" +update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" +update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_update_noread:create" +update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.Postgresql.json" --permissions "authorizationHandlerTester:read" +update ArtOfWar --config "dab-config.Postgresql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/configGenerator.ps1 b/configGenerator.ps1 index 7969a711a9..9df4e9bc07 100644 --- a/configGenerator.ps1 +++ b/configGenerator.ps1 @@ -1,10 +1,14 @@ $PSDefaultParameterValues['*:Encoding'] = 'utf8'; $commandFiles = "MsSqlCommands.txt", "MySqlCommands.txt", "PostgreSqlCommands.txt", "CosmosCommands.txt"; -$pathToCLIBuildOutput = $PSScriptRoot + "\src\out\cli"; +$workingDirectory = $PSScriptRoot + "\src\Service\"; +# During start-up engine looks for config files inside /src/Service directory. +Set-Location $workingDirectory; + +$cliBuildOutputPath = $PSScriptRoot + "\src\out\cli\"; #Fetching the absolute path of dab.dll from build output directory -$pathToDabDLL = Get-ChildItem -Path $pathToCLIBuildOutput -Recurse -include "dab.dll" | ForEach-Object{$_.FullName}; +$pathToDabDLL = Get-ChildItem -Path $cliBuildOutputPath -Recurse -include "dab.dll" | ForEach-Object{$_.FullName}; foreach($file in $commandFiles) { diff --git a/configGenerator.sh b/configGenerator.sh index 4b2b09b065..4b9d37a944 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -5,7 +5,10 @@ absolutePath="$( cd "$(dirname "$0")" ; pwd -P )"; cliOutputPath="$absolutePath/src/out/cli"; #Fetching the path of dab dll file pathToDLL=$(find $cliOutputPath -name dab.dll) -#Generating the config using dab commands +workingDirectory="$absolutePath/src/Service/" +# During start-up engine looks for config files inside /src/Service directory. +cd $workingDirectory; +# Generating the config using dab commands echo "Generating config file using dab commands"; for file in "${commandFiles[@]}" do diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index e6b4496ba4..58ba5c6c89 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -23,4 +23,9 @@ + + + + + diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index afc877a99c..0377d58df4 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -43,11 +43,13 @@ + + @@ -56,6 +58,7 @@ + @@ -85,9 +88,4 @@ - - - - - - + \ No newline at end of file From d02886ce87f56d0b1cf747b31f131d3aeceb4fad Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 28 Aug 2022 20:19:35 +0530 Subject: [PATCH 50/89] copying generated config files to test folder --- src/Cli/src/Cli.csproj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index 58ba5c6c89..7cd5a54584 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -23,9 +23,14 @@ + + + + + From 183ead3cce95843ab37b4e7e0ad7ef9c2a357c52 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 28 Aug 2022 20:33:01 +0530 Subject: [PATCH 51/89] adding no-build arguement to integration tests --- .pipelines/cosmos-pipelines.yml | 2 +- .pipelines/mssql-pipelines.yml | 4 ++-- .pipelines/mysql-pipelines.yml | 2 +- .pipelines/pg-pipelines.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 97cc55167f..9f5fce4eb7 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -59,7 +59,7 @@ steps: displayName: 'Run Cosmos DB Integration Tests' inputs: command: test - arguments: '--filter "TestCategory=Cosmos" --configuration $(buildConfiguration) $(ADDITIONAL_TEST_ARGS)' + arguments: '--filter "TestCategory=Cosmos" --no-build --configuration $(buildConfiguration) $(ADDITIONAL_TEST_ARGS)' projects: '**/*Tests/*.csproj' # '/XPlat Code coverage --results-directory /home/vsts/work/1/s/TestResults/' diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 01ee5b713e..0508c532fd 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -62,7 +62,7 @@ jobs: displayName: 'Run MsSql Integration Tests' inputs: command: test - arguments: '--filter "TestCategory=MsSql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' + arguments: '--filter "TestCategory=MsSql" --no-build --configuration $(buildConfiguration) --collect "XPlat Code coverage"' projects: '**/*Tests/*.csproj' - task: PublishCodeCoverageResults@1 @@ -147,7 +147,7 @@ jobs: displayName: 'Run MsSql Integration Tests' inputs: command: test - arguments: '--filter "TestCategory=MsSql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' + arguments: '--filter "TestCategory=MsSql" --no-build --configuration $(buildConfiguration) --collect "XPlat Code coverage"' projects: '**/*Tests/*.csproj' - task: PublishCodeCoverageResults@1 diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 03e3e843c4..6e388348d0 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -66,7 +66,7 @@ jobs: displayName: 'Run MySql Integration Tests' inputs: command: test - arguments: '--filter "TestCategory=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' + arguments: '--filter "TestCategory=MySql" --no-build --configuration $(buildConfiguration) --collect "XPlat Code coverage"' projects: '**/*Tests/*.csproj' - task: PublishCodeCoverageResults@1 diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index fb64d46295..ab104f68f2 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -62,7 +62,7 @@ jobs: displayName: 'Run Postgres Integration Tests' inputs: command: test - arguments: '--filter "TestCategory=PostgreSql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' + arguments: '--filter "TestCategory=PostgreSql" --no-build --configuration $(buildConfiguration) --collect "XPlat Code coverage"' projects: '**/*Tests/*.csproj' - task: PublishCodeCoverageResults@1 From 3c45b94e5e9bb59e11a648652e94fc6af4ff996a Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 29 Aug 2022 13:26:30 +0530 Subject: [PATCH 52/89] chaning the file names in commands --- MsSqlCommands.txt | 198 +++++++++--------- MySqlCommands.txt | 198 +++++++++--------- PostgreSqlCommands.txt | 186 ++++++++-------- .../Azure.DataApiBuilder.Service.csproj | 6 +- 4 files changed, 294 insertions(+), 294 deletions(-) diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index 9d1af8021f..94ac5fe98f 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -1,99 +1,99 @@ -init --config "dab-config.Mssql.json" --database-type mssql --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" -add Publisher --config "dab-config.Mssql.json" --source publishers --permissions "anonymous:read" -add Stock --config "dab-config.Mssql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.Mssql.json" --source books --permissions "anonymous:read" --graphql "book:books" -add BookWebsitePlacement --config "dab-config.Mssql.json" --source book_website_placements --permissions "anonymous:read" -add Author --config "dab-config.Mssql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.Mssql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" -add Comic --config "dab-config.Mssql.json" --source comics --permissions "anonymous:read" -add Broker --config "dab-config.Mssql.json" --source brokers --permissions "anonymous:read" -add WebsiteUser --config "dab-config.Mssql.json" --source website_users --permissions "anonymous:create,read,delete,update" -add SupportedType --config "dab-config.Mssql.json" --source type_table --permissions "anonymous:create,read,delete,update" -add stocks_price --config "dab-config.Mssql.json" --source stocks_price --permissions "anonymous:read" -add Tree --config "dab-config.Mssql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Shrub --config "dab-config.Mssql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Fungus --config "dab-config.Mssql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" -add books_view_all --config "dab-config.Mssql.json" --source books_view_all --permissions "anonymous:read" -add stocks_view_selected --config "dab-config.Mssql.json" --source stocks_view_selected --permissions "anonymous:read" -add books_publishers_view_composite --config "dab-config.Mssql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true -add Empty --config "dab-config.Mssql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true -add Notebook --config "dab-config.Mssql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" -add Journal --config "dab-config.Mssql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" -add ArtOfWar --config "dab-config.Mssql.json" --source "aow" --rest true --permissions "anonymous:*" -update Publisher --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_01:create,delete" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_02:create,delete" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_03:create,delete" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_04:create,delete" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_06:create,delete" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Publisher --config "dab-config.Mssql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update Book --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" -update Book --config "dab-config.Mssql.json" --relationship publishers --target.entity Publisher --cardinality one -update Book --config "dab-config.Mssql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one -update Book --config "dab-config.Mssql.json" --relationship reviews --target.entity Review --cardinality many -update Book --config "dab-config.Mssql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -update Book --config "dab-config.Mssql.json" --map "id:id,title:title" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_01:create,delete" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_02:create,delete" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_03:create,delete" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_04:create,delete" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_05:create,delete" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_05:update" --fields.include "*" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_06:create,delete" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_07:create" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_07:read" --fields.include "*" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_08:create" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.Mssql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Review --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" -update Review --config "dab-config.Mssql.json" --relationship books --target.entity Book --cardinality one -update BookWebsitePlacement --config "dab-config.Mssql.json" --permissions "authenticated:create,update" --rest true --graphql true -update BookWebsitePlacement --config "dab-config.Mssql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" -update Author --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update WebsiteUser --config "dab-config.Mssql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" -update stocks_price --config "dab-config.Mssql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false -update Broker --config "dab-config.Mssql.json" --permissions "authenticated:create,update,read,delete" --graphql false -update Tree --config "dab-config.Mssql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -update Shrub --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -update Fungus --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true -update Fungus --config "dab-config.Mssql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" -update books_view_all --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update stocks_view_selected --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" -update books_publishers_view_composite --config "dab-config.Mssql.json" --permissions "authenticated:create,read,update,delete" -update BookWebsitePlacement --config "dab-config.Mssql.json" --relationship books --target.entity Book --cardinality one -update SupportedType --config "dab-config.Mssql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Author --config "dab-config.Mssql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -update Notebook --config "dab-config.Mssql.json" --permissions "anonymous:create,update,delete" -update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" -update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" -update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_update_noread:create" -update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -update Journal --config "dab-config.Mssql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.Mssql.json" --permissions "authorizationHandlerTester:read" -update ArtOfWar --config "dab-config.Mssql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" +init --config "dab-config.MsSql.json" --database-type mssql --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" +add Publisher --config "dab-config.MsSql.json" --source publishers --permissions "anonymous:read" +add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonymous:create,read,update" +add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add BookWebsitePlacement --config "dab-config.MsSql.json" --source book_website_placements --permissions "anonymous:read" +add Author --config "dab-config.MsSql.json" --source authors --permissions "anonymous:read" +add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" +add Comic --config "dab-config.MsSql.json" --source comics --permissions "anonymous:read" +add Broker --config "dab-config.MsSql.json" --source brokers --permissions "anonymous:read" +add WebsiteUser --config "dab-config.MsSql.json" --source website_users --permissions "anonymous:create,read,delete,update" +add SupportedType --config "dab-config.MsSql.json" --source type_table --permissions "anonymous:create,read,delete,update" +add stocks_price --config "dab-config.MsSql.json" --source stocks_price --permissions "anonymous:read" +add Tree --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.MsSql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" +add books_view_all --config "dab-config.MsSql.json" --source books_view_all --permissions "anonymous:read" +add stocks_view_selected --config "dab-config.MsSql.json" --source stocks_view_selected --permissions "anonymous:read" +add books_publishers_view_composite --config "dab-config.MsSql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +add Empty --config "dab-config.MsSql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +add Notebook --config "dab-config.MsSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +add Journal --config "dab-config.MsSql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +add ArtOfWar --config "dab-config.MsSql.json" --source "aow" --rest true --permissions "anonymous:*" +update Publisher --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_02:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_03:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_04:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:create,delete" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Stock --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Book --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" +update Book --config "dab-config.MsSql.json" --relationship publishers --target.entity Publisher --cardinality one +update Book --config "dab-config.MsSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +update Book --config "dab-config.MsSql.json" --relationship reviews --target.entity Review --cardinality many +update Book --config "dab-config.MsSql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.MsSql.json" --map "id:id,title:title" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_02:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_03:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_05:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_05:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_06:create,delete" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:read" --fields.include "*" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:create" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.MsSql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Review --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality one +update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "authenticated:create,update" --rest true --graphql true +update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +update Author --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update WebsiteUser --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" +update stocks_price --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Comic --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Broker --config "dab-config.MsSql.json" --permissions "authenticated:create,update,read,delete" --graphql false +update Tree --config "dab-config.MsSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +update Fungus --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +update books_view_all --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update stocks_view_selected --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" +update books_publishers_view_composite --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" +update BookWebsitePlacement --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality one +update SupportedType --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Author --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Notebook --config "dab-config.MsSql.json" --permissions "anonymous:create,update,delete" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:create" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.MsSql.json" --permissions "authorizationHandlerTester:read" +update ArtOfWar --config "dab-config.MsSql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/MySqlCommands.txt b/MySqlCommands.txt index 4769aa5d34..55123bcef5 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -1,99 +1,99 @@ -init --config "dab-config.Mysql.json" --database-type mssql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" -add Publisher --config "dab-config.Mysql.json" --source publishers --permissions "anonymous:read" -add Stock --config "dab-config.Mysql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.Mysql.json" --source books --permissions "anonymous:read" --graphql "book:books" -add BookWebsitePlacement --config "dab-config.Mysql.json" --source book_website_placements --permissions "anonymous:read" -add Author --config "dab-config.Mysql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.Mysql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" -add Comic --config "dab-config.Mysql.json" --source comics --permissions "anonymous:read" -add Broker --config "dab-config.Mysql.json" --source brokers --permissions "anonymous:read" -add WebsiteUser --config "dab-config.Mysql.json" --source website_users --permissions "anonymous:create,read,delete,update" -add SupportedType --config "dab-config.Mysql.json" --source type_table --permissions "anonymous:create,read,delete,update" -add stocks_price --config "dab-config.Mysql.json" --source stocks_price --permissions "anonymous:read" -add Tree --config "dab-config.Mysql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Shrub --config "dab-config.Mysql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Fungus --config "dab-config.Mysql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" -add books_view_all --config "dab-config.Mysql.json" --source books_view_all --permissions "anonymous:read" -add stocks_view_selected --config "dab-config.Mysql.json" --source stocks_view_selected --permissions "anonymous:read" -add books_publishers_view_composite --config "dab-config.Mysql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true -add Empty --config "dab-config.Mysql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true -add Notebook --config "dab-config.Mysql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" -add Journal --config "dab-config.Mysql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" -add ArtOfWar --config "dab-config.Mysql.json" --source "aow" --rest true --permissions "anonymous:*" -update Publisher --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_01:create,delete" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_02:create,delete" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_03:create,delete" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_04:create,delete" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_06:create,delete" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Publisher --config "dab-config.Mysql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update Book --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" -update Book --config "dab-config.Mysql.json" --relationship publishers --target.entity Publisher --cardinality one -update Book --config "dab-config.Mysql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one -update Book --config "dab-config.Mysql.json" --relationship reviews --target.entity Review --cardinality many -update Book --config "dab-config.Mysql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -update Book --config "dab-config.Mysql.json" --map "id:id,title:title" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_01:create,delete" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_02:create,delete" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_03:create,delete" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_04:create,delete" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_05:create,delete" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_05:update" --fields.include "*" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_06:create,delete" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_07:create" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_07:read" --fields.include "*" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_08:create" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.Mysql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Review --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" -update Review --config "dab-config.Mysql.json" --relationship books --target.entity Book --cardinality one -update BookWebsitePlacement --config "dab-config.Mysql.json" --permissions "authenticated:create,update" --rest true --graphql true -update BookWebsitePlacement --config "dab-config.Mysql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" -update Author --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update WebsiteUser --config "dab-config.Mysql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" -update stocks_price --config "dab-config.Mysql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false -update Broker --config "dab-config.Mysql.json" --permissions "authenticated:create,update,read,delete" --graphql false -update Tree --config "dab-config.Mysql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -update Shrub --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -update Fungus --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true -update Fungus --config "dab-config.Mysql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" -update books_view_all --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update stocks_view_selected --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" -update books_publishers_view_composite --config "dab-config.Mysql.json" --permissions "authenticated:create,read,update,delete" -update BookWebsitePlacement --config "dab-config.Mysql.json" --relationship books --target.entity Book --cardinality one -update SupportedType --config "dab-config.Mysql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Author --config "dab-config.Mysql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -update Notebook --config "dab-config.Mysql.json" --permissions "anonymous:create,update,delete" -update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" -update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" -update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_update_noread:create" -update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -update Journal --config "dab-config.Mysql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.Mysql.json" --permissions "authorizationHandlerTester:read" -update ArtOfWar --config "dab-config.Mysql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" +init --config "dab-config.MySql.json" --database-type mssql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" +add Publisher --config "dab-config.MySql.json" --source publishers --permissions "anonymous:read" +add Stock --config "dab-config.MySql.json" --source stocks --permissions "anonymous:create,read,update" +add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add BookWebsitePlacement --config "dab-config.MySql.json" --source book_website_placements --permissions "anonymous:read" +add Author --config "dab-config.MySql.json" --source authors --permissions "anonymous:read" +add Review --config "dab-config.MySql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" +add Comic --config "dab-config.MySql.json" --source comics --permissions "anonymous:read" +add Broker --config "dab-config.MySql.json" --source brokers --permissions "anonymous:read" +add WebsiteUser --config "dab-config.MySql.json" --source website_users --permissions "anonymous:create,read,delete,update" +add SupportedType --config "dab-config.MySql.json" --source type_table --permissions "anonymous:create,read,delete,update" +add stocks_price --config "dab-config.MySql.json" --source stocks_price --permissions "anonymous:read" +add Tree --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.MySql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" +add books_view_all --config "dab-config.MySql.json" --source books_view_all --permissions "anonymous:read" +add stocks_view_selected --config "dab-config.MySql.json" --source stocks_view_selected --permissions "anonymous:read" +add books_publishers_view_composite --config "dab-config.MySql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +add Empty --config "dab-config.MySql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +add Notebook --config "dab-config.MySql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +add Journal --config "dab-config.MySql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +add ArtOfWar --config "dab-config.MySql.json" --source "aow" --rest true --permissions "anonymous:*" +update Publisher --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_02:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_03:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_04:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:create,delete" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Stock --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Book --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" +update Book --config "dab-config.MySql.json" --relationship publishers --target.entity Publisher --cardinality one +update Book --config "dab-config.MySql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +update Book --config "dab-config.MySql.json" --relationship reviews --target.entity Review --cardinality many +update Book --config "dab-config.MySql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.MySql.json" --map "id:id,title:title" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_01:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:create,delete" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:read" --fields.include "*" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:create" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Review --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one +update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:create,update" --rest true --graphql true +update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +update Author --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update WebsiteUser --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" +update stocks_price --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Comic --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Broker --config "dab-config.MySql.json" --permissions "authenticated:create,update,read,delete" --graphql false +update Tree --config "dab-config.MySql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +update Fungus --config "dab-config.MySql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +update books_view_all --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update stocks_view_selected --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" +update books_publishers_view_composite --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" +update BookWebsitePlacement --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one +update SupportedType --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Author --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Notebook --config "dab-config.MySql.json" --permissions "anonymous:create,update,delete" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:create" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.MySql.json" --permissions "authorizationHandlerTester:read" +update ArtOfWar --config "dab-config.MySql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index 8703c2db9c..48a7389f9d 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -1,93 +1,93 @@ -init --config "dab-config.Postgresql.json" --database-type mssql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" -add Publisher --config "dab-config.Postgresql.json" --source publishers --permissions "anonymous:read" -add Stock --config "dab-config.Postgresql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.Postgresql.json" --source books --permissions "anonymous:read" --graphql "book:books" -add BookWebsitePlacement --config "dab-config.Postgresql.json" --source book_website_placements --permissions "anonymous:read" -add Author --config "dab-config.Postgresql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.Postgresql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" -add Comic --config "dab-config.Postgresql.json" --source comics --permissions "anonymous:read" -add Broker --config "dab-config.Postgresql.json" --source brokers --permissions "anonymous:read" -add WebsiteUser --config "dab-config.Postgresql.json" --source website_users --permissions "anonymous:create,read,delete,update" -add SupportedType --config "dab-config.Postgresql.json" --source type_table --permissions "anonymous:create,read,delete,update" -add stocks_price --config "dab-config.Postgresql.json" --source stocks_price --permissions "anonymous:read" -add Tree --config "dab-config.Postgresql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Shrub --config "dab-config.Postgresql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Fungus --config "dab-config.Postgresql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" -add Empty --config "dab-config.Postgresql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true -add Notebook --config "dab-config.Postgresql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" -add Journal --config "dab-config.Postgresql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" -add ArtOfWar --config "dab-config.Postgresql.json" --source "aow" --rest true --permissions "anonymous:*" -update Publisher --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_01:create,delete" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_02:create,delete" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_03:create,delete" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_04:create,delete" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_06:create,delete" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Publisher --config "dab-config.Postgresql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update Book --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" -update Book --config "dab-config.Postgresql.json" --relationship publishers --target.entity Publisher --cardinality one -update Book --config "dab-config.Postgresql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one -update Book --config "dab-config.Postgresql.json" --relationship reviews --target.entity Review --cardinality many -update Book --config "dab-config.Postgresql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -update Book --config "dab-config.Postgresql.json" --map "id:id,title:title" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_01:create,delete" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_01:update" --fields.include "*" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_02:create,delete" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_02:update" --fields.include "*" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_03:create,delete" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_03:update" --fields.include "*" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_04:create,delete" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_04:update" --fields.include "*" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_05:create,delete" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_05:update" --fields.include "*" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_06:update" --fields.include "*" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_06:create,delete" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_07:create" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_07:read" --fields.include "*" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_08:create" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" -update Book --config "dab-config.Postgresql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Review --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" -update Review --config "dab-config.Postgresql.json" --relationship books --target.entity Book --cardinality one -update BookWebsitePlacement --config "dab-config.Postgresql.json" --permissions "authenticated:create,update" --rest true --graphql true -update BookWebsitePlacement --config "dab-config.Postgresql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" -update Author --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true -update WebsiteUser --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" -update stocks_price --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false -update Broker --config "dab-config.Postgresql.json" --permissions "authenticated:create,update,read,delete" --graphql false -update Tree --config "dab-config.Postgresql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -update Shrub --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -update Fungus --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true -update Fungus --config "dab-config.Postgresql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" -update BookWebsitePlacement --config "dab-config.Postgresql.json" --relationship books --target.entity Book --cardinality one -update SupportedType --config "dab-config.Postgresql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Author --config "dab-config.Postgresql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link -update Notebook --config "dab-config.Postgresql.json" --permissions "anonymous:create,update,delete" -update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" -update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" -update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_update_noread:create" -update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" -update Journal --config "dab-config.Postgresql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" -update Journal --config "dab-config.Postgresql.json" --permissions "authorizationHandlerTester:read" -update ArtOfWar --config "dab-config.Postgresql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" +init --config "dab-config.PostgreSql.json" --database-type mssql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" +add Publisher --config "dab-config.PostgreSql.json" --source publishers --permissions "anonymous:read" +add Stock --config "dab-config.PostgreSql.json" --source stocks --permissions "anonymous:create,read,update" +add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add BookWebsitePlacement --config "dab-config.PostgreSql.json" --source book_website_placements --permissions "anonymous:read" +add Author --config "dab-config.PostgreSql.json" --source authors --permissions "anonymous:read" +add Review --config "dab-config.PostgreSql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" +add Comic --config "dab-config.PostgreSql.json" --source comics --permissions "anonymous:read" +add Broker --config "dab-config.PostgreSql.json" --source brokers --permissions "anonymous:read" +add WebsiteUser --config "dab-config.PostgreSql.json" --source website_users --permissions "anonymous:create,read,delete,update" +add SupportedType --config "dab-config.PostgreSql.json" --source type_table --permissions "anonymous:create,read,delete,update" +add stocks_price --config "dab-config.PostgreSql.json" --source stocks_price --permissions "anonymous:read" +add Tree --config "dab-config.PostgreSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.PostgreSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Fungus --config "dab-config.PostgreSql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" +add Empty --config "dab-config.PostgreSql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true +add Notebook --config "dab-config.PostgreSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" +add Journal --config "dab-config.PostgreSql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" +add ArtOfWar --config "dab-config.PostgreSql.json" --source "aow" --rest true --permissions "anonymous:*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.id ne 1940" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:create,delete" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" +update Stock --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Book --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" +update Book --config "dab-config.PostgreSql.json" --relationship publishers --target.entity Publisher --cardinality one +update Book --config "dab-config.PostgreSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one +update Book --config "dab-config.PostgreSql.json" --relationship reviews --target.entity Review --cardinality many +update Book --config "dab-config.PostgreSql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.PostgreSql.json" --map "id:id,title:title" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_02:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_03:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_04:read" --fields.include "*" --policy-database "@item.title ne 'Policy-Test-01'" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_05:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_05:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_05:read" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:update" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:create,delete" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id ne 10" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:create" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:update" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:read" --fields.include "*" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_07:delete" --fields.include "*" --policy-database "@item.id ne 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:create" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" +update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:read" --fields.include "*" +update Review --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one +update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update" --rest true --graphql true +update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" +update Author --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update WebsiteUser --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" +update stocks_price --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Comic --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Broker --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update,read,delete" --graphql false +update Tree --config "dab-config.PostgreSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +update Fungus --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" +update BookWebsitePlacement --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one +update SupportedType --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false +update Author --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link +update Notebook --config "dab-config.PostgreSql.json" --permissions "anonymous:create,update,delete" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:create" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:update" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" +update Journal --config "dab-config.PostgreSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" +update Journal --config "dab-config.PostgreSql.json" --permissions "authorizationHandlerTester:read" +update ArtOfWar --config "dab-config.PostgreSql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index 0377d58df4..6b65a6e1b6 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -53,9 +53,9 @@ - - - + + + From 900e4658f71af32790fb461c36803ca8a5e5faa4 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 29 Aug 2022 13:40:37 +0530 Subject: [PATCH 53/89] chaning the file names in pipeline files --- .pipelines/mssql-pipelines.yml | 8 ++++---- .pipelines/mysql-pipelines.yml | 4 ++-- .pipelines/pg-pipelines.yml | 4 ++-- src/Cli/src/Cli.csproj | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 0508c532fd..2967359123 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -52,11 +52,11 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1 - displayName: 'Transform dab-config.Mssql.json' + displayName: 'Transform dab-config.MsSql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.Mssql.json' + targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' @@ -137,11 +137,11 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1 - displayName: 'Transform dab-config.Mssql.json' + displayName: 'Transform dab-config.MsSql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.Mssql.json' + targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 6e388348d0..57a36af565 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -56,11 +56,11 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1 - displayName: 'Transform dab-config.Mysql.json' + displayName: 'Transform dab-config.MySql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.Mysql.json' + targetFiles: 'src/out/tests/net6.0/dab-config.MySql.json' - task: DotNetCoreCLI@2 displayName: 'Run MySql Integration Tests' diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index ab104f68f2..6373650b8b 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -52,11 +52,11 @@ jobs: arguments: '--configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1 - displayName: 'Transform dab-config.Postgresql.json' + displayName: 'Transform dab-config.PostgreSql.json' inputs: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.Postgresql.json' + targetFiles: 'src/out/tests/net6.0/dab-config.PostgreSql.json' - task: DotNetCoreCLI@2 displayName: 'Run Postgres Integration Tests' diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index 7cd5a54584..20b3c60fb6 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -30,7 +30,7 @@ - + From 44f0a56a149d8d98df7223708a8b02b9cdfb73fd Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 29 Aug 2022 15:40:15 +0530 Subject: [PATCH 54/89] updating commands to reflect latest config changes --- MsSqlCommands.txt | 7 ++++--- MySqlCommands.txt | 7 ++++--- PostgreSqlCommands.txt | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index 94ac5fe98f..115160b812 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -1,11 +1,11 @@ init --config "dab-config.MsSql.json" --database-type mssql --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" add Publisher --config "dab-config.MsSql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books" add BookWebsitePlacement --config "dab-config.MsSql.json" --source book_website_placements --permissions "anonymous:read" add Author --config "dab-config.MsSql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" -add Comic --config "dab-config.MsSql.json" --source comics --permissions "anonymous:read" +add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:create,read,update" --rest false --graphql "review:reviews" +add Comic --config "dab-config.MsSql.json" --source comics --permissions "anonymous:create,read,update" add Broker --config "dab-config.MsSql.json" --source brokers --permissions "anonymous:read" add WebsiteUser --config "dab-config.MsSql.json" --source website_users --permissions "anonymous:create,read,delete,update" add SupportedType --config "dab-config.MsSql.json" --source type_table --permissions "anonymous:create,read,delete,update" @@ -89,6 +89,7 @@ update BookWebsitePlacement --config "dab-config.MsSql.json" --relationship book update SupportedType --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false update Author --config "dab-config.MsSql.json" --relationship books --target.entity Book --cardinality many --linking.object book_author_link update Notebook --config "dab-config.MsSql.json" --permissions "anonymous:create,update,delete" +update Empty --config "dab-config.MsSql.json" --permissions "anonymous:read" update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_noupdate:update" --fields.include "*" --policy-database "@item.id ne 1" update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_noupdate:read" --fields.include "*" update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:create" diff --git a/MySqlCommands.txt b/MySqlCommands.txt index 55123bcef5..89cca8f5b3 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -1,11 +1,11 @@ init --config "dab-config.MySql.json" --database-type mssql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" add Publisher --config "dab-config.MySql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.MySql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books" add BookWebsitePlacement --config "dab-config.MySql.json" --source book_website_placements --permissions "anonymous:read" add Author --config "dab-config.MySql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.MySql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" -add Comic --config "dab-config.MySql.json" --source comics --permissions "anonymous:read" +add Review --config "dab-config.MySql.json" --source reviews --permissions "anonymous:create,read,update" --rest false --graphql "review:reviews" +add Comic --config "dab-config.MySql.json" --source comics --permissions "anonymous:create,read,update" add Broker --config "dab-config.MySql.json" --source brokers --permissions "anonymous:read" add WebsiteUser --config "dab-config.MySql.json" --source website_users --permissions "anonymous:create,read,delete,update" add SupportedType --config "dab-config.MySql.json" --source type_table --permissions "anonymous:create,read,delete,update" @@ -71,6 +71,7 @@ update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:del update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:read" --fields.include "*" update Review --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" update Review --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one +update Empty --config "dab-config.MsSql.json" --permissions "anonymous:read" update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:create,update" --rest true --graphql true update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" update Author --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index 48a7389f9d..7aa0cabb12 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -1,11 +1,11 @@ init --config "dab-config.PostgreSql.json" --database-type mssql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" add Publisher --config "dab-config.PostgreSql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.PostgreSql.json" --source stocks --permissions "anonymous:create,read,update" -add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:read" --graphql "book:books" +add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books" add BookWebsitePlacement --config "dab-config.PostgreSql.json" --source book_website_placements --permissions "anonymous:read" add Author --config "dab-config.PostgreSql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.PostgreSql.json" --source reviews --permissions "anonymous:read" --rest false --graphql "review:reviews" -add Comic --config "dab-config.PostgreSql.json" --source comics --permissions "anonymous:read" +add Review --config "dab-config.PostgreSql.json" --source reviews --permissions "anonymous:create,read,update" --rest false --graphql "review:reviews" +add Comic --config "dab-config.PostgreSql.json" --source comics --permissions "anonymous:create,read,update" add Broker --config "dab-config.PostgreSql.json" --source brokers --permissions "anonymous:read" add WebsiteUser --config "dab-config.PostgreSql.json" --source website_users --permissions "anonymous:create,read,delete,update" add SupportedType --config "dab-config.PostgreSql.json" --source type_table --permissions "anonymous:create,read,delete,update" @@ -68,6 +68,7 @@ update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_0 update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:read" --fields.include "*" update Review --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" update Review --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one +update Empty --config "dab-config.MsSql.json" --permissions "anonymous:read" update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update" --rest true --graphql true update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" update Author --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true From 70d83e9c77d05b98cbc00141f9889ca8d2a04c98 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 29 Aug 2022 18:44:24 +0530 Subject: [PATCH 55/89] fix formatting --- src/Service.Tests/Configuration/ConfigurationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index 2fe94112ae..ca783b99fa 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -510,4 +510,4 @@ private bool HandleException(Exception e) where T : Exception return false; } } -} \ No newline at end of file +} From e13972d41873026aea96bb2ccccae88899c03d54 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 29 Aug 2022 19:05:35 +0530 Subject: [PATCH 56/89] adding --no-build arguement to pack command --- .pipelines/build-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index 1af3729c41..7422c74b91 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -83,7 +83,7 @@ steps: command: custom custom: pack projects: '**/Cli.csproj' - arguments: '-p:Version=$(dabVersion) -o $(Build.ArtifactStagingDirectory)/nupkg' + arguments: '-p:Version=$(dabVersion) -o $(Build.ArtifactStagingDirectory)/nupkg --no-build' - task: NuGetCommand@2 displayName: 'Publish Nuget to Internal Feed' From 424e867ef01c730772a90a909a5a1657f51bc0da Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 12 Oct 2022 18:06:34 +0530 Subject: [PATCH 57/89] adding msbuild utilites assembly --- .pipelines/cosmos-pipelines.yml | 8 +- .pipelines/mssql-pipelines.yml | 16 +- .pipelines/mysql-pipelines.yml | 9 +- .pipelines/pg-pipelines.yml | 9 +- src/Cli/src/Cli.csproj | 4 +- src/Service/dab-config.Cosmos.json | 91 +++ src/Service/dab-config.MsSql.json | 879 +++++++++++++++++++++++++ src/Service/dab-config.MySql.json | 872 ++++++++++++++++++++++++ src/Service/dab-config.PostgreSql.json | 821 +++++++++++++++++++++++ 9 files changed, 2669 insertions(+), 40 deletions(-) create mode 100644 src/Service/dab-config.Cosmos.json create mode 100644 src/Service/dab-config.MsSql.json create mode 100644 src/Service/dab-config.MySql.json create mode 100644 src/Service/dab-config.PostgreSql.json diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 76bbafb854..89bbdeb58e 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -47,6 +47,7 @@ steps: folderPath: '$(System.DefaultWorkingDirectory)' fileType: 'json' targetFiles: 'src/Service/dab-config.Cosmos.json' + - task: DotNetCoreCLI@2 displayName: Build inputs: @@ -54,13 +55,6 @@ steps: projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need -- task: FileTransform@1 - displayName: 'Transform dab-config.Cosmos.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.Cosmos.json' - - task: DotNetCoreCLI@2 displayName: 'Run Cosmos DB Integration Tests' inputs: diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 1b333b8853..fbaee615a3 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -58,13 +58,6 @@ jobs: projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - task: FileTransform@1 - displayName: 'Transform dab-config.MsSql.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' - - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' inputs: @@ -149,14 +142,7 @@ jobs: command: build projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - - task: FileTransform@1 - displayName: 'Transform dab-config.MsSql.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' - + - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' inputs: diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index f7e6769fed..72aa4de630 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -61,14 +61,7 @@ jobs: command: build projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - - task: FileTransform@1 - displayName: 'Transform dab-config.MySql.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.MySql.json' - + - task: DotNetCoreCLI@2 displayName: 'Run MySql Integration Tests' inputs: diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index afefa2e4b4..3ed216eb55 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -57,14 +57,7 @@ jobs: command: build projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - - - task: FileTransform@1 - displayName: 'Transform dab-config.PostgreSql.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/out/tests/net6.0/dab-config.PostgreSql.json' - + - task: DotNetCoreCLI@2 displayName: 'Run Postgres Integration Tests' inputs: diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index f8a21e54f9..a47eba3801 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -28,10 +28,10 @@ - + diff --git a/src/Service/dab-config.Cosmos.json b/src/Service/dab-config.Cosmos.json new file mode 100644 index 0000000000..04e639598f --- /dev/null +++ b/src/Service/dab-config.Cosmos.json @@ -0,0 +1,91 @@ +{ + "$schema": "../schemas/dab.draft-01.schema.json", + "data-source": { + "database-type": "cosmos", + "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" + }, + "cosmos": { + "database": "graphqldb", + "container": "planet", + "schema": "schema.gql" + }, + "runtime": { + "rest": { + "enabled": false + }, + "graphql": { + "enabled": true, + "path": "/graphql", + "allow-introspection": true + }, + "host": { + "mode": "development", + "authenticate-devmode-requests": false, + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Planet": { + "source": "graphqldb.planet", + "rest": false, + "graphql": { + "type": { + "singular": "Planet", + "plural": "Planets" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Character": { + "source": "graphqldb.character", + "rest": false, + "graphql": { + "type": { + "singular": "Character", + "plural": "Characters" + } + }, + "permissions": [ + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Star": { + "source": "graphqldb.star", + "rest": false, + "graphql": { + "type": { + "singular": "Star", + "plural": "Stars" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + } + } + } \ No newline at end of file diff --git a/src/Service/dab-config.MsSql.json b/src/Service/dab-config.MsSql.json new file mode 100644 index 0000000000..c0dfcb3985 --- /dev/null +++ b/src/Service/dab-config.MsSql.json @@ -0,0 +1,879 @@ +{ + "$schema": "../schemas/dab.draft-01.schema.json", + "data-source": { + "database-type": "mssql", + "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" + }, + "mssql": { + "set-session-context": false + }, + "runtime": { + "rest": { + "path": "/api" + }, + "graphql": { + "path": "/graphql", + "allow-introspection": true + }, + "host": { + "mode": "development", + "authenticate-devmode-requests": false, + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Publisher": { + "source": "publishers", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book" + } + } + }, + "Stock": { + "source": "stocks", + "rest": { + "path": "commodities" + }, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Book": { + "source": "books", + "graphql": { + "type": { + "singular": "book", + "plural": "books" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_05", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 10" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_07", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + } + ] + }, + { + "role": "policy_tester_08", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + } + ], + "relationships": { + "publishers": { + "cardinality": "one", + "target.entity": "Publisher" + }, + "websiteplacement": { + "cardinality": "one", + "target.entity": "BookWebsitePlacement" + }, + "reviews": { + "cardinality": "many", + "target.entity": "Review" + }, + "authors": { + "cardinality": "many", + "target.entity": "Author", + "linking.object": "book_author_link", + "linking.source.fields": [ "book_id" ], + "linking.target.fields": [ "author_id" ] + } + }, + "mappings": { + "id": "id", + "title": "title" + } + }, + "BookWebsitePlacement": { + "source": "book_website_placements", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "update", + { + "action": "delete", + "policy": { + "database": "@claims.id eq @item.id" + }, + "fields": { + "include": [ "*" ] + } + } + ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Author": { + "source": "authors", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book", + "linking.object": "book_author_link" + } + } + }, + "Review": { + "source": "reviews", + "rest": true, + "graphql": { + "type": { + "singular": "review", + "plural": "reviews" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Comic": { + "source": "comics", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "series": { + "cardinality": "one", + "target.entity": "series" + } + } + }, + "Broker": { + "source": "brokers", + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "WebsiteUser": { + "source": "website_users", + "rest": false, + "graphql": { + "type": { + "singular": "websiteUser", + "plural": "websiteUsers" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "SupportedType": { + "source": "type_table", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "stocks_price": { + "source": "stocks_price", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Tree": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "Scientific Name", + "region": "United State's Region" + } + }, + "Shrub": { + "source": "trees", + "rest": { + "path": "plants" + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "fancyName" + } + }, + "Fungus": { + "source": "fungi", + "rest": true, + "graphql": { + "type": { + "singular": "fungus", + "plural": "fungi" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.region ne 'northeast'" + } + } + ] + } + ], + "mappings": { + "spores": "hazards" + } + }, + "Empty": { + "source": "empty_table", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Notebook": { + "source": "notebooks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + "create", + "update", + "delete" + ] + } + ] + }, + "Journal": { + "source": "journals", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "policy_tester_noupdate", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + "delete" + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + } + ] + }, + { + "role": "authorizationHandlerTester", + "actions": [ "read" ] + } + ] + }, + "books_view_all": { + "source": "books_view_all", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "stocks_view_selected": { + "source": "stocks_view_selected", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "books_publishers_view_composite": { + "source": "books_publishers_view_composite", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "ArtOfWar": { + "source": "aow", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "*" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ], + "mappings": { + "DetailAssessmentAndPlanning": "始計", + "WagingWar": "作戰", + "StrategicAttack": "謀攻", + "NoteNum": "┬─┬ノ( º _ ºノ)" + } + }, + "series": { + "source": "series", + "permissions": [ + { + "role": "anonymous", + "actions": [ + "*" + ] + } + ], + "relationships": { + "comics": { + "cardinality": "many", + "target.entity": "Comic" + } + } + }, + "GetBooks": { + "source": { + "type": "stored-procedure", + "object": "get_books" + }, + "rest": true, + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ] + }, + "GetBook": { + "source": { + "type": "stored-procedure", + "object": "get_book_by_id" + }, + "rest": true, + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ] + } + } + } \ No newline at end of file diff --git a/src/Service/dab-config.MySql.json b/src/Service/dab-config.MySql.json new file mode 100644 index 0000000000..dde42c620b --- /dev/null +++ b/src/Service/dab-config.MySql.json @@ -0,0 +1,872 @@ +{ + "$schema": "../schemas/dab.draft-01.schema.json", + "data-source": { + "database-type": "mysql", + "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" + }, + "runtime": { + "rest": { + "enabled": true, + "path": "/api" + }, + "graphql": { + "enabled": true, + "path": "/graphql", + "allow-introspection": true + }, + "host": { + "mode": "development", + "authenticate-devmode-requests": false, + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Publisher": { + "source": "publishers", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book" + } + } + }, + "Stock": { + "source": "stocks", + "rest": { + "path": "commodities" + }, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Book": { + "source": "books", + "graphql": { + "type": { + "singular": "book", + "plural": "books" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_05", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 10" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_07", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + } + ] + }, + { + "role": "policy_tester_08", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + } + ], + "relationships": { + "publishers": { + "cardinality": "one", + "target.entity": "Publisher" + }, + "websiteplacement": { + "cardinality": "one", + "target.entity": "BookWebsitePlacement" + }, + "reviews": { + "cardinality": "many", + "target.entity": "Review" + }, + "authors": { + "cardinality": "many", + "target.entity": "Author", + "linking.object": "book_author_link", + "linking.source.fields": [ "book_id" ], + "linking.target.fields": [ "author_id" ] + } + }, + "mappings": { + "id": "id", + "title": "title" + } + }, + "BookWebsitePlacement": { + "source": "book_website_placements", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "update", + { + "action": "delete", + "policy": { + "database": "@claims.id eq @item.id" + }, + "fields": { + "include": [ "*" ] + } + } + ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Author": { + "source": "authors", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book", + "linking.object": "book_author_link" + } + } + }, + "Review": { + "source": "reviews", + "rest": true, + "graphql": { + "type": { + "singular": "review", + "plural": "reviews" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Comic": { + "source": "comics", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "series": { + "cardinality": "one", + "target.entity": "series" + } + } + }, + "Broker": { + "source": "brokers", + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "WebsiteUser": { + "source": "website_users", + "rest": false, + "graphql": { + "type": { + "singular": "websiteUser", + "plural": "websiteUsers" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "SupportedType": { + "source": "type_table", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "stocks_price": { + "source": "stocks_price", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Tree": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "Scientific Name", + "region": "United State's Region" + } + }, + "Shrub": { + "source": "trees", + "rest": { + "path": "plants" + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "fancyName" + } + }, + "Fungus": { + "source": "fungi", + "rest": true, + "graphql": { + "type": { + "singular": "fungus", + "plural": "fungi" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.region ne 'northeast'" + } + } + ] + } + ], + "mappings": { + "spores": "hazards" + } + }, + "Empty": { + "source": "empty_table", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Notebook": { + "source": "notebooks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + "create", + "update", + "delete" + ] + } + ] + }, + "Journal": { + "source": "journals", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "policy_tester_noupdate", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + "delete" + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + } + ] + }, + { + "role": "authorizationHandlerTester", + "actions": [ "read" ] + } + ] + }, + "books_view_all": { + "source": "books_view_all", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "stocks_view_selected": { + "source": "stocks_view_selected", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "books_publishers_view_composite": { + "source": "books_publishers_view_composite", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "ArtOfWar": { + "source": "aow", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "*" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ], + "mappings": { + "DetailAssessmentAndPlanning": "始計", + "WagingWar": "作戰", + "StrategicAttack": "謀攻", + "NoteNum": "┬─┬ノ( º _ ºノ)" + } + }, + "series": { + "source": "series", + "permissions": [ + { + "role": "anonymous", + "actions": [ + "*" + ] + } + ], + "relationships": { + "comics": { + "cardinality": "many", + "target.entity": "Comic" + } + } + } + } + } \ No newline at end of file diff --git a/src/Service/dab-config.PostgreSql.json b/src/Service/dab-config.PostgreSql.json new file mode 100644 index 0000000000..c55049c034 --- /dev/null +++ b/src/Service/dab-config.PostgreSql.json @@ -0,0 +1,821 @@ +{ + "$schema": "../schemas/dab.draft-01.schema.json", + "data-source": { + "database-type": "postgresql", + "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" + }, + "runtime": { + "rest": { + "enabled": true, + "path": "/api" + }, + "graphql": { + "enabled": true, + "path": "/graphql", + "allow-introspection": true + }, + "host": { + "mode": "development", + "authenticate-devmode-requests": false, + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Publisher": { + "source": "publishers", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book" + } + } + }, + "Stock": { + "source": "stocks", + "rest": { + "path": "commodities" + }, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Book": { + "source": "books", + "graphql": { + "type": { + "singular": "book", + "plural": "books" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_05", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 10" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_07", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + } + ] + }, + { + "role": "policy_tester_08", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + } + ], + "relationships": { + "publishers": { + "cardinality": "one", + "target.entity": "Publisher" + }, + "websiteplacement": { + "cardinality": "one", + "target.entity": "BookWebsitePlacement" + }, + "reviews": { + "cardinality": "many", + "target.entity": "Review" + }, + "authors": { + "cardinality": "many", + "target.entity": "Author", + "linking.object": "book_author_link", + "linking.source.fields": [ "book_id" ], + "linking.target.fields": [ "author_id" ] + } + }, + "mappings": { + "id": "id", + "title": "title" + } + }, + "BookWebsitePlacement": { + "source": "book_website_placements", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "update", + { + "action": "delete", + "policy": { + "database": "@claims.id eq @item.id" + }, + "fields": { + "include": [ "*" ] + } + } + ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Author": { + "source": "authors", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book", + "linking.object": "book_author_link" + } + } + }, + "Review": { + "source": "reviews", + "rest": true, + "graphql": { + "type": { + "singular": "review", + "plural": "reviews" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Comic": { + "source": "comics", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "series": { + "cardinality": "one", + "target.entity": "series" + } + } + }, + "Broker": { + "source": "brokers", + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "WebsiteUser": { + "source": "website_users", + "rest": false, + "graphql": { + "type": { + "singular": "websiteUser", + "plural": "websiteUsers" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "stocks_price": { + "source": "stocks_price", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "SupportedType": { + "source": "type_table", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Tree": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "Scientific Name", + "region": "United State's Region" + } + }, + "Shrub": { + "source": "trees", + "rest": { + "path": "plants" + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "fancyName" + } + }, + "Fungus": { + "source": "fungi", + "rest": true, + "graphql": { + "type": { + "singular": "fungus", + "plural": "fungi" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.region ne 'northeast'" + } + } + ] + } + ], + "mappings": { + "spores": "hazards" + } + }, + "Empty": { + "source": "empty_table", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Notebook": { + "source": "notebooks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + "create", + "update", + "delete" + ] + } + ] + }, + "Journal": { + "source": "journals", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "policy_tester_noupdate", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + "delete" + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + } + ] + }, + { + "role": "authorizationHandlerTester", + "actions": [ "read" ] + } + ] + }, + "ArtOfWar": { + "source": "aow", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "*" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ], + "mappings": { + "DetailAssessmentAndPlanning": "始計", + "WagingWar": "作戰", + "StrategicAttack": "謀攻", + "NoteNum": "┬─┬ノ( º _ ºノ)" + } + }, + "series": { + "source": "series", + "permissions": [ + { + "role": "anonymous", + "actions": [ + "*" + ] + } + ], + "relationships": { + "comics": { + "cardinality": "many", + "target.entity": "Comic" + } + } + } + } + } \ No newline at end of file From 2edc47ec1c28e0f176ff3841df0c7ba49f5e84ef Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 10:24:01 +0530 Subject: [PATCH 58/89] generating config files using postbuild tasks --- CosmosCommands.txt | 2 +- MsSqlCommands.txt | 4 ++-- MySqlCommands.txt | 4 ++-- PostgreSqlCommands.txt | 4 ++-- configGenerator.ps1 | 12 ++++++++++++ configGenerator.sh | 12 ++++++++++++ src/Cli/src/Cli.csproj | 37 ++++++++++++++++++++++++++++++++----- 7 files changed, 63 insertions(+), 12 deletions(-) diff --git a/CosmosCommands.txt b/CosmosCommands.txt index 5dbf433cc7..2a0c7d2ca7 100644 --- a/CosmosCommands.txt +++ b/CosmosCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.Cosmos.json" --database-type "cosmos" --connection-string "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" --cosmos-database "graphqldb" --cosmos-container "planet" --graphql-schema "schema.gql" --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.Cosmos.json" --database-type "cosmos" --connection-string "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" --cosmos-database "graphqldb" --cosmos-container "planet" --graphql-schema "schema.gql" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000" add Planet --config "dab-config.Cosmos.json" --source "graphqldb.planet" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Planet:Planets" update Planet --config "dab-config.Cosmos.json" --permissions "authenticated:create,read,update,delete" add Character --config "dab-config.Cosmos.json" --source "graphqldb.character" --permissions "authenticated:create,read,update,delete" --rest false --graphql "Character:Characters" diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index 115160b812..5f9b7a3206 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.MsSql.json" --database-type mssql --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.MsSql.json" --database-type mssql --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000" add Publisher --config "dab-config.MsSql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books" @@ -76,7 +76,7 @@ update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "auth update Author --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update WebsiteUser --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" update stocks_price --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Comic --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update Broker --config "dab-config.MsSql.json" --permissions "authenticated:create,update,read,delete" --graphql false update Tree --config "dab-config.MsSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" update Shrub --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" diff --git a/MySqlCommands.txt b/MySqlCommands.txt index 89cca8f5b3..3a5bd9b485 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.MySql.json" --database-type mssql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.MySql.json" --database-type mssql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000" add Publisher --config "dab-config.MySql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.MySql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books" @@ -77,7 +77,7 @@ update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "auth update Author --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update WebsiteUser --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" update stocks_price --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Comic --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update Broker --config "dab-config.MySql.json" --permissions "authenticated:create,update,read,delete" --graphql false update Tree --config "dab-config.MySql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" update Shrub --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index 7aa0cabb12..f0ee2f5191 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.PostgreSql.json" --database-type mssql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" +init --config "dab-config.PostgreSql.json" --database-type mssql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000" add Publisher --config "dab-config.PostgreSql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.PostgreSql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books" @@ -74,7 +74,7 @@ update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions update Author --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update WebsiteUser --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" update stocks_price --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql false +update Comic --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update Broker --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update,read,delete" --graphql false update Tree --config "dab-config.PostgreSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" update Shrub --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" diff --git a/configGenerator.ps1 b/configGenerator.ps1 index 9df4e9bc07..81b9a41113 100644 --- a/configGenerator.ps1 +++ b/configGenerator.ps1 @@ -1,10 +1,22 @@ $PSDefaultParameterValues['*:Encoding'] = 'utf8'; $commandFiles = "MsSqlCommands.txt", "MySqlCommands.txt", "PostgreSqlCommands.txt", "CosmosCommands.txt"; + $workingDirectory = $PSScriptRoot + "\src\Service\"; # During start-up engine looks for config files inside /src/Service directory. Set-Location $workingDirectory; +$configFiles = "dab-config.MsSql.json", "dab-config.MySql.json", "dab-config.PostgreSql.json", "dab-config.Cosmos.json"; + +#Deleting files with same name if they exist +foreach($configFile in $configFiles) +{ + if(Test-Path $configFile) + { + Remove-Item $configFile; + } +} + $cliBuildOutputPath = $PSScriptRoot + "\src\out\cli\"; #Fetching the absolute path of dab.dll from build output directory diff --git a/configGenerator.sh b/configGenerator.sh index 4b9d37a944..b45ee8b15a 100644 --- a/configGenerator.sh +++ b/configGenerator.sh @@ -6,8 +6,20 @@ cliOutputPath="$absolutePath/src/out/cli"; #Fetching the path of dab dll file pathToDLL=$(find $cliOutputPath -name dab.dll) workingDirectory="$absolutePath/src/Service/" + +configFiles=("dab-config.MsSql.json" "dab-config.MySql.json" "dab-config.PostgreSql.json" "dab-config.Cosmos.json") + # During start-up engine looks for config files inside /src/Service directory. cd $workingDirectory; + +# Deleting existing config files +for configFile in "${configFiles[@]}" +do + if test -f "$configFile"; then + eval "rm ${configFile}" + fi +done + # Generating the config using dab commands echo "Generating config file using dab commands"; for file in "${commandFiles[@]}" diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index a47eba3801..7f21c5a438 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -1,4 +1,4 @@ - + Exe @@ -28,10 +28,37 @@ - + + From 814fc9d66420a87dcb3e77a17b9e97c263f83c0c Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 14:32:10 +0530 Subject: [PATCH 59/89] adding changes for moving config files to right directories --- src/Cli/src/Cli.csproj | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index 7f21c5a438..519f1be46e 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -25,7 +25,7 @@ - + @@ -52,12 +52,14 @@ - - - - + + + + - + + + From daa8efad67634bbdf4f0bb348c49461f11907ddd Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 16:20:47 +0530 Subject: [PATCH 60/89] updating commands to include latest changes to config files --- MsSqlCommands.txt | 12 +++++++++--- MySqlCommands.txt | 16 +++++++++++----- PostgreSqlCommands.txt | 11 ++++++----- src/Cli/src/Cli.csproj | 1 - 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index 5f9b7a3206..c14c6682c8 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -11,7 +11,7 @@ add WebsiteUser --config "dab-config.MsSql.json" --source website_users --permis add SupportedType --config "dab-config.MsSql.json" --source type_table --permissions "anonymous:create,read,delete,update" add stocks_price --config "dab-config.MsSql.json" --source stocks_price --permissions "anonymous:read" add Tree --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Shrub --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" --rest plants add Fungus --config "dab-config.MsSql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" add books_view_all --config "dab-config.MsSql.json" --source books_view_all --permissions "anonymous:read" add stocks_view_selected --config "dab-config.MsSql.json" --source stocks_view_selected --permissions "anonymous:read" @@ -20,6 +20,9 @@ add Empty --config "dab-config.MsSql.json" --source "empty_table" --permissions add Notebook --config "dab-config.MsSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" add Journal --config "dab-config.MsSql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" add ArtOfWar --config "dab-config.MsSql.json" --source "aow" --rest true --permissions "anonymous:*" +add series --config "dab-config.MsSql.json" --source "series" --permissions "anonymous:*" +add GetBooks --config "dab-config.MsSql.json" --source "get_books" --source.type "stored-procedure" --permissions "anonymous:read" --rest true --graphql false +add GetBook --config "dab-config.MsSql.json" --source "get_book_by_id" --source.type "stored-procedure" --permissions "anonymous:read" --rest true --graphql false update Publisher --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete" update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*" @@ -36,7 +39,7 @@ update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_0 update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:create,delete" update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:update" --fields.include "*" update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Stock --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest commodities --graphql true update Book --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" update Book --config "dab-config.MsSql.json" --relationship publishers --target.entity Publisher --cardinality one update Book --config "dab-config.MsSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one @@ -76,7 +79,8 @@ update BookWebsitePlacement --config "dab-config.MsSql.json" --permissions "auth update Author --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update WebsiteUser --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" update stocks_price --config "dab-config.MsSql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Comic --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship series --target.entity series --cardinality one +update series --config "dab-config.MsSql.json" --relationship comics --target.entity Comic --cardinality many update Broker --config "dab-config.MsSql.json" --permissions "authenticated:create,update,read,delete" --graphql false update Tree --config "dab-config.MsSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" update Shrub --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" @@ -98,3 +102,5 @@ update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_upd update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" update Journal --config "dab-config.MsSql.json" --permissions "authorizationHandlerTester:read" update ArtOfWar --config "dab-config.MsSql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" +update GetBook --config "dab-config.MsSql.json" --permissions "authenticated:*" +update GetBooks --config "dab-config.MsSql.json" --permissions "authenticated:*" diff --git a/MySqlCommands.txt b/MySqlCommands.txt index 3a5bd9b485..7a1ab45545 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.MySql.json" --database-type mssql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000" +init --config "dab-config.MySql.json" --database-type mysql --connection-string "server=localhost;database=datagatewaytest;Allow User Variables=true;uid=root;pwd=REPLACEME" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000" add Publisher --config "dab-config.MySql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.MySql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books" @@ -11,7 +11,7 @@ add WebsiteUser --config "dab-config.MySql.json" --source website_users --permis add SupportedType --config "dab-config.MySql.json" --source type_table --permissions "anonymous:create,read,delete,update" add stocks_price --config "dab-config.MySql.json" --source stocks_price --permissions "anonymous:read" add Tree --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Shrub --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" --rest plants add Fungus --config "dab-config.MySql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" add books_view_all --config "dab-config.MySql.json" --source books_view_all --permissions "anonymous:read" add stocks_view_selected --config "dab-config.MySql.json" --source stocks_view_selected --permissions "anonymous:read" @@ -20,6 +20,9 @@ add Empty --config "dab-config.MySql.json" --source "empty_table" --permissions add Notebook --config "dab-config.MySql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" add Journal --config "dab-config.MySql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" add ArtOfWar --config "dab-config.MySql.json" --source "aow" --rest true --permissions "anonymous:*" +add series --config "dab-config.MySql.json" --source "series" --permissions "anonymous:*" +add GetBooks --config "dab-config.MySql.json" --source "get_books" --source.type "stored-procedure" --permissions "anonymous:read" --rest true --graphql false +add GetBook --config "dab-config.MySql.json" --source "get_book_by_id" --source.type "stored-procedure" --permissions "anonymous:read" --rest true --graphql false update Publisher --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:create,delete" update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:update" --fields.include "*" @@ -36,7 +39,7 @@ update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_0 update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:create,delete" update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:update" --fields.include "*" update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Stock --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest commodities --graphql true update Book --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" update Book --config "dab-config.MySql.json" --relationship publishers --target.entity Publisher --cardinality one update Book --config "dab-config.MySql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one @@ -71,13 +74,14 @@ update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:del update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:read" --fields.include "*" update Review --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" update Review --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one -update Empty --config "dab-config.MsSql.json" --permissions "anonymous:read" +update Empty --config "dab-config.MySql.json" --permissions "anonymous:read" update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:create,update" --rest true --graphql true update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" update Author --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update WebsiteUser --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" update stocks_price --config "dab-config.MySql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Comic --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship series --target.entity series --cardinality one +update series --config "dab-config.MySql.json" --relationship comics --target.entity Comic --cardinality many update Broker --config "dab-config.MySql.json" --permissions "authenticated:create,update,read,delete" --graphql false update Tree --config "dab-config.MySql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" update Shrub --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" @@ -98,3 +102,5 @@ update Journal --config "dab-config.MySql.json" --permissions "policy_tester_upd update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" update Journal --config "dab-config.MySql.json" --permissions "authorizationHandlerTester:read" update ArtOfWar --config "dab-config.MySql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" +update GetBook --config "dab-config.MySql.json" --permissions "authenticated:*" +update GetBooks --config "dab-config.MySql.json" --permissions "authenticated:*" diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index f0ee2f5191..ff780c72fb 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -1,4 +1,4 @@ -init --config "dab-config.PostgreSql.json" --database-type mssql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000" +init --config "dab-config.PostgreSql.json" --database-type postgresql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000" add Publisher --config "dab-config.PostgreSql.json" --source publishers --permissions "anonymous:read" add Stock --config "dab-config.PostgreSql.json" --source stocks --permissions "anonymous:create,read,update" add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books" @@ -11,7 +11,7 @@ add WebsiteUser --config "dab-config.PostgreSql.json" --source website_users --p add SupportedType --config "dab-config.PostgreSql.json" --source type_table --permissions "anonymous:create,read,delete,update" add stocks_price --config "dab-config.PostgreSql.json" --source stocks_price --permissions "anonymous:read" add Tree --config "dab-config.PostgreSql.json" --source trees --permissions "anonymous:create,read,update,delete" -add Shrub --config "dab-config.PostgreSql.json" --source trees --permissions "anonymous:create,read,update,delete" +add Shrub --config "dab-config.PostgreSql.json" --source trees --permissions "anonymous:create,read,update,delete" --rest plants add Fungus --config "dab-config.PostgreSql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" add Empty --config "dab-config.PostgreSql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true add Notebook --config "dab-config.PostgreSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" @@ -33,7 +33,7 @@ update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tes update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:create,delete" update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:update" --fields.include "*" update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_06:read" --fields.include "*" --policy-database "@item.id eq 1940" -update Stock --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Stock --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest commodities --graphql true update Book --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" update Book --config "dab-config.PostgreSql.json" --relationship publishers --target.entity Publisher --cardinality one update Book --config "dab-config.PostgreSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one @@ -68,13 +68,14 @@ update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_0 update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:read" --fields.include "*" update Review --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" update Review --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one -update Empty --config "dab-config.MsSql.json" --permissions "anonymous:read" +update Empty --config "dab-config.PostgreSql.json" --permissions "anonymous:read" update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update" --rest true --graphql true update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:delete" --fields.include "*" --policy-database "@claims.id eq @item.id" update Author --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update WebsiteUser --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false --graphql "websiteUser:websiteUsers" update stocks_price --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,delete,update" --rest false -update Comic --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true +update Comic --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship series --target.entity series --cardinality one +update series --config "dab-config.PostgreSql.json" --relationship comics --target.entity Comic --cardinality many update Broker --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update,read,delete" --graphql false update Tree --config "dab-config.PostgreSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" update Shrub --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index 519f1be46e..0faec47e31 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -59,7 +59,6 @@ - From e09f97c0739b23c3cfb69f485d3d890d070a8d6e Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 16:31:11 +0530 Subject: [PATCH 61/89] updating file transform task in pipelines --- .pipelines/cosmos-pipelines.yml | 14 +++++++------- .pipelines/mssql-pipelines.yml | 30 +++++++++++++++--------------- .pipelines/mysql-pipelines.yml | 14 +++++++------- .pipelines/pg-pipelines.yml | 16 ++++++++-------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index 89bbdeb58e..fc6dad05ed 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -41,13 +41,6 @@ steps: feedsToUse: config nugetConfigPath: Nuget.config -- task: FileTransform@1.206.0 - displayName: 'Generate dab-config.Cosmos.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/Service/dab-config.Cosmos.json' - - task: DotNetCoreCLI@2 displayName: Build inputs: @@ -55,6 +48,13 @@ steps: projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need +- task: FileTransform@1.206.0 + displayName: 'Generate dab-config.Cosmos.json' + inputs: + folderPath: '$(System.DefaultWorkingDirectory)' + fileType: 'json' + targetFiles: 'src/out/tests/net6.0/dab-config.Cosmos.json' + - task: DotNetCoreCLI@2 displayName: 'Run Cosmos DB Integration Tests' inputs: diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index fbaee615a3..178c691809 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -44,13 +44,6 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu SQL Server Image Docker - - task: FileTransform@1.206.0 - displayName: 'Generate dab-config.MsSql.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/Service/dab-config.MsSql.json' - - task: DotNetCoreCLI@2 displayName: Build inputs: @@ -58,6 +51,13 @@ jobs: projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need + - task: FileTransform@1.206.0 + displayName: 'Generate dab-config.MsSql.json' + inputs: + folderPath: '$(System.DefaultWorkingDirectory)' + fileType: 'json' + targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' + - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' inputs: @@ -129,20 +129,20 @@ jobs: SqlLocalDb.exe start MSSQLLocalDB SqlLocalDb.exe info "MSSQLLocalDB" - - task: FileTransform@1.206.0 - displayName: 'Generate dab-config.MsSql.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/Service/dab-config.MsSql.json' - - task: DotNetCoreCLI@2 displayName: Build inputs: command: build projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - + + - task: FileTransform@1.206.0 + displayName: 'Generate dab-config.MsSql.json' + inputs: + folderPath: '$(System.DefaultWorkingDirectory)' + fileType: 'json' + targetFiles: 'src/out/tests/net6.0/dab-config.MsSql.json' + - task: DotNetCoreCLI@2 displayName: 'Run MsSql Integration Tests' inputs: diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index 72aa4de630..bbcef34260 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -48,19 +48,19 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu MySql Image Docker - - task: FileTransform@1.206.0 - displayName: 'Generate dab-config.MySql.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/Service/dab-config.MySql.json' - - task: DotNetCoreCLI@2 displayName: Build inputs: command: build projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need + + - task: FileTransform@1.206.0 + displayName: 'Generate dab-config.MySql.json' + inputs: + folderPath: '$(System.DefaultWorkingDirectory)' + fileType: 'json' + targetFiles: 'src/out/tests/net6.0/dab-config.MySql.json' - task: DotNetCoreCLI@2 displayName: 'Run MySql Integration Tests' diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 3ed216eb55..0257a12b80 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -44,20 +44,20 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Get and Start Ubuntu Postgres Image Docker - - task: FileTransform@1.206.0 - displayName: 'Generate dab-config.PostgreSql.json' - inputs: - folderPath: '$(System.DefaultWorkingDirectory)' - fileType: 'json' - targetFiles: 'src/Service/dab-config.PostgreSql.json' - - task: DotNetCoreCLI@2 displayName: Build inputs: command: build projects: '**/*.csproj' arguments: '--configuration $(buildConfiguration)' # Update this to match your need - + + - task: FileTransform@1.206.0 + displayName: 'Generate dab-config.PostgreSql.json' + inputs: + folderPath: '$(System.DefaultWorkingDirectory)' + fileType: 'json' + targetFiles: 'src/out/tests/net6.0/dab-config.PostgreSql.json' + - task: DotNetCoreCLI@2 displayName: 'Run Postgres Integration Tests' inputs: From fbcf1345893cfe2b6fed9e369261e49e83a3fe2e Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 17:13:34 +0530 Subject: [PATCH 62/89] updating review entity commands --- MsSqlCommands.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MsSqlCommands.txt b/MsSqlCommands.txt index c14c6682c8..5a04cd7e99 100644 --- a/MsSqlCommands.txt +++ b/MsSqlCommands.txt @@ -4,7 +4,7 @@ add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonym add Book --config "dab-config.MsSql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books" add BookWebsitePlacement --config "dab-config.MsSql.json" --source book_website_placements --permissions "anonymous:read" add Author --config "dab-config.MsSql.json" --source authors --permissions "anonymous:read" -add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:create,read,update" --rest false --graphql "review:reviews" +add Review --config "dab-config.MsSql.json" --source reviews --permissions "anonymous:create,read,update" --rest true --graphql "review:reviews" add Comic --config "dab-config.MsSql.json" --source comics --permissions "anonymous:create,read,update" add Broker --config "dab-config.MsSql.json" --source brokers --permissions "anonymous:read" add WebsiteUser --config "dab-config.MsSql.json" --source website_users --permissions "anonymous:create,read,delete,update" From e9d3d8efc2d534b408d96d785828f63df8bc717c Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 17:35:23 +0530 Subject: [PATCH 63/89] updating review entity in mysql and pgsql commands --- MySqlCommands.txt | 2 +- PostgreSqlCommands.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MySqlCommands.txt b/MySqlCommands.txt index 7a1ab45545..378abb688f 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -72,7 +72,7 @@ update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:cre update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.MySql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Review --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql review:reviews update Review --config "dab-config.MySql.json" --relationship books --target.entity Book --cardinality one update Empty --config "dab-config.MySql.json" --permissions "anonymous:read" update BookWebsitePlacement --config "dab-config.MySql.json" --permissions "authenticated:create,update" --rest true --graphql true diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index ff780c72fb..c80ca06c20 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -66,7 +66,7 @@ update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_0 update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:update" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:delete" --fields.include "*" --policy-database "@item.id eq 9" update Book --config "dab-config.PostgreSql.json" --permissions "policy_tester_08:read" --fields.include "*" -update Review --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" +update Review --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql review:reviews update Review --config "dab-config.PostgreSql.json" --relationship books --target.entity Book --cardinality one update Empty --config "dab-config.PostgreSql.json" --permissions "anonymous:read" update BookWebsitePlacement --config "dab-config.PostgreSql.json" --permissions "authenticated:create,update" --rest true --graphql true From 7d7690f0132e37e1a6296ed573bc00894951c7d4 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 17:52:22 +0530 Subject: [PATCH 64/89] updating pgsql command --- PostgreSqlCommands.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/PostgreSqlCommands.txt b/PostgreSqlCommands.txt index c80ca06c20..08475bf737 100644 --- a/PostgreSqlCommands.txt +++ b/PostgreSqlCommands.txt @@ -17,6 +17,7 @@ add Empty --config "dab-config.PostgreSql.json" --source "empty_table" --permiss add Notebook --config "dab-config.PostgreSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" add Journal --config "dab-config.PostgreSql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" add ArtOfWar --config "dab-config.PostgreSql.json" --source "aow" --rest true --permissions "anonymous:*" +add series --config "dab-config.PostgreSql.json" --source "series" --permissions "anonymous:*" update Publisher --config "dab-config.PostgreSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:create,delete" update Publisher --config "dab-config.PostgreSql.json" --permissions "policy_tester_01:update" --fields.include "*" From d1ff3cba54222d69bc0898096573730948ddddcd Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 18:22:27 +0530 Subject: [PATCH 65/89] removing stored-procedure commands for mysql --- MySqlCommands.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/MySqlCommands.txt b/MySqlCommands.txt index 378abb688f..fcec24b02f 100644 --- a/MySqlCommands.txt +++ b/MySqlCommands.txt @@ -21,8 +21,6 @@ add Notebook --config "dab-config.MySql.json" --source "notebooks" --permissions add Journal --config "dab-config.MySql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" add ArtOfWar --config "dab-config.MySql.json" --source "aow" --rest true --permissions "anonymous:*" add series --config "dab-config.MySql.json" --source "series" --permissions "anonymous:*" -add GetBooks --config "dab-config.MySql.json" --source "get_books" --source.type "stored-procedure" --permissions "anonymous:read" --rest true --graphql false -add GetBook --config "dab-config.MySql.json" --source "get_book_by_id" --source.type "stored-procedure" --permissions "anonymous:read" --rest true --graphql false update Publisher --config "dab-config.MySql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:create,delete" update Publisher --config "dab-config.MySql.json" --permissions "policy_tester_01:update" --fields.include "*" @@ -102,5 +100,3 @@ update Journal --config "dab-config.MySql.json" --permissions "policy_tester_upd update Journal --config "dab-config.MySql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" update Journal --config "dab-config.MySql.json" --permissions "authorizationHandlerTester:read" update ArtOfWar --config "dab-config.MySql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" -update GetBook --config "dab-config.MySql.json" --permissions "authenticated:*" -update GetBooks --config "dab-config.MySql.json" --permissions "authenticated:*" From 46cf150e92231291b4a02b395cb504bf87567dbb Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 19:17:53 +0530 Subject: [PATCH 66/89] moving commads to a folder, removing copy files task --- .pipelines/build-pipelines.yml | 4 ++-- CosmosCommands.txt => CommandFiles/CosmosCommands.txt | 0 MsSqlCommands.txt => CommandFiles/MsSqlCommands.txt | 0 MySqlCommands.txt => CommandFiles/MySqlCommands.txt | 0 .../PostgreSqlCommands.txt | 0 src/Cli/src/Cli.csproj | 8 ++++---- src/Service/Azure.DataApiBuilder.Service.csproj | 5 ++--- 7 files changed, 8 insertions(+), 9 deletions(-) rename CosmosCommands.txt => CommandFiles/CosmosCommands.txt (100%) rename MsSqlCommands.txt => CommandFiles/MsSqlCommands.txt (100%) rename MySqlCommands.txt => CommandFiles/MySqlCommands.txt (100%) rename PostgreSqlCommands.txt => CommandFiles/PostgreSqlCommands.txt (100%) diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index 16dd57b948..e928d6ccb5 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -79,7 +79,7 @@ steps: inputs: command: test projects: '**/*Tests*.csproj' - arguments: '--filter "TestCategory!=Cosmos&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' + arguments: '--no-build --filter "TestCategory!=Cosmos&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' - template: templates/code-signing.yml parameters: @@ -94,7 +94,7 @@ steps: command: custom custom: pack projects: '**/Cli.csproj' - arguments: '--configuration $(buildConfiguration) --no-build -p:Version=$(dabVersion) -o $(Build.ArtifactStagingDirectory)/nupkg' + arguments: '--configuration $(buildConfiguration) -p:Version=$(dabVersion) -o $(Build.ArtifactStagingDirectory)/nupkg' # Now sign the nuget package itself. - template: templates/code-signing.yml diff --git a/CosmosCommands.txt b/CommandFiles/CosmosCommands.txt similarity index 100% rename from CosmosCommands.txt rename to CommandFiles/CosmosCommands.txt diff --git a/MsSqlCommands.txt b/CommandFiles/MsSqlCommands.txt similarity index 100% rename from MsSqlCommands.txt rename to CommandFiles/MsSqlCommands.txt diff --git a/MySqlCommands.txt b/CommandFiles/MySqlCommands.txt similarity index 100% rename from MySqlCommands.txt rename to CommandFiles/MySqlCommands.txt diff --git a/PostgreSqlCommands.txt b/CommandFiles/PostgreSqlCommands.txt similarity index 100% rename from PostgreSqlCommands.txt rename to CommandFiles/PostgreSqlCommands.txt diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index 0faec47e31..656d171e35 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -34,19 +34,19 @@ $(BaseOutputPath)$(Configuration)\$(TargetFramework)\dab.dll - + - + - + - + diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index ddc43e67eb..fdb2dc11b3 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -35,9 +35,6 @@ $(CopyToOutputDirectoryAction) - - $(CopyToOutputDirectoryAction) - $(CopyToOutputDirectoryAction) @@ -80,6 +77,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -89,4 +87,5 @@ + \ No newline at end of file From 5982dfdfadddae49d66246818f1271064ee1bc5a Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 19:29:46 +0530 Subject: [PATCH 67/89] adding empty line at end, deleting scripts, deleting checked-in config files --- .pipelines/build-pipelines.yml | 12 +- configGenerator.ps1 | 34 - configGenerator.sh | 32 - .../Azure.DataApiBuilder.Service.csproj | 2 +- src/Service/dab-config.Cosmos.json | 91 -- src/Service/dab-config.MsSql.json | 879 ------------------ src/Service/dab-config.MySql.json | 872 ----------------- src/Service/dab-config.PostgreSql.json | 821 ---------------- src/Service/dab-config.json | 690 +++++++------- 9 files changed, 352 insertions(+), 3081 deletions(-) delete mode 100644 configGenerator.ps1 delete mode 100644 configGenerator.sh delete mode 100644 src/Service/dab-config.Cosmos.json delete mode 100644 src/Service/dab-config.MsSql.json delete mode 100644 src/Service/dab-config.MySql.json delete mode 100644 src/Service/dab-config.PostgreSql.json diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index e928d6ccb5..8814c15eea 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -24,9 +24,9 @@ steps: - task: NuGetAuthenticate@1 displayName: 'NuGet Authenticate' -# If this is a release, do not append the build number at the end as it will +# If this is a release, do not append the build number at the end as it will # generate the prerelease nuget version. -# We cannot set this in variables section above because $(isNugetRelease) +# We cannot set this in variables section above because $(isNugetRelease) # is not available at pipeline compilation time. - bash: | echo ISNUGETRELEASE = $ISNUGETRELEASE @@ -72,7 +72,7 @@ steps: command: custom custom: pack projects: '**/*.sln' - arguments: '--configuration $(buildConfiguration) -p:Version=$(dabVersion)' + arguments: '--configuration $(buildConfiguration) -p:Version=$(dabVersion)' - task: DotNetCoreCLI@2 displayName: "Run Unit Tests" @@ -85,7 +85,7 @@ steps: parameters: # This is the path that will be used for packing nuget package. # We will need to sign the binaries in this location. - path: '$(Build.SourcesDirectory)/src/out/cli/$(buildConfiguration)/net6.0/publish' + path: '$(Build.SourcesDirectory)/src/out/cli/$(buildConfiguration)/net6.0/publish' # Create nuget package after the binaries are signed. So that the binaries inside nuget package are signed. - task: DotNetCoreCLI@2 @@ -94,7 +94,7 @@ steps: command: custom custom: pack projects: '**/Cli.csproj' - arguments: '--configuration $(buildConfiguration) -p:Version=$(dabVersion) -o $(Build.ArtifactStagingDirectory)/nupkg' + arguments: '--configuration $(buildConfiguration) --no-build -p:Version=$(dabVersion) -o $(Build.ArtifactStagingDirectory)/nupkg' # Now sign the nuget package itself. - template: templates/code-signing.yml @@ -147,7 +147,7 @@ steps: - task: PublishPipelineArtifact@1 displayName: "Upload build artifacts" inputs: - targetPath: '$(Build.ArtifactStagingDirectory)' + targetPath: '$(Build.ArtifactStagingDirectory)' - task: NuGetCommand@2 displayName: 'Publish Nuget to Internal Feed' diff --git a/configGenerator.ps1 b/configGenerator.ps1 deleted file mode 100644 index 81b9a41113..0000000000 --- a/configGenerator.ps1 +++ /dev/null @@ -1,34 +0,0 @@ -$PSDefaultParameterValues['*:Encoding'] = 'utf8'; - -$commandFiles = "MsSqlCommands.txt", "MySqlCommands.txt", "PostgreSqlCommands.txt", "CosmosCommands.txt"; - -$workingDirectory = $PSScriptRoot + "\src\Service\"; -# During start-up engine looks for config files inside /src/Service directory. -Set-Location $workingDirectory; - -$configFiles = "dab-config.MsSql.json", "dab-config.MySql.json", "dab-config.PostgreSql.json", "dab-config.Cosmos.json"; - -#Deleting files with same name if they exist -foreach($configFile in $configFiles) -{ - if(Test-Path $configFile) - { - Remove-Item $configFile; - } -} - -$cliBuildOutputPath = $PSScriptRoot + "\src\out\cli\"; - -#Fetching the absolute path of dab.dll from build output directory -$pathToDabDLL = Get-ChildItem -Path $cliBuildOutputPath -Recurse -include "dab.dll" | ForEach-Object{$_.FullName}; - -foreach($file in $commandFiles) -{ - $commandsFileWithPath = $PSScriptRoot + "\" + $file; - - # Generating the config files using dab commands - foreach($command in Get-Content $commandsFileWithPath){ - $commandToExecute = "dotnet " + $pathToDabDLL + " " + $command; - Invoke-Expression $commandToExecute; - } -} \ No newline at end of file diff --git a/configGenerator.sh b/configGenerator.sh deleted file mode 100644 index b45ee8b15a..0000000000 --- a/configGenerator.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -commandFiles=("MsSqlCommands.txt" "MySqlCommands.txt" "PostgreSqlCommands.txt" "CosmosCommands.txt") -#Fetching absolute path of this script -absolutePath="$( cd "$(dirname "$0")" ; pwd -P )"; -cliOutputPath="$absolutePath/src/out/cli"; -#Fetching the path of dab dll file -pathToDLL=$(find $cliOutputPath -name dab.dll) -workingDirectory="$absolutePath/src/Service/" - -configFiles=("dab-config.MsSql.json" "dab-config.MySql.json" "dab-config.PostgreSql.json" "dab-config.Cosmos.json") - -# During start-up engine looks for config files inside /src/Service directory. -cd $workingDirectory; - -# Deleting existing config files -for configFile in "${configFiles[@]}" -do - if test -f "$configFile"; then - eval "rm ${configFile}" - fi -done - -# Generating the config using dab commands -echo "Generating config file using dab commands"; -for file in "${commandFiles[@]}" -do - commandsFileNameWithPath="$absolutePath/$file"; - while read -r command; do - command="dotnet ${pathToDLL} ${command}"; - eval $command; - done <$commandsFileNameWithPath; -done \ No newline at end of file diff --git a/src/Service/Azure.DataApiBuilder.Service.csproj b/src/Service/Azure.DataApiBuilder.Service.csproj index fdb2dc11b3..dec888a1fe 100644 --- a/src/Service/Azure.DataApiBuilder.Service.csproj +++ b/src/Service/Azure.DataApiBuilder.Service.csproj @@ -88,4 +88,4 @@ - \ No newline at end of file + diff --git a/src/Service/dab-config.Cosmos.json b/src/Service/dab-config.Cosmos.json deleted file mode 100644 index 04e639598f..0000000000 --- a/src/Service/dab-config.Cosmos.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "cosmos", - "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" - }, - "cosmos": { - "database": "graphqldb", - "container": "planet", - "schema": "schema.gql" - }, - "runtime": { - "rest": { - "enabled": false - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "authenticate-devmode-requests": false, - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Planet": { - "source": "graphqldb.planet", - "rest": false, - "graphql": { - "type": { - "singular": "Planet", - "plural": "Planets" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Character": { - "source": "graphqldb.character", - "rest": false, - "graphql": { - "type": { - "singular": "Character", - "plural": "Characters" - } - }, - "permissions": [ - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Star": { - "source": "graphqldb.star", - "rest": false, - "graphql": { - "type": { - "singular": "Star", - "plural": "Stars" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - } - } - } \ No newline at end of file diff --git a/src/Service/dab-config.MsSql.json b/src/Service/dab-config.MsSql.json deleted file mode 100644 index c0dfcb3985..0000000000 --- a/src/Service/dab-config.MsSql.json +++ /dev/null @@ -1,879 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "mssql", - "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" - }, - "mssql": { - "set-session-context": false - }, - "runtime": { - "rest": { - "path": "/api" - }, - "graphql": { - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "authenticate-devmode-requests": false, - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": { - "path": "commodities" - }, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Book": { - "source": "books", - "graphql": { - "type": { - "singular": "book", - "plural": "books" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_05", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 10" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_07", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - } - ] - }, - { - "role": "policy_tester_08", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "graphql": { - "type": { - "singular": "review", - "plural": "reviews" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "series": { - "cardinality": "one", - "target.entity": "series" - } - } - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "graphql": { - "type": { - "singular": "websiteUser", - "plural": "websiteUsers" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": { - "path": "plants" - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "graphql": { - "type": { - "singular": "fungus", - "plural": "fungi" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.region ne 'northeast'" - } - } - ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Notebook": { - "source": "notebooks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - "create", - "update", - "delete" - ] - } - ] - }, - "Journal": { - "source": "journals", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "policy_tester_noupdate", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - "delete" - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - } - ] - }, - { - "role": "authorizationHandlerTester", - "actions": [ "read" ] - } - ] - }, - "books_view_all": { - "source": "books_view_all", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "stocks_view_selected": { - "source": "stocks_view_selected", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "books_publishers_view_composite": { - "source": "books_publishers_view_composite", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "ArtOfWar": { - "source": "aow", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ], - "mappings": { - "DetailAssessmentAndPlanning": "始計", - "WagingWar": "作戰", - "StrategicAttack": "謀攻", - "NoteNum": "┬─┬ノ( º _ ºノ)" - } - }, - "series": { - "source": "series", - "permissions": [ - { - "role": "anonymous", - "actions": [ - "*" - ] - } - ], - "relationships": { - "comics": { - "cardinality": "many", - "target.entity": "Comic" - } - } - }, - "GetBooks": { - "source": { - "type": "stored-procedure", - "object": "get_books" - }, - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ] - }, - "GetBook": { - "source": { - "type": "stored-procedure", - "object": "get_book_by_id" - }, - "rest": true, - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ] - } - } - } \ No newline at end of file diff --git a/src/Service/dab-config.MySql.json b/src/Service/dab-config.MySql.json deleted file mode 100644 index dde42c620b..0000000000 --- a/src/Service/dab-config.MySql.json +++ /dev/null @@ -1,872 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "mysql", - "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "authenticate-devmode-requests": false, - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": { - "path": "commodities" - }, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Book": { - "source": "books", - "graphql": { - "type": { - "singular": "book", - "plural": "books" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_05", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 10" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_07", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - } - ] - }, - { - "role": "policy_tester_08", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "graphql": { - "type": { - "singular": "review", - "plural": "reviews" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "series": { - "cardinality": "one", - "target.entity": "series" - } - } - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "graphql": { - "type": { - "singular": "websiteUser", - "plural": "websiteUsers" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": { - "path": "plants" - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "graphql": { - "type": { - "singular": "fungus", - "plural": "fungi" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.region ne 'northeast'" - } - } - ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Notebook": { - "source": "notebooks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - "create", - "update", - "delete" - ] - } - ] - }, - "Journal": { - "source": "journals", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "policy_tester_noupdate", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - "delete" - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - } - ] - }, - { - "role": "authorizationHandlerTester", - "actions": [ "read" ] - } - ] - }, - "books_view_all": { - "source": "books_view_all", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "stocks_view_selected": { - "source": "stocks_view_selected", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "books_publishers_view_composite": { - "source": "books_publishers_view_composite", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - } - }, - "ArtOfWar": { - "source": "aow", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ], - "mappings": { - "DetailAssessmentAndPlanning": "始計", - "WagingWar": "作戰", - "StrategicAttack": "謀攻", - "NoteNum": "┬─┬ノ( º _ ºノ)" - } - }, - "series": { - "source": "series", - "permissions": [ - { - "role": "anonymous", - "actions": [ - "*" - ] - } - ], - "relationships": { - "comics": { - "cardinality": "many", - "target.entity": "Comic" - } - } - } - } - } \ No newline at end of file diff --git a/src/Service/dab-config.PostgreSql.json b/src/Service/dab-config.PostgreSql.json deleted file mode 100644 index c55049c034..0000000000 --- a/src/Service/dab-config.PostgreSql.json +++ /dev/null @@ -1,821 +0,0 @@ -{ - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "postgresql", - "connection-string": "DO NOT EDIT, look at CONTRIBUTING.md on how to run tests" - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" - }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "authenticate-devmode-requests": false, - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false - }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1940" - } - }, - "delete" - ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" - } - } - }, - "Stock": { - "source": "stocks", - "rest": { - "path": "commodities" - }, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Book": { - "source": "books", - "graphql": { - "type": { - "singular": "book", - "plural": "books" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_02", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_03", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title eq 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_04", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.title ne 'Policy-Test-01'" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_05", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_06", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 10" - } - }, - "delete" - ] - }, - { - "role": "policy_tester_07", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 9" - } - } - ] - }, - { - "role": "policy_tester_08", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 9" - } - } - ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" - }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] - } - }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ] - } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "graphql": { - "type": { - "singular": "review", - "plural": "reviews" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "series": { - "cardinality": "one", - "target.entity": "series" - } - } - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "graphql": { - "type": { - "singular": "websiteUser", - "plural": "websiteUsers" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": { - "path": "plants" - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "graphql": { - "type": { - "singular": "fungus", - "plural": "fungi" - } - }, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "policy_tester_01", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.region ne 'northeast'" - } - } - ] - } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Notebook": { - "source": "notebooks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ - { - "action": "read", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - "create", - "update", - "delete" - ] - } - ] - }, - "Journal": { - "source": "journals", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "policy_tester_noupdate", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id ne 1" - } - }, - { - "action": "read", - "fields": { - "include": [ "*" ] - } - }, - "delete" - ] - }, - { - "role": "policy_tester_update_noread", - "actions": [ - "create", - { - "action": "update", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - }, - { - "action": "read", - "fields": { - "exclude": [ "*" ] - } - }, - { - "action": "delete", - "fields": { - "include": [ "*" ] - }, - "policy": { - "database": "@item.id eq 1" - } - } - ] - }, - { - "role": "authorizationHandlerTester", - "actions": [ "read" ] - } - ] - }, - "ArtOfWar": { - "source": "aow", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "*" ] - }, - { - "role": "authenticated", - "actions": [ "*" ] - } - ], - "mappings": { - "DetailAssessmentAndPlanning": "始計", - "WagingWar": "作戰", - "StrategicAttack": "謀攻", - "NoteNum": "┬─┬ノ( º _ ºノ)" - } - }, - "series": { - "source": "series", - "permissions": [ - { - "role": "anonymous", - "actions": [ - "*" - ] - } - ], - "relationships": { - "comics": { - "cardinality": "many", - "target.entity": "Comic" - } - } - } - } - } \ No newline at end of file diff --git a/src/Service/dab-config.json b/src/Service/dab-config.json index a2a2bfab01..5ff170ec03 100644 --- a/src/Service/dab-config.json +++ b/src/Service/dab-config.json @@ -1,368 +1,368 @@ { - "$schema": "../schemas/dab.draft-01.schema.json", - "data-source": { - "database-type": "mssql", - "connection-string": "" - }, - "runtime": { - "rest": { - "enabled": true, - "path": "/api" + "$schema": "../schemas/dab.draft-01.schema.json", + "data-source": { + "database-type": "mssql", + "connection-string": "" }, - "graphql": { - "enabled": true, - "path": "/graphql", - "allow-introspection": true - }, - "host": { - "mode": "development", - "cors": { - "origins": [ "http://localhost:5000" ], - "allow-credentials": false + "runtime": { + "rest": { + "enabled": true, + "path": "/api" }, - "authentication": { - "provider": "StaticWebApps" - } - } - }, - "entities": { - "Publisher": { - "source": "publishers", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] + "graphql": { + "enabled": true, + "path": "/graphql", + "allow-introspection": true + }, + "host": { + "mode": "development", + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book" + "authentication": { + "provider": "StaticWebApps" } } }, - "Stock": { - "source": "stocks", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] + "entities": { + "Publisher": { + "source": "publishers", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book" + } } - ] - }, - "Book": { - "source": "books", - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "publishers": { - "cardinality": "one", - "target.entity": "Publisher" - }, - "websiteplacement": { - "cardinality": "one", - "target.entity": "BookWebsitePlacement" - }, - "reviews": { - "cardinality": "many", - "target.entity": "Review" + }, + "Stock": { + "source": "stocks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Book": { + "source": "books", + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "publishers": { + "cardinality": "one", + "target.entity": "Publisher" + }, + "websiteplacement": { + "cardinality": "one", + "target.entity": "BookWebsitePlacement" + }, + "reviews": { + "cardinality": "many", + "target.entity": "Review" + }, + "authors": { + "cardinality": "many", + "target.entity": "Author", + "linking.object": "book_author_link", + "linking.source.fields": [ "book_id" ], + "linking.target.fields": [ "author_id" ] + } }, - "authors": { - "cardinality": "many", - "target.entity": "Author", - "linking.object": "book_author_link", - "linking.source.fields": [ "book_id" ], - "linking.target.fields": [ "author_id" ] + "mappings": { + "id": "id", + "title": "title" } }, - "mappings": { - "id": "id", - "title": "title" - } - }, - "BookWebsitePlacement": { - "source": "book_website_placements", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ - "create", - "update", - { - "action": "delete", - "policy": { - "database": "@claims.id eq @item.id" - }, - "fields": { - "include": [ "*" ], - "exclude": [ "id" ] + "BookWebsitePlacement": { + "source": "book_website_placements", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "update", + { + "action": "delete", + "policy": { + "database": "@claims.id eq @item.id" + }, + "fields": { + "include": [ "*" ], + "exclude": [ "id" ] + } } - } - ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" - } - } - }, - "Author": { - "source": "authors", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "many", - "target.entity": "Book", - "linking.object": "book_author_link" - } - } - }, - "Review": { - "source": "reviews", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ], - "relationships": { - "books": { - "cardinality": "one", - "target.entity": "Book" + ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } } - } - }, - "Comic": { - "source": "comics", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "Broker": { - "source": "brokers", - "graphql": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "WebsiteUser": { - "source": "website_users", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "SupportedType": { - "source": "type_table", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] - } - ] - }, - "stocks_price": { - "source": "stocks_price", - "rest": false, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] + }, + "Author": { + "source": "authors", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book", + "linking.object": "book_author_link" + } } - ] - }, - "Tree": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] + }, + "Review": { + "source": "reviews", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } - }, - "Shrub": { - "source": "trees", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] + }, + "Comic": { + "source": "comics", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Broker": { + "source": "brokers", + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "WebsiteUser": { + "source": "website_users", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "SupportedType": { + "source": "type_table", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "stocks_price": { + "source": "stocks_price", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Tree": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "Scientific Name", + "region": "United State's Region" } - ], - "mappings": { - "species": "fancyName" - } - }, - "Fungus": { - "source": "fungi", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] + }, + "Shrub": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "fancyName" } - ], - "mappings": { - "spores": "hazards" - } - }, - "Empty": { - "source": "empty_table", - "rest": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "create", "read", "update", "delete" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] + }, + "Fungus": { + "source": "fungi", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "spores": "hazards" } - ] - }, - "books_view_all": { - "source": "books_view_all", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] + }, + "Empty": { + "source": "empty_table", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "books_view_all": { + "source": "books_view_all", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { } - ], - "relationships": { - } - }, - "stocks_view_selected": { - "source": "stocks_view_selected", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] + }, + "stocks_view_selected": { + "source": "stocks_view_selected", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { } - ], - "relationships": { - } - }, - "books_publishers_view_composite": { - "source": "books_publishers_view_composite", - "rest": true, - "graphql": true, - "permissions": [ - { - "role": "anonymous", - "actions": [ "read" ] - }, - { - "role": "authenticated", - "actions": [ "create", "read", "update", "delete" ] + }, + "books_publishers_view_composite": { + "source": "books_publishers_view_composite", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { } - ], - "relationships": { } } - } -} + } \ No newline at end of file From edb76bbae3b43017db9450c63479df0d4db1d709 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 19:45:04 +0530 Subject: [PATCH 68/89] removing no-build arguement in unit tests --- .pipelines/build-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index 8814c15eea..087082f413 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -79,7 +79,7 @@ steps: inputs: command: test projects: '**/*Tests*.csproj' - arguments: '--no-build --filter "TestCategory!=Cosmos&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' + arguments: '--filter "TestCategory!=Cosmos&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' - template: templates/code-signing.yml parameters: From a5a2e6eb7998a9607e1e46f8dce33e0057a5128d Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 20:01:36 +0530 Subject: [PATCH 69/89] adding --no-build to unit tests --- .pipelines/build-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index 3d9389a034..ba6797716b 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -87,7 +87,7 @@ steps: inputs: command: test projects: '**/*Tests*.csproj' - arguments: '--filter "TestCategory!=Cosmos&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' + arguments: '--no-build --filter "TestCategory!=Cosmos&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' - template: templates/code-signing.yml parameters: @@ -232,4 +232,4 @@ steps: tags: | $(BuildDate)-$(Build.SourceVersion) $(releaseName) - $(dabVersion) + $(dabVersion) \ No newline at end of file From c8591b6dece6dc9aa995426946dd4be5bc99e8ea Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 20:24:56 +0530 Subject: [PATCH 70/89] removing --no-build arguement --- .pipelines/build-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index ba6797716b..9eb93a6d74 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -87,7 +87,7 @@ steps: inputs: command: test projects: '**/*Tests*.csproj' - arguments: '--no-build --filter "TestCategory!=Cosmos&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' + arguments: '--filter "TestCategory!=Cosmos&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"' - template: templates/code-signing.yml parameters: From b9a4f6ad915fb3411ec4877458ab12111bb61d02 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 21:27:52 +0530 Subject: [PATCH 71/89] adding empty line at the end --- .pipelines/build-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index 9eb93a6d74..3d9389a034 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -232,4 +232,4 @@ steps: tags: | $(BuildDate)-$(Build.SourceVersion) $(releaseName) - $(dabVersion) \ No newline at end of file + $(dabVersion) From 46df057a3223788247f92cd00470661057a6d1c0 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 13 Oct 2022 22:26:46 +0530 Subject: [PATCH 72/89] adding empty line at the end for dab-config.json file --- src/Service/dab-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/dab-config.json b/src/Service/dab-config.json index 5ff170ec03..3cb7707197 100644 --- a/src/Service/dab-config.json +++ b/src/Service/dab-config.json @@ -365,4 +365,4 @@ } } } - } \ No newline at end of file + } From be46369d695dfb757edbb5c99e8f4941c6d6740a Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 12:40:04 +0530 Subject: [PATCH 73/89] adding powershell script --- .../CosmosCommands.txt | 0 .../MsSqlCommands.txt | 6 +- .../MySqlCommands.txt | 6 +- .../PostgreSqlCommands.txt | 0 ConfigGenerators/configGenerator.ps1 | 57 +++++++++++++++++++ 5 files changed, 63 insertions(+), 6 deletions(-) rename {CommandFiles => ConfigGenerators}/CosmosCommands.txt (100%) rename {CommandFiles => ConfigGenerators}/MsSqlCommands.txt (98%) rename {CommandFiles => ConfigGenerators}/MySqlCommands.txt (97%) rename {CommandFiles => ConfigGenerators}/PostgreSqlCommands.txt (100%) create mode 100644 ConfigGenerators/configGenerator.ps1 diff --git a/CommandFiles/CosmosCommands.txt b/ConfigGenerators/CosmosCommands.txt similarity index 100% rename from CommandFiles/CosmosCommands.txt rename to ConfigGenerators/CosmosCommands.txt diff --git a/CommandFiles/MsSqlCommands.txt b/ConfigGenerators/MsSqlCommands.txt similarity index 98% rename from CommandFiles/MsSqlCommands.txt rename to ConfigGenerators/MsSqlCommands.txt index 5a04cd7e99..ece3cac90b 100644 --- a/CommandFiles/MsSqlCommands.txt +++ b/ConfigGenerators/MsSqlCommands.txt @@ -13,9 +13,9 @@ add stocks_price --config "dab-config.MsSql.json" --source stocks_price --permis add Tree --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" add Shrub --config "dab-config.MsSql.json" --source trees --permissions "anonymous:create,read,update,delete" --rest plants add Fungus --config "dab-config.MsSql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" -add books_view_all --config "dab-config.MsSql.json" --source books_view_all --permissions "anonymous:read" -add stocks_view_selected --config "dab-config.MsSql.json" --source stocks_view_selected --permissions "anonymous:read" -add books_publishers_view_composite --config "dab-config.MsSql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +add books_view_all --config "dab-config.MsSql.json" --source books_view_all --source.type "view" --permissions "anonymous:read" +add stocks_view_selected --config "dab-config.MsSql.json" --source stocks_view_selected --source.type "view" --permissions "anonymous:read" +add books_publishers_view_composite --config "dab-config.MsSql.json" --source books_publishers_view_composite --source.type "view" --permissions "anonymous:read" --rest true --graphql true add Empty --config "dab-config.MsSql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true add Notebook --config "dab-config.MsSql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" add Journal --config "dab-config.MsSql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" diff --git a/CommandFiles/MySqlCommands.txt b/ConfigGenerators/MySqlCommands.txt similarity index 97% rename from CommandFiles/MySqlCommands.txt rename to ConfigGenerators/MySqlCommands.txt index fcec24b02f..c6406e9a54 100644 --- a/CommandFiles/MySqlCommands.txt +++ b/ConfigGenerators/MySqlCommands.txt @@ -13,9 +13,9 @@ add stocks_price --config "dab-config.MySql.json" --source stocks_price --permis add Tree --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" add Shrub --config "dab-config.MySql.json" --source trees --permissions "anonymous:create,read,update,delete" --rest plants add Fungus --config "dab-config.MySql.json" --source fungi --permissions "anonymous:create,read,update,delete" --graphql "fungus:fungi" -add books_view_all --config "dab-config.MySql.json" --source books_view_all --permissions "anonymous:read" -add stocks_view_selected --config "dab-config.MySql.json" --source stocks_view_selected --permissions "anonymous:read" -add books_publishers_view_composite --config "dab-config.MySql.json" --source books_publishers_view_composite --permissions "anonymous:read" --rest true --graphql true +add books_view_all --config "dab-config.MySql.json" --source books_view_all --source.type "view" --permissions "anonymous:read" +add stocks_view_selected --config "dab-config.MySql.json" --source stocks_view_selected --source.type "view" --permissions "anonymous:read" +add books_publishers_view_composite --config "dab-config.MySql.json" --source books_publishers_view_composite --source.type "view" --permissions "anonymous:read" --rest true --graphql true add Empty --config "dab-config.MySql.json" --source "empty_table" --permissions "authenticated:create,read,update,delete" --rest true add Notebook --config "dab-config.MySql.json" --source "notebooks" --permissions "anonymous:read" --rest true --graphql true --fields.include "*" --policy-database "@item ne 1" add Journal --config "dab-config.MySql.json" --source "journals" --rest true --graphql true --permissions "policy_tester_noupdate:create,delete" diff --git a/CommandFiles/PostgreSqlCommands.txt b/ConfigGenerators/PostgreSqlCommands.txt similarity index 100% rename from CommandFiles/PostgreSqlCommands.txt rename to ConfigGenerators/PostgreSqlCommands.txt diff --git a/ConfigGenerators/configGenerator.ps1 b/ConfigGenerators/configGenerator.ps1 new file mode 100644 index 0000000000..f10a75c076 --- /dev/null +++ b/ConfigGenerators/configGenerator.ps1 @@ -0,0 +1,57 @@ +$PSDefaultParameterValues['*:Encoding'] = 'utf8'; + +$databaseTypes = @(); +if($args.Count -eq 0){ + $databaseTypes = "MsSql", "MySql", "PostgreSql", "Cosmos"; +} +elseif($args.Count -eq 1){ + $databaseType = $args[0]; + if(-not( ($databaseType -eq "MsSql") -or ($databaseType -eq "MySql") -or ($databaseType -eq "PostgreSql") -or ($databaseType -eq "Cosmos"))){ + throw "Valid arguements are MsSql, Mysql, PostgreSql or Cosmos"; + } + $databaseTypes += $databaseType; +} +else{ + throw "Please run with 0 or 1 arguements"; +} + +$cliBuildOutputPath = $PSScriptRoot + "\..\src\out\cli\"; + +$commandsFilesBasePath = $PSScriptRoot; + +#Fetching the absolute path of dab.dll from build output directory +$pathToDabDLL = Get-ChildItem -Path $cliBuildOutputPath -Recurse -include "dab.dll" | ForEach-Object{$_.FullName}; + +$workingDirectory = $PSScriptRoot + "\..\src\Service\"; +Set-Location $workingDirectory; + +foreach($databaseType in $databaseTypes){ + if($databaseType -eq "MsSql"){ + $commandFile = "MsSqlCommands.txt"; + $configFile = "dab-config.MsSql.json"; + } + elseif($databaseType -eq "MySql"){ + $commandFile = "MySqlCommands.txt"; + $configFile = "dab-config.MySql.json"; + } + elseif($databaseType -eq "PostgreSql"){ + $commandFile = "PostgreSqlCommands.txt"; + $configFile = "dab-config.PostgreSql.json"; + } + else{ + $commandFile = "CosmosCommands.txt"; + $configFile = "dab-config.Cosmos.json"; + } + + if(Test-Path $configFile){ + Remove-Item $configFile; + } + + $commandsFileWithPath = $commandsFilesBasePath + "\" + $commandFile; + #Generating the config files using dab commands + foreach($command in Get-Content $commandsFileWithPath){ + $commandToExecute = "dotnet " + $pathToDabDLL + " " + $command; + Invoke-Expression $commandToExecute; + } + +} From ca80cb99934eec3c6e5dab888e7888f0b0e1e0f4 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 14:07:19 +0530 Subject: [PATCH 74/89] adding bash script --- ConfigGenerators/configGenerator.sh | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 ConfigGenerators/configGenerator.sh diff --git a/ConfigGenerators/configGenerator.sh b/ConfigGenerators/configGenerator.sh new file mode 100644 index 0000000000..ba2978f2e5 --- /dev/null +++ b/ConfigGenerators/configGenerator.sh @@ -0,0 +1,56 @@ +#!/bin/bash +databaseTypes=(); + +if [[ $# -eq 0 ]]; then + databaseTypes=("MsSql" "MySql" "PostgreSql" "Cosmos") +elif [[ $# -eq 1 ]]; then + databaseType=$1; + if ! { [ $databaseType == "MsSql" ] || [ $databaseType == "MySql" ] || [ $databaseType == "PostgreSql" ] || [ $databaseType == "Cosmos" ]; }; then + echo "Valid arguments are MsSql, Mysql, PostgreSql or Cosmos"; + exit 1; + fi + databaseTypes+=$databaseType; +else + echo "Please run with 0 or 1 arguments"; + exit 1; +fi + +#Fetching absolute path of this script +absolutePath="$( cd "$(dirname "$0")" ; pwd -P )"; +cliOutputPath="$absolutePath/../src/out/cli"; +commandFilesBasePath=$absolutePath; + +#Fetching the path of dab dll file +pathToDLL=$(find $cliOutputPath -name dab.dll) +workingDirectory="$absolutePath/../src/Service/" + +cd $workingDirectory; + +for databaseType in ${databaseTypes[@]} +do + if [[ $databaseType == "MsSql" ]]; then + commandFile="MsSqlCommands.txt"; + configFile="dab-config.MsSql.json"; + elif [[ $databaseType == "MySql" ]]; then + commandFile="MySqlCommands.txt"; + configFile="dab-config.MySql.json"; + elif [[ $databaseType == "PostgreSql" ]]; then + commandFile="PostgreSqlCommands.txt"; + configFile="dab-config.PostgreSql.json"; + else + commandFile="CosmosCommands.txt"; + configFile="dab-config.Cosmos.json"; + fi + + if [ -f $configFile ]; then + rm $configFile; + fi + + commandFileNameWithPath="$commandFilesBasePath/$commandFile"; + + while read -r command; do + command="dotnet ${pathToDLL} ${command}"; + eval $command; + done <$commandFileNameWithPath; + +done From 39a2489aa6a2713c1c62c5b51c96aad8207bddbc Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 14:29:52 +0530 Subject: [PATCH 75/89] added conditional postbuild task --- src/Cli/src/Cli.csproj | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index 656d171e35..508f5aed04 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -25,41 +25,14 @@ - + - - - - $(BaseOutputPath)$(Configuration)\$(TargetFramework)\dab.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + From b5340c64e9bfe3410f175b175868b485cab19874 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 14:38:45 +0530 Subject: [PATCH 76/89] adding comments to the scripts --- ConfigGenerators/configGenerator.ps1 | 15 ++++++++++----- ConfigGenerators/configGenerator.sh | 10 +++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ConfigGenerators/configGenerator.ps1 b/ConfigGenerators/configGenerator.ps1 index f10a75c076..142a27299f 100644 --- a/ConfigGenerators/configGenerator.ps1 +++ b/ConfigGenerators/configGenerator.ps1 @@ -1,5 +1,10 @@ +# This script can be used for generating the config files $PSDefaultParameterValues['*:Encoding'] = 'utf8'; +# This script can be invoked with either 0 or 1 argument. +# The argument represents the database type. Valid arguments are MsSql, MySql, PostgreSql and Cosmos +# When invoked with a database type, config file for that database type will be generated. +# When invoked without any arguments, config files for all the database types will be generated. $databaseTypes = @(); if($args.Count -eq 0){ $databaseTypes = "MsSql", "MySql", "PostgreSql", "Cosmos"; @@ -7,24 +12,25 @@ if($args.Count -eq 0){ elseif($args.Count -eq 1){ $databaseType = $args[0]; if(-not( ($databaseType -eq "MsSql") -or ($databaseType -eq "MySql") -or ($databaseType -eq "PostgreSql") -or ($databaseType -eq "Cosmos"))){ - throw "Valid arguements are MsSql, Mysql, PostgreSql or Cosmos"; + throw "Valid arguments are MsSql, Mysql, PostgreSql or Cosmos"; } $databaseTypes += $databaseType; } else{ - throw "Please run with 0 or 1 arguements"; + throw "Please run with 0 or 1 arguments"; } $cliBuildOutputPath = $PSScriptRoot + "\..\src\out\cli\"; - $commandsFilesBasePath = $PSScriptRoot; #Fetching the absolute path of dab.dll from build output directory $pathToDabDLL = Get-ChildItem -Path $cliBuildOutputPath -Recurse -include "dab.dll" | ForEach-Object{$_.FullName}; +#Change the working directory to where the config file needs to be generated. $workingDirectory = $PSScriptRoot + "\..\src\Service\"; Set-Location $workingDirectory; +#Generates the config files for the selected database types. foreach($databaseType in $databaseTypes){ if($databaseType -eq "MsSql"){ $commandFile = "MsSqlCommands.txt"; @@ -48,10 +54,9 @@ foreach($databaseType in $databaseTypes){ } $commandsFileWithPath = $commandsFilesBasePath + "\" + $commandFile; - #Generating the config files using dab commands + #The dab commands are run using the DLL executable foreach($command in Get-Content $commandsFileWithPath){ $commandToExecute = "dotnet " + $pathToDabDLL + " " + $command; Invoke-Expression $commandToExecute; } - } diff --git a/ConfigGenerators/configGenerator.sh b/ConfigGenerators/configGenerator.sh index ba2978f2e5..2da0a5fb56 100644 --- a/ConfigGenerators/configGenerator.sh +++ b/ConfigGenerators/configGenerator.sh @@ -1,6 +1,11 @@ #!/bin/bash +# This script can be used for generating the config files databaseTypes=(); +# This script can be invoked with either 0 or 1 argument. +# The argument represents the database type. Valid arguments are MsSql, MySql, PostgreSql and Cosmos +# When invoked with a database type, config file for that database type will be generated. +# When invoked without any arguments, config files for all the database types will be generated. if [[ $# -eq 0 ]]; then databaseTypes=("MsSql" "MySql" "PostgreSql" "Cosmos") elif [[ $# -eq 1 ]]; then @@ -22,10 +27,12 @@ commandFilesBasePath=$absolutePath; #Fetching the path of dab dll file pathToDLL=$(find $cliOutputPath -name dab.dll) -workingDirectory="$absolutePath/../src/Service/" +#Change the working directory to where the config file needs to be generated. +workingDirectory="$absolutePath/../src/Service/" cd $workingDirectory; +#Generates the config files for the selected database types. for databaseType in ${databaseTypes[@]} do if [[ $databaseType == "MsSql" ]]; then @@ -48,6 +55,7 @@ do commandFileNameWithPath="$commandFilesBasePath/$commandFile"; + #The dab commands are run using the DLL executable while read -r command; do command="dotnet ${pathToDLL} ${command}"; eval $command; From 269b3944d4b3e60310f10392451920c57a742ff6 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 14:57:32 +0530 Subject: [PATCH 77/89] removing unsupported schema elements from dab-config.json --- src/Service/dab-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/dab-config.json b/src/Service/dab-config.json index bb184a8acf..d12d9b4a1d 100644 --- a/src/Service/dab-config.json +++ b/src/Service/dab-config.json @@ -6,7 +6,6 @@ }, "runtime": { "rest": { - "enabled": true, "path": "/api" }, "graphql": { @@ -14,6 +13,7 @@ }, "host": { "mode": "development", + "authenticate-devmode-requests": false, "cors": { "origins": [ "http://localhost:5000" ], "allow-credentials": false From 70954661b0520ff8e0b5b18edc8852821ba84547 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 16:00:24 +0530 Subject: [PATCH 78/89] adding object type for source in schema --- schemas/dab.draft.schema.json | 57 +++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/schemas/dab.draft.schema.json b/schemas/dab.draft.schema.json index a6c992c771..dbf21c8f74 100644 --- a/schemas/dab.draft.schema.json +++ b/schemas/dab.draft.schema.json @@ -150,8 +150,61 @@ "type": "object", "properties": { "source": { - "type": "string", - "description": "The object in the backend database that is mapped to the entity" + "oneOf": [ + { + "type": "string", + "description": "The object in the backend database that is mapped to the entity" + }, + { + "type": "object", + "description": "The object in the backend database that is mapped to the entity", + "properties": { + "type": { + "type": "string", + "enum": [ + "table", + "view", + "stored-procedure" + ], + "description": "Database object type" + }, + "object": { + "type": "string", + "description": "Database object name" + }, + "parameters": { + "type": "object", + "description": "Dictionary of parameters and their values", + "patternProperties": { + "^.*$": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + } + ] + } + } + }, + "key-fields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to be used as primary keys" + } + }, + "required": [ + "type", + "object" + ] + } + ] }, "rest": { "oneOf": [ From e81d9738b1fb26025002ab0062ae40ad3e835ac7 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 16:03:40 +0530 Subject: [PATCH 79/89] added reference config files --- .../dab-config.CosmosReferenceConfig.json | 122 +++ .../dab-config.SqlReferenceConfig.json | 887 ++++++++++++++++++ 2 files changed, 1009 insertions(+) create mode 100644 ConfigGenerators/dab-config.CosmosReferenceConfig.json create mode 100644 ConfigGenerators/dab-config.SqlReferenceConfig.json diff --git a/ConfigGenerators/dab-config.CosmosReferenceConfig.json b/ConfigGenerators/dab-config.CosmosReferenceConfig.json new file mode 100644 index 0000000000..63367ed6e9 --- /dev/null +++ b/ConfigGenerators/dab-config.CosmosReferenceConfig.json @@ -0,0 +1,122 @@ +{ + "$schema": "dab.draft-01.schema.json", + "data-source": { + "database-type": "cosmos", + "connection-string": "Connection String" + }, + "cosmos": { + "database": "graphqldb", + "container": "planet", + "schema": "schema.gql" + }, + "runtime": { + "rest": { + "path": "/api" + }, + "graphql": { + "path": "/graphql" + }, + "host": { + "mode": "development", + "authenticate-devmode-requests": false, + "cors": { + "origins": [ + "http://localhost:5000" + ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Planet": { + "source": { + "type": "table", + "object": "graphqldb.planet" + }, + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ + "create", + "read", + "update", + "delete" + ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "read", + "update", + "delete" + ] + } + ], + "graphql": { + "type": { + "singular": "Planet", + "plural": "Planets" + } + } + }, + "Character": { + "source": "graphqldb.character", + "rest": false, + "permissions": [ + { + "role": "authenticated", + "actions": [ + "create", + "read", + "update", + "delete" + ] + } + ], + "graphql": { + "type": { + "singular": "Character", + "plural": "Characters" + } + } + }, + "Star": { + "source": { + "type": "table", + "object": "graphqldb.star" + }, + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ + "create", + "read", + "update", + "delete" + ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "read", + "update", + "delete" + ] + } + ], + "graphql": { + "type": { + "singular": "Star", + "plural": "Stars" + } + } + } + } +} \ No newline at end of file diff --git a/ConfigGenerators/dab-config.SqlReferenceConfig.json b/ConfigGenerators/dab-config.SqlReferenceConfig.json new file mode 100644 index 0000000000..343e0eb93d --- /dev/null +++ b/ConfigGenerators/dab-config.SqlReferenceConfig.json @@ -0,0 +1,887 @@ +{ + "$schema": "dab.draft-01.schema.json", + "data-source": { + "database-type": "mssql", + "connection-string": "Connection String" + }, + "mssql": { + "set-session-context": false + }, + "runtime": { + "rest": { + "path": "/api" + }, + "graphql": { + "allow-introspection": true + }, + "host": { + "mode": "development", + "authenticate-devmode-requests": false, + "cors": { + "origins": [ "http://localhost:5000" ], + "allow-credentials": false + }, + "authentication": { + "provider": "StaticWebApps" + } + } + }, + "entities": { + "Publisher": { + "source": "publishers", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1940" + } + }, + "delete" + ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book" + } + } + }, + "Stock": { + "source": "stocks", + "rest": { + "path": "commodities" + }, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Book": { + "source": "books", + "graphql": { + "type": { + "singular": "book", + "plural": "books" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_02", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_03", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title eq 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_04", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.title ne 'Policy-Test-01'" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_05", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_06", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 10" + } + }, + "delete" + ] + }, + { + "role": "policy_tester_07", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 9" + } + } + ] + }, + { + "role": "policy_tester_08", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 9" + } + } + ] + } + ], + "relationships": { + "publishers": { + "cardinality": "one", + "target.entity": "Publisher" + }, + "websiteplacement": { + "cardinality": "one", + "target.entity": "BookWebsitePlacement" + }, + "reviews": { + "cardinality": "many", + "target.entity": "Review" + }, + "authors": { + "cardinality": "many", + "target.entity": "Author", + "linking.object": "book_author_link", + "linking.source.fields": [ "book_id" ], + "linking.target.fields": [ "author_id" ] + } + }, + "mappings": { + "id": "id", + "title": "title" + } + }, + "BookWebsitePlacement": { + "source": "book_website_placements", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ + "create", + "update", + { + "action": "delete", + "policy": { + "database": "@claims.id eq @item.id" + }, + "fields": { + "include": [ "*" ] + } + } + ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Author": { + "source": "authors", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "many", + "target.entity": "Book", + "linking.object": "book_author_link" + } + } + }, + "Review": { + "source": "reviews", + "rest": true, + "graphql": { + "type": { + "singular": "review", + "plural": "reviews" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "books": { + "cardinality": "one", + "target.entity": "Book" + } + } + }, + "Comic": { + "source": "comics", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + "series": { + "cardinality": "one", + "target.entity": "series" + } + } + }, + "Broker": { + "source": "brokers", + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "WebsiteUser": { + "source": "website_users", + "rest": false, + "graphql": { + "type": { + "singular": "websiteUser", + "plural": "websiteUsers" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "SupportedType": { + "source": "type_table", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "stocks_price": { + "source": "stocks_price", + "rest": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Tree": { + "source": "trees", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "Scientific Name", + "region": "United State's Region" + } + }, + "Shrub": { + "source": "trees", + "rest": { + "path": "plants" + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "mappings": { + "species": "fancyName" + } + }, + "Fungus": { + "source": "fungi", + "rest": true, + "graphql": { + "type": { + "singular": "fungus", + "plural": "fungi" + } + }, + "permissions": [ + { + "role": "anonymous", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + }, + { + "role": "policy_tester_01", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.region ne 'northeast'" + } + } + ] + } + ], + "mappings": { + "spores": "hazards" + } + }, + "Empty": { + "source": "empty_table", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ] + }, + "Notebook": { + "source": "notebooks", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ + { + "action": "read", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + "create", + "update", + "delete" + ] + } + ] + }, + "Journal": { + "source": "journals", + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "policy_tester_noupdate", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id ne 1" + } + }, + { + "action": "read", + "fields": { + "include": [ "*" ] + } + }, + "delete" + ] + }, + { + "role": "policy_tester_update_noread", + "actions": [ + "create", + { + "action": "update", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + }, + { + "action": "read", + "fields": { + "exclude": [ "*" ] + } + }, + { + "action": "delete", + "fields": { + "include": [ "*" ] + }, + "policy": { + "database": "@item.id eq 1" + } + } + ] + }, + { + "role": "authorizationHandlerTester", + "actions": [ "read" ] + } + ] + }, + "books_view_all": { + "source": { + "object": "books_view_all", + "type": "view" + }, + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "stocks_view_selected": { + "source": { + "object": "stocks_view_selected", + "type": "view" + }, + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "books_publishers_view_composite": { + "source": { + "object": "books_publishers_view_composite", + "type": "view" + }, + "rest": true, + "graphql": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "create", "read", "update", "delete" ] + } + ], + "relationships": { + } + }, + "ArtOfWar": { + "source": "aow", + "rest": true, + "permissions": [ + { + "role": "anonymous", + "actions": [ "*" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ], + "mappings": { + "DetailAssessmentAndPlanning": "始計", + "WagingWar": "作戰", + "StrategicAttack": "謀攻", + "NoteNum": "┬─┬ノ( º _ ºノ)" + } + }, + "series": { + "source": "series", + "permissions": [ + { + "role": "anonymous", + "actions": [ + "*" + ] + } + ], + "relationships": { + "comics": { + "cardinality": "many", + "target.entity": "Comic" + } + } + }, + "GetBooks": { + "source": { + "type": "stored-procedure", + "object": "get_books" + }, + "rest": true, + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ] + }, + "GetBook": { + "source": { + "type": "stored-procedure", + "object": "get_book_by_id" + }, + "rest": true, + "graphql": false, + "permissions": [ + { + "role": "anonymous", + "actions": [ "read" ] + }, + { + "role": "authenticated", + "actions": [ "*" ] + } + ] + } + } +} From d82f7c91482c3cd7a903c3f12651d023dc5acbaf Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 16:28:06 +0530 Subject: [PATCH 80/89] setting generateCOnfig property to true in build --- .pipelines/cosmos-pipelines.yml | 2 +- .pipelines/mssql-pipelines.yml | 4 ++-- .pipelines/mysql-pipelines.yml | 2 +- .pipelines/pg-pipelines.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/cosmos-pipelines.yml b/.pipelines/cosmos-pipelines.yml index fc6dad05ed..018c84ec84 100644 --- a/.pipelines/cosmos-pipelines.yml +++ b/.pipelines/cosmos-pipelines.yml @@ -46,7 +46,7 @@ steps: inputs: command: build projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' # Update this to match your need + arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1.206.0 displayName: 'Generate dab-config.Cosmos.json' diff --git a/.pipelines/mssql-pipelines.yml b/.pipelines/mssql-pipelines.yml index 178c691809..2143d6d015 100644 --- a/.pipelines/mssql-pipelines.yml +++ b/.pipelines/mssql-pipelines.yml @@ -49,7 +49,7 @@ jobs: inputs: command: build projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' # Update this to match your need + arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1.206.0 displayName: 'Generate dab-config.MsSql.json' @@ -134,7 +134,7 @@ jobs: inputs: command: build projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' # Update this to match your need + arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1.206.0 displayName: 'Generate dab-config.MsSql.json' diff --git a/.pipelines/mysql-pipelines.yml b/.pipelines/mysql-pipelines.yml index bbcef34260..e609c86ac5 100644 --- a/.pipelines/mysql-pipelines.yml +++ b/.pipelines/mysql-pipelines.yml @@ -53,7 +53,7 @@ jobs: inputs: command: build projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' # Update this to match your need + arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1.206.0 displayName: 'Generate dab-config.MySql.json' diff --git a/.pipelines/pg-pipelines.yml b/.pipelines/pg-pipelines.yml index 0257a12b80..255b519152 100644 --- a/.pipelines/pg-pipelines.yml +++ b/.pipelines/pg-pipelines.yml @@ -49,7 +49,7 @@ jobs: inputs: command: build projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' # Update this to match your need + arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need - task: FileTransform@1.206.0 displayName: 'Generate dab-config.PostgreSql.json' From 706981c98c27acb4be4e34ccbdce5e3a5e8d1e81 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 16:43:14 +0530 Subject: [PATCH 81/89] setting generateConfigFiles to true in build pipeline --- .pipelines/build-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/build-pipelines.yml b/.pipelines/build-pipelines.yml index 3d9389a034..fc3caf4a52 100644 --- a/.pipelines/build-pipelines.yml +++ b/.pipelines/build-pipelines.yml @@ -80,7 +80,7 @@ steps: command: custom custom: pack projects: '**/*.sln' - arguments: '--configuration $(buildConfiguration) -p:Version=$(dabVersion)' + arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration) -p:Version=$(dabVersion)' - task: DotNetCoreCLI@2 displayName: "Run Unit Tests" From bbfe74bccc7e661cec6fa280193a96d13d1295b4 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 17:47:15 +0530 Subject: [PATCH 82/89] adding comments, removing copy to engine output directory --- ConfigGenerators/configGenerator.ps1 | 2 ++ ConfigGenerators/configGenerator.sh | 2 ++ src/Cli/src/Cli.csproj | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ConfigGenerators/configGenerator.ps1 b/ConfigGenerators/configGenerator.ps1 index 142a27299f..d07be5922c 100644 --- a/ConfigGenerators/configGenerator.ps1 +++ b/ConfigGenerators/configGenerator.ps1 @@ -49,6 +49,8 @@ foreach($databaseType in $databaseTypes){ $configFile = "dab-config.Cosmos.json"; } + # If a config file with the same name exists, it is deleted to avoid writing to + # the same config file if(Test-Path $configFile){ Remove-Item $configFile; } diff --git a/ConfigGenerators/configGenerator.sh b/ConfigGenerators/configGenerator.sh index 2da0a5fb56..4a444dcdae 100644 --- a/ConfigGenerators/configGenerator.sh +++ b/ConfigGenerators/configGenerator.sh @@ -49,6 +49,8 @@ do configFile="dab-config.Cosmos.json"; fi + # If a config file with the same name exists, it is deleted to avoid writing to + # the same config file if [ -f $configFile ]; then rm $configFile; fi diff --git a/src/Cli/src/Cli.csproj b/src/Cli/src/Cli.csproj index 508f5aed04..4baef6e5d4 100644 --- a/src/Cli/src/Cli.csproj +++ b/src/Cli/src/Cli.csproj @@ -32,7 +32,6 @@ - From d6a862bdf8d810b7080bfcda55a9b0ba7c360ff4 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 17:58:41 +0530 Subject: [PATCH 83/89] removing mappings --- ConfigGenerators/MsSqlCommands.txt | 9 ++++----- src/Service/dab-config.json | 20 +++----------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/ConfigGenerators/MsSqlCommands.txt b/ConfigGenerators/MsSqlCommands.txt index ece3cac90b..55c95e0d8e 100644 --- a/ConfigGenerators/MsSqlCommands.txt +++ b/ConfigGenerators/MsSqlCommands.txt @@ -45,7 +45,6 @@ update Book --config "dab-config.MsSql.json" --relationship publishers --target. update Book --config "dab-config.MsSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one update Book --config "dab-config.MsSql.json" --relationship reviews --target.entity Review --cardinality many update Book --config "dab-config.MsSql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" -update Book --config "dab-config.MsSql.json" --map "id:id,title:title" update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete" update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*" update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" @@ -82,9 +81,9 @@ update stocks_price --config "dab-config.MsSql.json" --permissions "authenticate update Comic --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship series --target.entity series --cardinality one update series --config "dab-config.MsSql.json" --relationship comics --target.entity Comic --cardinality many update Broker --config "dab-config.MsSql.json" --permissions "authenticated:create,update,read,delete" --graphql false -update Tree --config "dab-config.MsSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" -update Shrub --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" -update Fungus --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true +update Tree --config "dab-config.MsSql.json" --rest true --permissions "authenticated:create,read,update,delete" +update Shrub --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" +update Fungus --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true update Fungus --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" update books_view_all --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update stocks_view_selected --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" @@ -101,6 +100,6 @@ update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_upd update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" update Journal --config "dab-config.MsSql.json" --permissions "authorizationHandlerTester:read" -update ArtOfWar --config "dab-config.MsSql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" +update ArtOfWar --config "dab-config.MsSql.json" --permissions "authenticated:*" update GetBook --config "dab-config.MsSql.json" --permissions "authenticated:*" update GetBooks --config "dab-config.MsSql.json" --permissions "authenticated:*" diff --git a/src/Service/dab-config.json b/src/Service/dab-config.json index d12d9b4a1d..8fa6c8147d 100644 --- a/src/Service/dab-config.json +++ b/src/Service/dab-config.json @@ -92,10 +92,6 @@ "linking.source.fields": [ "book_id" ], "linking.target.fields": [ "author_id" ] } - }, - "mappings": { - "id": "id", - "title": "title" } }, "BookWebsitePlacement": { @@ -257,11 +253,7 @@ "role": "authenticated", "actions": [ "create", "read", "update", "delete" ] } - ], - "mappings": { - "species": "Scientific Name", - "region": "United State's Region" - } + ] }, "Shrub": { "source": "trees", @@ -275,10 +267,7 @@ "role": "authenticated", "actions": [ "create", "read", "update", "delete" ] } - ], - "mappings": { - "species": "fancyName" - } + ] }, "Fungus": { "source": "fungi", @@ -292,10 +281,7 @@ "role": "authenticated", "actions": [ "create", "read", "update", "delete" ] } - ], - "mappings": { - "spores": "hazards" - } + ] }, "Empty": { "source": "empty_table", From 08e3da833e8b81a6a4fc422debdfa99075f7ac51 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 25 Oct 2022 18:16:44 +0530 Subject: [PATCH 84/89] including map commands for mssql commands file --- ConfigGenerators/MsSqlCommands.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ConfigGenerators/MsSqlCommands.txt b/ConfigGenerators/MsSqlCommands.txt index 55c95e0d8e..ece3cac90b 100644 --- a/ConfigGenerators/MsSqlCommands.txt +++ b/ConfigGenerators/MsSqlCommands.txt @@ -45,6 +45,7 @@ update Book --config "dab-config.MsSql.json" --relationship publishers --target. update Book --config "dab-config.MsSql.json" --relationship websiteplacement --target.entity BookWebsitePlacement --cardinality one update Book --config "dab-config.MsSql.json" --relationship reviews --target.entity Review --cardinality many update Book --config "dab-config.MsSql.json" --relationship authors --target.entity Author --cardinality many --linking.object book_author_link --linking.source.fields "book_id" --linking.target.fields "author_id" +update Book --config "dab-config.MsSql.json" --map "id:id,title:title" update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete" update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*" update Book --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.title eq 'Policy-Test-01'" @@ -81,9 +82,9 @@ update stocks_price --config "dab-config.MsSql.json" --permissions "authenticate update Comic --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship series --target.entity series --cardinality one update series --config "dab-config.MsSql.json" --relationship comics --target.entity Comic --cardinality many update Broker --config "dab-config.MsSql.json" --permissions "authenticated:create,update,read,delete" --graphql false -update Tree --config "dab-config.MsSql.json" --rest true --permissions "authenticated:create,read,update,delete" -update Shrub --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" -update Fungus --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true +update Tree --config "dab-config.MsSql.json" --rest true --permissions "authenticated:create,read,update,delete" --map "species:Scientific Name,region:United State's Region" +update Shrub --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "species:fancyName" +update Fungus --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --map "spores:hazards" --rest true update Fungus --config "dab-config.MsSql.json" --permissions "policy_tester_01:read" --fields.include "*" --policy-database "@item.region ne 'northeast'" update books_view_all --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true update stocks_view_selected --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" @@ -100,6 +101,6 @@ update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_upd update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:read" --fields.exclude "*" update Journal --config "dab-config.MsSql.json" --permissions "policy_tester_update_noread:delete" --fields.include "*" --policy-database "@item.id eq 1" update Journal --config "dab-config.MsSql.json" --permissions "authorizationHandlerTester:read" -update ArtOfWar --config "dab-config.MsSql.json" --permissions "authenticated:*" +update ArtOfWar --config "dab-config.MsSql.json" --permissions "authenticated:*" --map "DetailAssessmentAndPlanning:始計,WagingWar:作戰,StrategicAttack:謀攻,NoteNum:┬─┬ノ( º _ ºノ)" update GetBook --config "dab-config.MsSql.json" --permissions "authenticated:*" update GetBooks --config "dab-config.MsSql.json" --permissions "authenticated:*" From 6828bd63e394125b34e430ca456f433553a798a3 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 26 Oct 2022 10:05:24 +0530 Subject: [PATCH 85/89] adding newline at end of file --- ConfigGenerators/dab-config.CosmosReferenceConfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConfigGenerators/dab-config.CosmosReferenceConfig.json b/ConfigGenerators/dab-config.CosmosReferenceConfig.json index 63367ed6e9..4f9b256fd1 100644 --- a/ConfigGenerators/dab-config.CosmosReferenceConfig.json +++ b/ConfigGenerators/dab-config.CosmosReferenceConfig.json @@ -119,4 +119,4 @@ } } } -} \ No newline at end of file +} From 314307123e49d95c441d4501ba51fb58796e5773 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 26 Oct 2022 11:50:51 +0530 Subject: [PATCH 86/89] increasing sql and cosmos client version numbers --- src/Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 8fc38b73c5..4d04f5b3bc 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -7,8 +7,8 @@ 12.8.2 - 3.20.0 - 3.0.0 + 3.21.0 + 3.1.0 6.0.0-preview.3.21201.4 5.0.10 7.9.0 From 402434f7eb1e546fb5ffda607b8af9fb1e751083 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 26 Oct 2022 12:10:27 +0530 Subject: [PATCH 87/89] using newer versions of the sql and cosmos clinet nuget --- src/Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 4d04f5b3bc..94ac0810b4 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -7,8 +7,8 @@ 12.8.2 - 3.21.0 - 3.1.0 + 3.23.0 + 4.0.0 6.0.0-preview.3.21201.4 5.0.10 7.9.0 From cc6e9b701f9dbfb0d331b0e2420481830d7318d1 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 26 Oct 2022 12:22:11 +0530 Subject: [PATCH 88/89] reverting to original versions --- src/Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 94ac0810b4..8fc38b73c5 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -7,8 +7,8 @@ 12.8.2 - 3.23.0 - 4.0.0 + 3.20.0 + 3.0.0 6.0.0-preview.3.21201.4 5.0.10 7.9.0 From 85cd5fd786b40d684d046ced1276e3d89a5df714 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 27 Oct 2022 10:03:44 +0530 Subject: [PATCH 89/89] updating Star to StarAlias in Cosmos commands --- ConfigGenerators/CosmosCommands.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ConfigGenerators/CosmosCommands.txt b/ConfigGenerators/CosmosCommands.txt index 2a0c7d2ca7..3e4df4aac9 100644 --- a/ConfigGenerators/CosmosCommands.txt +++ b/ConfigGenerators/CosmosCommands.txt @@ -2,5 +2,5 @@ init --config "dab-config.Cosmos.json" --database-type "cosmos" --connection-str add Planet --config "dab-config.Cosmos.json" --source "graphqldb.planet" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Planet:Planets" update Planet --config "dab-config.Cosmos.json" --permissions "authenticated:create,read,update,delete" add Character --config "dab-config.Cosmos.json" --source "graphqldb.character" --permissions "authenticated:create,read,update,delete" --rest false --graphql "Character:Characters" -add Star --config "dab-config.Cosmos.json" --source "graphqldb.star" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Star:Stars" -update Star --config "dab-config.Cosmos.json" --source "graphqldb.star" --permissions "authenticated:create,read,update,delete" +add StarAlias --config "dab-config.Cosmos.json" --source "graphqldb.star" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Star:Stars" +update StarAlias --config "dab-config.Cosmos.json" --source "graphqldb.star" --permissions "authenticated:create,read,update,delete"