Esempio n. 1
0
db_to_web.dstPort = 80
db_to_web.data = comment_retrieved
db_to_web.responseTo = web_to_db

comment_to_show = Data("Web server shows comments to the end user",
                       classifcation=Classification.PUBLIC)
web_to_user = Dataflow(web, user, "Show comments (*)")
web_to_user.protocol = "HTTP"
web_to_user.data = comment_to_show
web_to_user.responseTo = user_to_web

clear_op = Data("Serverless function clears DB",
                classification=Classification.PUBLIC)
my_lambda_to_db = Dataflow(my_lambda, db,
                           "Serverless function periodically cleans DB")
my_lambda_to_db.protocol = "MySQL"
my_lambda_to_db.dstPort = 3306
my_lambda_to_db.data = clear_op

userIdToken = Data(
    name="User ID Token",
    description=
    "Some unique token that represents the user real data in the secret database",
    classification=Classification.TOP_SECRET,
    traverses=[user_to_web, db_to_secretDb],
    processedBy=[db, secretDb],
)

if __name__ == "__main__":
    tm.process()
Esempio n. 2
0
stripe_api_to_merchant_web = Dataflow(
    stripe_api, merchant_web, "Return PaymentIntent to the Merchant (*)")
stripe_api_to_merchant_web.data = 'Response'
stripe_api_to_merchant_web.responseTo = merchant_web_to_stripe_api

merchant_web_to_customer_client = Dataflow(
    merchant_web, customer_client,
    "Return PaymentIntent to the Customer Client (*)")
merchant_web_to_customer_client.data = 'merchant_secret'
merchant_web_to_customer_client.responseTo = customer_client_to_merchant_web

customer_to_customer_client = Dataflow(
    customer, customer_client,
    "Customer provides card details and finalizes payment (*)")

customer_client_to_stripe_api = Dataflow(
    customer_client, stripe_api,
    "Customer Client sends stripe.confirmCardPayment() (*)")
customer_client_to_stripe_api.data = "client_secret and card details"

stripe_api_to_stripe_process = Dataflow(stripe_api, stripe_process,
                                        "Attempt payment")
stripe_process_to_stripe_api = Dataflow(stripe_process, stripe_api,
                                        "Payment Response")

stripe_api_to_customer_client = Dataflow(
    stripe_api, customer_client, "Return the PaymentIntent with status (*)")
stripe_api_to_customer_client.data = "Return the PaymentIntent with status 'succeeded'"

payment_online.process()