Skip to content

Commit

Permalink
Sync to genesiscommunity
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-taylerson authored and CI committed Dec 13, 2024
0 parents commit 258842f
Show file tree
Hide file tree
Showing 93 changed files with 1,182 additions and 0 deletions.
1 change: 1 addition & 0 deletions .nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions test-results/app.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test-results/data/attachments/1c12e6a3be203c77.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/test/resources/result/AmyAccess/expected/trades-grid_expected.json
16 changes: 16 additions & 0 deletions test-results/data/attachments/1c67f8a73f342e44.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
query("ALL_TRADES_3", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this data server query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
auth{
// AUTH-COMMENT
// The below will check RIGHT_CODE's to hide columns at run time, enabling column specific authorisation
hideFields { userName, rowData ->
if (!userHasRight(userName, "TradeViewFull")) listOf(CUSTOMER_NAME)
else emptyList()
}
}
}
}
2 changes: 2 additions & 0 deletions test-results/data/attachments/2069eb8dac93aa81.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VERSION COUNTRY_NAME SIDE RATE NOTIONAL SOURCE_CURRENCY TARGET_CURRENCY CUSTOMER_ID CUSTOMER_NAME
1 Canada Buy 1.23 2,310,000 USD EUR 1 AutomationUser
16 changes: 16 additions & 0 deletions test-results/data/attachments/2728e2ea8ed19815.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
query("ALL_TRADES_3", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this data server query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
auth{
// AUTH-COMMENT
// The below will check RIGHT_CODE's to hide columns at run time, enabling column specific authorisation
hideFields { userName, rowData ->
if (!userHasRight(userName, "TradeViewFull")) listOf(CUSTOMER_NAME)
else emptyList()
}
}
}
}
15 changes: 15 additions & 0 deletions test-results/data/attachments/285c044b52945631.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
query("ALL_TRADES_2", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this data server query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
// AUTH-COMMENT
// The below will force a mapping to the COUNTRY_VISIBILITY that is defined for authorisation purposes in <appname>-permissions.kts
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
}
}
1 change: 1 addition & 0 deletions test-results/data/attachments/641324ab0daa986c.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/test/resources/result/AmyAccess/expected/trades-grid_expected.json
30 changes: 30 additions & 0 deletions test-results/data/attachments/67466b245608bca.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
eventHandler<Trade>("TRADE_INSERT", transactional = true) {
// AUTH-COMMENT
// A user must have the RIGHT CODE "TradeUpdate" to call this event
// Without this call will be rejected
permissioning {
permissionCodes = listOf("TradeUpdate")
// AUTH-COMMENT
// A user must have authorisation for the country they are inserting a transaction against
// This is applying row level insert authorisation
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
}
onCommit { event ->
val details = event.details
// AUTH-COMMENT
// If a user cannot see the Customer Name column they should not be able to insert this value so set to blank
// Cannot think of a viable business use case for this, but showing the code for reference
if (!userHasRight(event.userName, "TradeViewFull")) {
details.customerName = ""
}
val insertedRow = entityDb.insert(details)
// return an ack response which contains a list of record IDs
ack(listOf(mapOf(
"TRADE_ID" to insertedRow.record.tradeId,
)))
}
}
15 changes: 15 additions & 0 deletions test-results/data/attachments/722a8a1bdd89239d.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
requestReply("RR_ALL_TRADES_2", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this request reply query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
// AUTH-COMMENT
// The below will force a mapping to the COUNTRY_VISIBILITY that is defined for authorisation purposes in <appname>-permissions.kts
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
}
}
22 changes: 22 additions & 0 deletions test-results/data/attachments/763293cc62e6260.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
eventHandler<Trade>("TRADE_DELETE", transactional = true) {
// AUTH-COMMENT
// A user must have the RIGHT CODE "TradeUpdate" to call this event
// Without this call will be rejected
permissioning {
permissionCodes = listOf("TradeUpdate")
// AUTH-COMMENT
// A user must have authorisation for the country they are deleting a transaction against
// This is applying row level insert authorisation
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
val existingTrade= syncDb.get(Trade.byId(data.tradeId))
key(existingTrade?.countryName, userName)
}
}
}
onCommit { event ->
val details = event.details
entityDb.delete(details)
ack()
}
}
4 changes: 4 additions & 0 deletions test-results/data/attachments/7651cf02119d5c45.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VERSION COUNTRY_NAME SIDE RATE NOTIONAL SOURCE_CURRENCY TARGET_CURRENCY CUSTOMER_ID CUSTOMER_NAME EVENT
1 Canada Buy 1.23 100.000 GBP EUR 11 AutomationUser EVENT_TRADE_INSERT
1 Canada Sell 1.24 125.000 USD TRY 12 AutomationUser EVENT_TRADE_MODIFY
1 Canada Sell 1.24 125.000 USD TRY 12 AutomationUser EVENT_TRADE_DELETE
15 changes: 15 additions & 0 deletions test-results/data/attachments/76b865a17cd9e2a4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
query("ALL_TRADES_2", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this data server query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
// AUTH-COMMENT
// The below will force a mapping to the COUNTRY_VISIBILITY that is defined for authorisation purposes in <appname>-permissions.kts
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
}
}
42 changes: 42 additions & 0 deletions test-results/data/attachments/85404f0377dd5152.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
eventHandler<Trade>("TRADE_MODIFY", transactional = true) {
// AUTH-COMMENT
// A user must have the RIGHT CODE "TradeUpdate" to call this event
// Without this call will be rejected
permissioning {
permissionCodes = listOf("TradeUpdate")
// AUTH-COMMENT
// A user must have authorisation for the country they are inserting a transaction against
// This is applying row level insert authorisation.
// Both the existing database record as well as the update to apply must have correct authorisation.
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
val existingTrade= syncDb.get(Trade.byId(data.tradeId))
key(existingTrade?.countryName, userName)
}
} and auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
}
// AUTH-COMMENT
//This verifies prior version of trade exists in the database - otherwise reject
onValidate { event ->
verify {
entityDb hasEntry Trade.ById(event.details.tradeId)
}
ack()
}
onCommit { event ->
val details = event.details
// AUTH-COMMENT
// If a user cannot see the Customer Name column they should not be able to edit this value
// so ensure set to value in prior version - ie it is not changed
if (!userHasRight(event.userName, "TradeViewFull")) {
val trade = entityDb.get(Trade.ById(event.details.tradeId))!! //The two !! are stating "we know there is a trade" as we checked in onValidate
details.customerName = trade.customerName
}
entityDb.modify(details)
ack()
}
}
25 changes: 25 additions & 0 deletions test-results/data/attachments/88ad316468237763.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
query("ALL_TRADES_4", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this data server query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
// AUTH-COMMENT
// The below will force a mapping to the COUNTRY_VISIBILITY that is defined for authorisation purposes in the
// file scripts\<appname>-permissions.kts (same directory as this file)
// in this app it is called permissions-permissions.kts
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
auth{
// AUTH-COMMENT
// The below will check RIGHT_CODE's to hide columns at run time, enabling column specific authorisation
hideFields { userName, rowData ->
if (!userHasRight(userName, "TradeViewFull")) listOf(CUSTOMER_NAME)
else emptyList()
}
}
}
}
25 changes: 25 additions & 0 deletions test-results/data/attachments/a748430fbbe87bd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
query("ALL_TRADES_4", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this data server query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
// AUTH-COMMENT
// The below will force a mapping to the COUNTRY_VISIBILITY that is defined for authorisation purposes in the
// file scripts\<appname>-permissions.kts (same directory as this file)
// in this app it is called permissions-permissions.kts
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
auth{
// AUTH-COMMENT
// The below will check RIGHT_CODE's to hide columns at run time, enabling column specific authorisation
hideFields { userName, rowData ->
if (!userHasRight(userName, "TradeViewFull")) listOf(CUSTOMER_NAME)
else emptyList()
}
}
}
}
4 changes: 4 additions & 0 deletions test-results/data/attachments/a86ff040d26a2be2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VERSION COUNTRY_NAME SIDE RATE NOTIONAL SOURCE_CURRENCY TARGET_CURRENCY CUSTOMER_ID CUSTOMER_NAME EVENT
1 Canada Buy 1.23 100.000 GBP EUR 11 AutomationUser EVENT_TRADE_INSERT
1 Canada Sell 1.24 125.000 USD TRY 12 AutomationUser EVENT_TRADE_MODIFY
1 Canada Sell 1.24 125.000 USD TRY 12 AutomationUser EVENT_TRADE_DELETE
16 changes: 16 additions & 0 deletions test-results/data/attachments/aa6550b7694fe923.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
requestReply("RR_ALL_TRADES_3", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this request reply query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
auth{
// AUTH-COMMENT
// The below will check RIGHT_CODE's to hide columns at run time, enabling column specific authorisation
hideFields { userName, rowData ->
if (!userHasRight(userName, "TradeViewFull")) listOf(CUSTOMER_NAME)
else emptyList()
}
}
}
}
25 changes: 25 additions & 0 deletions test-results/data/attachments/ae980cb61808a7a5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
requestReply("RR_ALL_TRADES_4", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this request reply query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
// AUTH-COMMENT
// The below will force a mapping to the COUNTRY_VISIBILITY that is defined for authorisation purposes in the
// file scripts\<appname>-permissions.kts (same directory as this file)
// in this app it is called permissions-permissions.kts
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
auth{
// AUTH-COMMENT
// The below will check RIGHT_CODE's to hide columns at run time, enabling column specific authorisation
hideFields { userName, rowData ->
if (!userHasRight(userName, "TradeViewFull")) listOf(CUSTOMER_NAME)
else emptyList()
}
}
}
}
8 changes: 8 additions & 0 deletions test-results/data/attachments/b496247f3eb59076.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
requestReply("RR_ALL_TRADES_1", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this request reply query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewFull")
}
}
25 changes: 25 additions & 0 deletions test-results/data/attachments/b7c98c7cd59bb859.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
requestReply("RR_ALL_TRADES_4", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this request reply query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
// AUTH-COMMENT
// The below will force a mapping to the COUNTRY_VISIBILITY that is defined for authorisation purposes in the
// file scripts\<appname>-permissions.kts (same directory as this file)
// in this app it is called permissions-permissions.kts
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
auth{
// AUTH-COMMENT
// The below will check RIGHT_CODE's to hide columns at run time, enabling column specific authorisation
hideFields { userName, rowData ->
if (!userHasRight(userName, "TradeViewFull")) listOf(CUSTOMER_NAME)
else emptyList()
}
}
}
}
8 changes: 8 additions & 0 deletions test-results/data/attachments/b82e81565b2524d6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
query("ALL_TRADES_1", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this data server query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewFull")
}
}
4 changes: 4 additions & 0 deletions test-results/data/attachments/bd2a1816361fa7ce.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VERSION COUNTRY_NAME SIDE RATE NOTIONAL SOURCE_CURRENCY TARGET_CURRENCY CUSTOMER_ID CUSTOMER_NAME EVENT
1 Canada Buy 1.23 100.000 GBP EUR 11 AutomationUser EVENT_TRADE_INSERT
1 Canada Sell 1.24 125.000 USD TRY 12 AutomationUser EVENT_TRADE_MODIFY
1 Canada Sell 1.24 125.000 USD TRY 12 AutomationUser EVENT_TRADE_DELETE
1 change: 1 addition & 0 deletions test-results/data/attachments/c4c89ecfb88c3c14.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/test/resources/result/AmyAccess/expected/trades-grid_expected.json
8 changes: 8 additions & 0 deletions test-results/data/attachments/ca3019a1ca7331d3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
query("ALL_TRADES_1", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this data server query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewFull")
}
}
2 changes: 2 additions & 0 deletions test-results/data/attachments/cdd45124c8a511e3.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VERSION COUNTRY_NAME SIDE RATE NOTIONAL SOURCE_CURRENCY TARGET_CURRENCY CUSTOMER_ID CUSTOMER_NAME
1 Canada Buy 1.23 2,310,000 USD EUR 1 AutomationUser
15 changes: 15 additions & 0 deletions test-results/data/attachments/df5f01aaef8f63f0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
requestReply("RR_ALL_TRADES_2", TRADE) {
permissioning {
// AUTH-COMMENT
// The below will force people to have this RIGHT_CODE to access this request reply query
// N.B. this can be a list of RIGHT_CODE's
permissionCodes = listOf("TradeViewRestricted")
// AUTH-COMMENT
// The below will force a mapping to the COUNTRY_VISIBILITY that is defined for authorisation purposes in <appname>-permissions.kts
auth(mapName = "COUNTRY_VISIBILITY") {
authKeyWithUserName {
key(data.countryName, userName)
}
}
}
}
Loading

0 comments on commit 258842f

Please sign in to comment.