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 Jan 9, 2025
0 parents commit e9293e2
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.

8 changes: 8 additions & 0 deletions test-results/data/attachments/23468a6ec5ec45a0.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")
}
}
22 changes: 22 additions & 0 deletions test-results/data/attachments/30533c78287ea0fb.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()
}
}
8 changes: 8 additions & 0 deletions test-results/data/attachments/38ebd66789016f99.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")
}
}
15 changes: 15 additions & 0 deletions test-results/data/attachments/3c4b97f7466f9d75.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)
}
}
}
}
8 changes: 8 additions & 0 deletions test-results/data/attachments/432f52374446bb.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/5b7ca5fdc35dcade.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/864c2a725f1a6592.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()
}
}
}
}
4 changes: 4 additions & 0 deletions test-results/data/attachments/89aad7845ee93f51.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
8 changes: 8 additions & 0 deletions test-results/data/attachments/91d920a1927a152f.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")
}
}
15 changes: 15 additions & 0 deletions test-results/data/attachments/95f3b2f3be9b8041.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)
}
}
}
}
4 changes: 4 additions & 0 deletions test-results/data/attachments/975c6bc4ba0fc702.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
2 changes: 2 additions & 0 deletions test-results/data/attachments/a8bb1bd574241ad5.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/ace7daf883b3423a.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/ae30dd76565d7be7.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()
}
}
}
}
1 change: 1 addition & 0 deletions test-results/data/attachments/b205c83240f0f47f.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/c35815405a1a4da9.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()
}
}
}
}
1 change: 1 addition & 0 deletions test-results/data/attachments/c3ad4c353b53d239.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/c70605e8076ecf98.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/c84a9e89d994bcdb.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()
}
}
}
}
2 changes: 2 additions & 0 deletions test-results/data/attachments/cdf90aaf9d9cc917.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/dd776886b46bed13.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)
}
}
}
}
16 changes: 16 additions & 0 deletions test-results/data/attachments/dee395eadbe24f47.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()
}
}
}
}
1 change: 1 addition & 0 deletions test-results/data/attachments/eba1d287ab00a218.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/ed7d67c299a0bf25.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()
}
}
}
}
42 changes: 42 additions & 0 deletions test-results/data/attachments/ed93c240d877c7b4.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()
}
}
15 changes: 15 additions & 0 deletions test-results/data/attachments/eef0b08116907678.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)
}
}
}
}
Loading

0 comments on commit e9293e2

Please sign in to comment.