- JavaScript 54.1%
- Go 41%
- Just 2.2%
- HTML 1.6%
- Dockerfile 1.1%
|
All checks were successful
build / image (push) Successful in 40s
Reviewed-on: #6 |
||
|---|---|---|
| .forgejo/workflows | ||
| console | ||
| console-test | ||
| .dockerignore | ||
| .gitignore | ||
| config.go | ||
| config_test.go | ||
| console.go | ||
| definition.yaml | ||
| definition_test.go | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| Justfile | ||
| LICENSE | ||
| main.go | ||
| mise.toml | ||
| plugin.go | ||
| plugin_test.go | ||
| README.md | ||
| roles.go | ||
| roles_test.go | ||
Keycloak
A fundament plugin to manage authentication and authorization
A Fundament plugin named
keycloak, scaffolded with functl plugin create.
Layout
| Path | What it is |
|---|---|
definition.yaml |
The plugin manifest: metadata, RBAC, console menu and components |
plugin.go |
The plugin itself |
main.go |
Hands the plugin to the SDK runtime |
Justfile |
Build, test, lint and image recipes |
mise.toml |
Pinned tool versions (Go, just, skaffold, kubectl) |
LICENSE |
EUPL-1.2 |
Develop
Tool versions are pinned in mise.toml. With mise
installed, mise install gets Go, just, skaffold and
kubectl at the versions this project expects. Recipes live in the
Justfile; run just --list to see them all.
go mod tidy # needs network access, or a warm module cache
just build
just test
Image builds need the docker buildx plugin (with Homebrew and Colima:
brew install docker-buildx):
just docker # linux/amd64 image, also on an Apple Silicon Mac
PLATFORM=linux/arm64 just docker # for an arm64 cluster
Hot reload
functl plugin dev runs the plugin in the Fundament plugin sandbox and rebuilds
it when you save Go source, go.mod or go.sum. Changes to
definition.yaml need a restart of functl plugin dev. Prerequisites: the sandbox cluster, docker,
skaffold, kubectl, and a functl auth login session. Set up the sandbox as described in
https://github.com/fundament-oss/fundament/blob/master/docs/developer/plugins/testing-plugins-locally.md.
functl plugin dev # deletes the dev installation on Ctrl-C
functl plugin dev --no-cleanup # keeps it after exit
functl plugin dev-down # removes a leftover dev installation
Config values for spec.config (the keys in definition.yaml's configSchema)
come from --set KEY=VALUE (repeatable) or a --config YAML file; --set wins.
functl checks them against the schema before building, including required keys.
functl plugin dev --set MY_KEY=value # MY_KEY declared in configSchema
functl plugin dev --config dev-config.yaml # MY_KEY: value
Fill in
definition.yaml:spec.permissions.rbacdecides what the plugin may do in the cluster. It is materialised verbatim as a ClusterRole, so grant only what the plugin uses. The rules that ship are only what Helm itself needs to install a release; uncomment the commented blocks for the kinds of object your chart creates.plugin.go: pointrepoURL,chartNameandchartVersionat the chart you install, and list its CRDs inexpectedCRDs.- Every
TODOmarker in this project.
metadata.license says EUPL-1.2, and LICENSE holds its text. If that
file says TODO, functl plugin create had no text for the licence you chose --
paste it in, or re-create with one of MIT, Apache-2.0, GPL-3.0-only or EUPL-1.2.
Publish
Publishing a standalone plugin is not supported yet. Today a plugin
definition is published from inside the Fundament monorepo with
just plugin-publish, which requires the plugin to live under plugins/ and to
have a catalog entry in the appstore. Until functl plugin publish exists, you
can build and run this plugin, but not install it into a Fundament cluster.
Docs
https://github.com/fundament-oss/fundament/tree/master/docs/developer/plugins