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 2, 2024
0 parents commit 777bbda
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.

30 changes: 30 additions & 0 deletions test-results/data/attachments/11d6c874a64261b3.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,
)))
}
}
25 changes: 25 additions & 0 deletions test-results/data/attachments/125d6b8ce99bc8e0.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()
}
}
}
}
16 changes: 16 additions & 0 deletions test-results/data/attachments/1871bb9776eb59b9.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()
}
}
}
}
8 changes: 8 additions & 0 deletions test-results/data/attachments/294eb7a752ea63da.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")
}
}
16 changes: 16 additions & 0 deletions test-results/data/attachments/2d52b5fa0adb52ad.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()
}
}
}
}
2 changes: 2 additions & 0 deletions test-results/data/attachments/3823cc0071cda619.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
4 changes: 4 additions & 0 deletions test-results/data/attachments/3d7d4c151db3e437.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
25 changes: 25 additions & 0 deletions test-results/data/attachments/45400704adf485d0.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()
}
}
}
}
22 changes: 22 additions & 0 deletions test-results/data/attachments/534974b344529a04.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()
}
}
15 changes: 15 additions & 0 deletions test-results/data/attachments/53b7ebb81c17776b.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)
}
}
}
}
25 changes: 25 additions & 0 deletions test-results/data/attachments/58ad3cca50c64392.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()
}
}
}
}
8 changes: 8 additions & 0 deletions test-results/data/attachments/5e545bf8ecb43634.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")
}
}
16 changes: 16 additions & 0 deletions test-results/data/attachments/66e83afa228eda5f.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/6f4c221bf516f65a.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
1 change: 1 addition & 0 deletions test-results/data/attachments/7612af944417ccc2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/test/resources/result/AmyAccess/expected/trades-grid_expected.json
15 changes: 15 additions & 0 deletions test-results/data/attachments/76d874b2246cc9a5.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)
}
}
}
}
4 changes: 4 additions & 0 deletions test-results/data/attachments/7979ac486aa99faa.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
42 changes: 42 additions & 0 deletions test-results/data/attachments/8264beee9b51ce1b.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()
}
}
16 changes: 16 additions & 0 deletions test-results/data/attachments/97e3d8eefd1cc938.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()
}
}
}
}
8 changes: 8 additions & 0 deletions test-results/data/attachments/a85def19a3345037.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")
}
}
25 changes: 25 additions & 0 deletions test-results/data/attachments/b2b98c6247b9cbab.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/b8866f608a49c2b3.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")
}
}
1 change: 1 addition & 0 deletions test-results/data/attachments/c5f906de0cbcae09.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/test/resources/result/AmyAccess/expected/trades-grid_expected.json
4 changes: 4 additions & 0 deletions test-results/data/attachments/dd365c1bc308b344.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/f55e0ffc53f7f74e.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 777bbda

Please sign in to comment.