From abb177e4be91f060db4494491245cfd56ad5643a Mon Sep 17 00:00:00 2001 From: tianzhou Date: Fri, 13 Dec 2024 13:05:21 +0800 Subject: [PATCH] docs: add overall workflow --- content/docs/tutorials/just-in-time-part2.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/content/docs/tutorials/just-in-time-part2.md b/content/docs/tutorials/just-in-time-part2.md index 72785bc2..0b0d8221 100644 --- a/content/docs/tutorials/just-in-time-part2.md +++ b/content/docs/tutorials/just-in-time-part2.md @@ -37,15 +37,21 @@ This tutorial skips the Bytebase setup part, if you haven't set up the Bytebase Before you begin, make sure you have: -- Docker installed +- [Docker](https://www.docker.com/) installed - Slack workspace - VS Code for port forwarding +## Overall Workflow + +1. Create a Slack app. The Slack app listens on the webhook notification when someone submits a database access request. +1. Upon receiving the webhook event, the Slack app will present a message card in the configured channel with request details and approve/deny buttons. +1. Upon clicking the approve/deny button, the Slack app will call the corresponding Bytebase API to approve/deny the request. + ## Step 1 - Finished the previous tutorial Make sure you finished the [previous tutorial](/docs/tutorials/just-in-time-part1) and have the Bytebase instance running. Particularly, pay attention to **Step 4**, which is to request JIT access via Bytebase GUI. -The `Request role` feature is supported by **Enterprise Plan** which will be needed for this tutorial, other plans only allow the `Assign role` feature which is not enough. You may request a trial from [here](https://www.bytebase.com/contact-us/). +The `Request role` feature is supported by **Enterprise Plan** which will be needed for this tutorial, other plans only allow the `Assign role` feature which is not enough. You may request a trial from [here](https://www.bytebase.com/contact-us/). ## Step 2 - Register a service account in Bytebase @@ -61,7 +67,7 @@ The `Request role` feature is supported by **Enterprise Plan** which will be ne 1. By using VS Code's [Port forwarding](https://code.visualstudio.com/docs/editor/port-forwarding), you can forward the local server's ports: - `3000` for the `slack-example` app - `8080` for the Bytebase instance - ![vscode-ports](/content/docs/tutorials/just-in-time-part2/vscode-ports.webp) + ![vscode-ports](/content/docs/tutorials/just-in-time-part2/vscode-ports.webp) 1. Copy the 8080 port forwarded address to the `.env.local` file as `BB_HOST`. 1. Also, go to Bytebase, click **Settings > General** to set the address as **External URL**. @@ -116,4 +122,4 @@ If digging into the code is your interest, here is a brief explanation of the co ## Conclusion -In this tutorial, you learned how to set up JIT access via Slack with the help of Bytebase webhooks and APIs. In the next part, we will cover how to request JIT access via Slack. \ No newline at end of file +In this tutorial, you learned how to set up JIT access via Slack with the help of Bytebase webhooks and APIs. In the next part, we will cover how to request JIT access via Slack.