Skip to content

Commit

Permalink
v2.2.3 complete
Browse files Browse the repository at this point in the history
  • Loading branch information
knowbase committed Feb 18, 2023
1 parent d8c7813 commit d549f4b
Show file tree
Hide file tree
Showing 5 changed files with 322 additions and 10 deletions.
274 changes: 274 additions & 0 deletions arcadia/arcadia-oas3-2.0.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
{
"openapi": "3.0.3",
"info": {
"title": "API Arcadia Finance",
"description": "Arcadia OpenAPI",
"version": "2.0.2-oas3"
},
"servers": [
{
"url": "/"
}
],
"paths": {
"/api/lower_bar.php": {
"get": {
"summary": "get lower bar",
"responses": {
"200": {
"description": "200 response"
}
}
}
},
"/api/side_bar.php": {
"get": {
"summary": "get side bar",
"responses": {
"200": {
"description": "200 response"
}
}
}
},
"/api/side_bar_accounts.php": {
"get": {
"summary": "get side bar",
"responses": {
"200": {
"description": "200 response"
}
}
}
},
"/trading/rest/portfolio.php": {
"get": {
"summary": "get portfolio",
"responses": {
"200": {
"description": "200 response"
}
}
}
},
"/trading/rest/buy_stocks.php": {
"post": {
"summary": "Add stocks to your portfolio",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/buy"
},
"example": {
"trans_value": "312",
"qty": "16",
"company": "MSFT",
"action": "buy",
"stock_price": "198"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"example": {
"status": "success",
"name": "Microsoft",
"qty": "16",
"amount": "312",
"transid": "855415223"
}
}
}
}
}
}
},
"/trading/rest/sell_stocks.php": {
"post": {
"summary": "Sell stocks that you own",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/sell"
},
"example": {
"trans_value": "212",
"qty": "16",
"company": "MSFT",
"action": "sell",
"stock_price": "158"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"example": {
"status": "success",
"name": "Microsoft",
"qty": "16",
"amount": "212",
"transid": "658854124"
}
}
}
}
}
}
},
"/trading/transactions.php": {
"get": {
"summary": "Get the latests transactions that have happened",
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"example": {
"YourLastTransaction": "MFST 2000"
}
}
}
}
}
}
},
"/api/rest/execute_money_transfer.php": {
"post": {
"summary": "Transfer money to a friend",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/money_transfer"
},
"example": {
"amount": "92",
"account": "2075894",
"currency": "GBP",
"friend": "Vincent"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"example": {
"name": "Vincent",
"status": "success",
"currency": "GBP",
"transid": "524569855",
"msg": "The money transfer has been successfully completed"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"buy": {
"required": [
"action",
"company",
"qty",
"stock_price",
"trans_value"
],
"type": "object",
"properties": {
"trans_value": {
"type": "integer",
"format": "int64"
},
"qty": {
"type": "integer",
"format": "int64"
},
"company": {
"type": "string"
},
"action": {
"type": "string"
},
"stock_price": {
"type": "integer",
"format": "int64"
}
}
},
"sell": {
"required": [
"action",
"company",
"qty",
"stock_price",
"trans_value"
],
"type": "object",
"properties": {
"trans_value": {
"type": "integer",
"format": "int64"
},
"qty": {
"type": "integer",
"format": "int64"
},
"company": {
"type": "string"
},
"action": {
"type": "string"
},
"stock_price": {
"type": "integer",
"format": "int64"
}
}
},
"money_transfer": {
"required": [
"account",
"amount",
"currency",
"friend"
],
"type": "object",
"properties": {
"amount": {
"type": "integer",
"format": "int64"
},
"account": {
"type": "integer",
"format": "int64"
},
"currency": {
"type": "string"
},
"friend": {
"type": "string"
}
}
}
}
}
}
3 changes: 2 additions & 1 deletion xc/terraform.tfvars.examples
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#XC Global
api_url = "https://<Your Tenant>.console.ves.volterra.io/api"
xc_tenant = "Your tenant name"
xc_namespace = "Your XC namespace"

#XC LB
Expand All @@ -14,7 +15,7 @@ xc_multi_lb = false

#XC API Protection and Discovery
xc_api_disc = false
xc_api_def = false
xc_api_pro = false
xc_api_spec = []

#XC Malicious User Detection
Expand Down
10 changes: 7 additions & 3 deletions xc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ variable "ssh_key" {
description = "Unneeded for XC, only present for warning handling with TF cloud variable set"
}
#XC
variable "xc_tenant" {
type = string
description = "Your F5 XC tenant name"
}
variable "api_url" {
type = string
description = "Your F5 XC tenant"
description = "Your F5 XC tenant api url"
}
variable "xc_namespace" {
type = string
Expand Down Expand Up @@ -43,9 +47,9 @@ variable "xc_api_disc" {
description = "Enable API Discovery on single LB"
default = "false"
}
variable "xc_api_def" {
variable "xc_api_pro" {
type = string
description = "Enable API Definition"
description = "Enable API Protection (Definition and Rules)"
default = "false"
}
variable "xc_api_spec" {
Expand Down
2 changes: 1 addition & 1 deletion xc/xc_apip.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "volterra_api_definition" "api-def" {
count = var.xc_api_def ? 1 : 0
count = var.xc_api_pro ? 1 : 0
name = format("%s-api-def-%s", local.project_prefix, local.build_suffix)
namespace = var.xc_namespace
swagger_specs = var.xc_api_spec
Expand Down
43 changes: 38 additions & 5 deletions xc/xc_loadbalancer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,52 @@ resource "volterra_http_loadbalancer" "lb_https" {
multi_lb_app = var.xc_multi_lb ? true : false
user_id_client_ip = true
source_ip_stickiness = true

#API Protection Configuration

dynamic "enable_api_discovery" {
for_each = var.xc_api_disc ? [1] : []
content {
enable_learn_from_redirect_traffic = true
}
}

dynamic "api_definition" {
for_each = var.xc_api_def ? [1] : []
for_each = var.xc_api_pro ? [1] : []
content {
name = volterra_api_definition.api-def[0].name
namespace = volterra_api_definition.api-def[0].namespace
tenant = var.xc_tenant
}
}
dynamic "enable_api_discovery" {
for_each = var.xc_api_disc ? [1] : []

dynamic "api_protection_rules" {
for_each = var.xc_api_pro ? [1] : []
content {
enable_learn_from_redirect_traffic = true
}
api_groups_rules {
metadata {
name = format("%s-apip-deny-rule-%s", local.project_prefix, local.build_suffix)
}
action {
deny = true
}
base_path = "/api"
api_group = join("ves-io-api-def-", volterra_api_definition.api-def.name, "-all-operations")
}
api_groups_rules {
metadata {
name = format("%s-apip-allow-rule-%s", local.project_prefix, local.build_suffix)
}
action {
deny = false
}
base_path = "/"
}
}
}

#BOT Configuration

dynamic "policy_based_challenge" {
for_each = var.xc_mud ? [1] : []
content {
Expand Down

0 comments on commit d549f4b

Please sign in to comment.