From 439454a71bce0899693645aeb271ffdfd8ad42ce Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 23 Aug 2021 10:32:37 +0200 Subject: [PATCH] website: add docs for making schema changes Signed-off-by: Jens Langhammer --- .gitignore | 1 + Makefile | 3 +++ .../developer-docs/making-schema-changes.md | 23 +++++++++++++++++++ website/sidebarsDev.js | 4 ++++ 4 files changed, 31 insertions(+) create mode 100644 website/developer-docs/making-schema-changes.md diff --git a/.gitignore b/.gitignore index a1c635a7a..2e452fe10 100644 --- a/.gitignore +++ b/.gitignore @@ -201,3 +201,4 @@ media/ .idea/ /api/ +/web-api/ diff --git a/Makefile b/Makefile index c93abdf14..11101ef88 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,9 @@ gen-web: -g typescript-fetch \ -o /local/web-api \ --additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=@goauthentik/api,npmVersion=${NPM_VERSION} + mkdir -p web/node_modules/@goauthentik/api + cd web-api && npm i + \cp -rfv web-api/* web/node_modules/@goauthentik/api gen-outpost: docker run \ diff --git a/website/developer-docs/making-schema-changes.md b/website/developer-docs/making-schema-changes.md new file mode 100644 index 000000000..775326b31 --- /dev/null +++ b/website/developer-docs/making-schema-changes.md @@ -0,0 +1,23 @@ +--- +title: Making schema changes +--- + +Some backend changes might require new/different fields or remove other fields. To create a new schema after changing a Serializer, run `make gen-build`. + +This will update the `schema.yml` file in the root of the repository. + +## Building the Go Client + +The Go client is used by the Outpost to communicate with the backend authentik server. To build the go client, run `make gen-outpost`. + +The generated files are stored in `/api` in the root of the repository. + +## Building the Web Client + +The web client is used by the web-interface and web-FlowExecutor to communicate with authentik. To build the client, run `make gen-web`. + +Since the client is normally distributed as an npm package, running `make gen-web` will overwrite the locally installed client with the newly built one. + +:::warning +Running `npm i` in the `/web` folder after using `make gen-web` will overwrite the custom client and revert to the upstream client. +::: diff --git a/website/sidebarsDev.js b/website/sidebarsDev.js index dd46082f4..0435711d5 100644 --- a/website/sidebarsDev.js +++ b/website/sidebarsDev.js @@ -12,6 +12,10 @@ module.exports = { type: "doc", id: "frontend-only-dev-environment", }, + { + type: "doc", + id: "making-schema-changes", + }, { type: "doc", id: "api",