* Closes: https://github.com/keycloak/keycloak/issues/47472
* Problem with 'update' command is that it is misleading, therefore the command we generate for 'PUT' HTTP method, which either creates or updates a resource, is now called 'apply'.
* The '--uuid' option is removed from commands
Signed-off-by: Michal Vavřík <michal.vavrik@aol.com>
* fix: minimizing the dependencies for the rest module
closes: #48114
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
* renaming the modules
also remove jsonnode logic from the oas filter and the databind
dependency
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
* addressing review comments
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
---------
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
* Closes: https://github.com/keycloak/keycloak/issues/47171
* Adds information about autocomplete to the v2 help
**More about OpenAPI document fetching:**
When Admin CLI is used with a different Keycloak server version, we need to update help and autocomplete according to OpenAPI document, which describes what endpoints and schemas can be used. This can only be done when the Keycloak server has enabled (currently experimental) OpenAPI feature and users specify OpenAPI path. The management path and port can be changed by user, therefore we ask them to specify OpenAPI URL entirely.
This feature is only provided for the current session (when user is logged in into some server). We cannot easily provide help and autocomplete based on inline arguments like `--server` because it is bit chicken-egg problem (injected options are available after you provided command to PicoCLI, so we would need to do a lot manually).
Here is how it works:
```bash
mvavrik@fedora:~/sources/keycloak$ kcadm.sh --v2 config credentials --server http://localhost:8080 --realm master --user admin --password admin
Logging into http://localhost:8080 as user admin of realm master
OpenAPI descriptor cached for http://localhost:8080 (version 999.0.0-SNAPSHOT)
```
or for non-default management port:
```bash
mvavrik@fedora:~/sources/keycloak$ kcadm.sh --v2 config credentials --server http://localhost:8080 --realm master --user admin --password admin
Logging into http://localhost:8080 as user admin of realm master
mvavrik@fedora:~/sources/keycloak$ kcadm.sh --v2 config openapi http://localhost:9004/openapi
OpenAPI descriptor cached for http://localhost:8080 (version 999.0.0-SNAPSHOT)
```
or alternatively:
```bash
mvavrik@fedora:~/sources/keycloak$ kcadm.sh --v2 config credentials --server http://localhost:8080 --realm master --user admin --password admin --openapi-url http://localhost:9004/openapi
Logging into http://localhost:8080 as user admin of realm master
OpenAPI descriptor cached for http://localhost:8080 (version 999.0.0-SNAPSHOT)
```
After that, command structure reflects the OpenAPI document, including help and autocomplete. If you switch server using `config credentials`, command changes as well. If the server you are communicating does not provide OpenAPI endpoint, we silently fallback to the default OpenAPI document (bundled with the command). However,
the `kcadm.sh --v2 config openapi` fails if the OpenAPI endpoint wasn't available.
Signed-off-by: Michal Vavřík <michal.vavrik@aol.com>
* Require clientId in the payload
Closes#47524
Signed-off-by: Martin Bartoš <mabartos@redhat.com>
* Require 'protocol' field to be specified
Closes#47579
Signed-off-by: Martin Bartoš <mabartos@redhat.com>
* Client API v2 CLI Client: Jakarta validation errors are not handled
Closes#47574
Signed-off-by: Martin Bartoš <mabartos@redhat.com>
* Use getRequest() for POST in test
Signed-off-by: Martin Bartoš <mabartos@redhat.com>
---------
Signed-off-by: Martin Bartoš <mabartos@redhat.com>
* Closes: https://github.com/keycloak/keycloak/issues/47166
* Closes: https://github.com/keycloak/keycloak/issues/47311
Provides basic Client API v2 CLI client.
Supports:
- client operations: create, patch, list, delete, get, update
- authetication options matching those of v1 CLI
Omitted changes:
- documentation, we do not advertise this new client and it is hidden behind `--v2` flag that is not mentioned anywhere in doc or help, hence invisible; until we implement remaining https://github.com/keycloak/keycloak/issues/45366 tasks
- "config" subcommand is shared between v1 and v2, hence its printed "help" follows the v1 style to keep status quo
Signed-off-by: Michal Vavřík <michal.vavrik@aol.com>
* fix: replace aesh with picocli
closes: #27388
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
* Update integration/client-cli/admin-cli/src/main/java/org/keycloak/client/admin/cli/commands/AbstractRequestCmd.java
Co-authored-by: Martin Bartoš <mabartos@redhat.com>
* splitting the error handling for password input
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
* adding a change note about kcadm
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
* Update docs/documentation/upgrading/topics/changes/changes-25_0_0.adoc
Co-authored-by: Martin Bartoš <mabartos@redhat.com>
---------
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Co-authored-by: Martin Bartoš <mabartos@redhat.com>
* allows csv output to handle missing requested fields
Closes#12330
* fixes the handling of the content type
also makes it more explicit the expectation of applying csv and return
fields
* fix: consolidating the logic dealing with the content-type
Closes#23580
* Use a valid SemVer format for the SNAPSHOT version
* Update pom.xml
* Update pom.xml
---------
Co-authored-by: Stian Thorgersen <stianst@gmail.com>
Co-authored-by: Stian Thorgersen <stian@redhat.com>