Liking cljdoc? Tell your friends :D

keycloak.starter


-mainclj

(-main & args)
source

CLI_CONFIGclj

source

create-mappers!clj

(create-mappers! keycloak-client realm-name client-id mappers)
source

dissoc-sensitive-dataclj

(dissoc-sensitive-data config-data)
source

edn-resources-bindingsclj

(edn-resources-bindings resources-dir)
source

export-jsonclj

(export-json export-dir export-file-without-extension client-id path secrets)
source

export-secret-in-files!clj

(export-secret-in-files! keycloak-client
                         realm-name
                         client-id
                         {:keys [name-without-extension export-dir path]
                          :as secret-file})
source

export-secret-in-vault!cljmultimethod

take the vendor value to dispatch the call to proper function, other value are specific to vault implementation:

  • :hashicorp: in infra-context, [:vault :path] is a string with placeholders as: %1$s is the environment, %2$s is the color, %3$s is the base-domains, %4$s is the client-id (client-id depends of your realm-config.clj code)
  • :gcp-sm: the vault entry of infra-contect must contains project-id and secret-id, also the google_application_credentials must be properly defined and available at runtime
take the vendor value to dispatch the call to proper function, other value are specific to vault implementation:
- `:hashicorp`: in infra-context, [:vault :path] is a string with placeholders as: %1$s is the environment, %2$s is the color, %3$s is the base-domains, %4$s is the client-id (client-id depends of your realm-config.clj code)
- `:gcp-sm`: the vault entry of infra-contect must contains project-id and secret-id, also the google_application_credentials must be properly defined and available at runtime 
sourceraw docstring

export-yamlclj

(export-yaml export-dir export-file-without-extension client-id path secrets)
source

gen-users!clj

(gen-users! admin-client realm-name {:keys [groups] :as data})
source

generate-userclj

(generate-user username-creator-fn role group subgroup idx & opts)
source

init!clj

(init! admin-client data infra-context & [opts])

Create a structure of keycloak entities (realm, clients, roles) and fill it with groups and users. Arguments are:

  • admin-client: admin client's Keycloak object obtained with: (keycloak.deployment/keycloak-client (keycloak.deployment/client-conf "http://localhost:8090" "master" "admin-cli") admin-login admin-password)
  • data: the configuration data with keys realm, roles, groups and users (see the documentation for more details https://cljdoc.org/d/keycloak-clojure/keycloak-clojure/1.18.0/doc/administrative-tasks#declarative-creation-of-keycloak-objects)
  • infra-context: a description of the keycloak infrastructure, the keys needed here is the :vault for secret export during clients creation
  • opts: with two boolean entries dry-run? and apply-deletions?, respectively not applying the detected steps for attaining the desired state in data and whether the steps should delete the entities in Keycloak not in that state (sort of a very strict mode)
Create a structure of keycloak entities (realm, clients, roles) and fill it with groups and users. Arguments are:
* `admin-client`: [admin client's _Keycloak_ object](https://www.keycloak.org/docs-api/11.0/javadocs/org/keycloak/admin/client/Keycloak.html) obtained with:  `(keycloak.deployment/keycloak-client (keycloak.deployment/client-conf "http://localhost:8090" "master"  "admin-cli") admin-login admin-password)`
* `data`: the configuration data with keys `realm`, `roles`, `groups` and `users` (see the documentation for more details https://cljdoc.org/d/keycloak-clojure/keycloak-clojure/1.18.0/doc/administrative-tasks#declarative-creation-of-keycloak-objects)
* `infra-context`: a description of the keycloak infrastructure, the keys needed here is the :vault for secret export during clients creation
* `opts`: with two boolean entries `dry-run?` and `apply-deletions?`, respectively not applying the detected steps for attaining the desired state in `data` and whether the steps should delete the entities in Keycloak not in that state (sort of a very strict mode)
sourceraw docstring

init-cli!clj

(init-cli! args)
source

init-cli-optsclj

source

init-clients!clj

(init-clients! admin-client realm-name clients-data infra-context)
source

init-realm!clj

(init-realm! admin-client
             {:keys [name themes login tokens smtp user-admin] :as realm-data})
source

init-roles!clj

(init-roles! admin-client realm-name roles-data)
source

init-users!clj

(init-users! admin-client realm-name users-data & [opts])
source

keycloak-auth-server-urlclj

(keycloak-auth-server-url protocol host port)
source

process-argsclj

(process-args {:keys [realm-config infra-context] :as args})
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close