Skip to content

Commit

Permalink
Use openapi to generate wrapper
Browse files Browse the repository at this point in the history
* added generation from openapi

* added tags

* add generation of openapi.json, swith to openapi example in update.ts
  • Loading branch information
kilork authored Mar 23, 2024
1 parent aa4d27f commit 3e6443b
Show file tree
Hide file tree
Showing 10 changed files with 15,292 additions and 448 deletions.
39 changes: 33 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,48 @@ repository = "https://github.com/kilork/keycloak"
rust-version = "1.58"

[features]
default = ["rc", "tags-all"]
schemars = ["dep:schemars"]
rc = ["rc-map", "rc-str", "rc-val", "rc-vec"]
rc-map = ["serde/rc"]
rc-str = ["serde/rc"]
rc-val = ["serde/rc"]
rc-vec = ["serde/rc"]
tags-all = ["tag-attack-detection", "tag-authentication-management", "tag-client-attribute-certificate", "tag-client-initial-access", "tag-client-registration-policy", "tag-client-role-mappings", "tag-client-scopes", "tag-clients", "tag-component", "tag-groups", "tag-identity-providers", "tag-key", "tag-protocol-mappers", "tag-realms-admin", "tag-role-mapper", "tag-roles", "tag-roles-by-id", "tag-scope-mappings", "tag-users"]
tag-attack-detection = []
tag-authentication-management = []
tag-client-attribute-certificate = []
tag-client-initial-access = []
tag-client-registration-policy = []
tag-client-role-mappings = []
tag-client-scopes = []
tag-clients = []
tag-component = []
tag-groups = []
tag-identity-providers = []
tag-key = []
tag-protocol-mappers = []
tag-realms-admin = []
tag-role-mapper = []
tag-roles = []
tag-roles-by-id = []
tag-scope-mappings = []
tag-users = []

[dependencies]
reqwest = { version = "0.11", default-features = false, features = ["json"] }
reqwest = { version = "0.12", default-features = false, features = ["json"] }
serde_json = "1"
serde = { version = "1", features = ["derive"] }
serde_with = "2"
serde_with = "3"
async-trait = "0.1"
schemars = { version = "0.8.11", default-features = false, features = [
"derive",
], optional = true }

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
scraper = "0.15"
heck = "0.4"
structopt = "0.3"
toml = "0.7"
scraper = "0.19"
heck = "0.5"
clap = { version = "4", features = ["derive", "std"], default-features = false }
toml = "0.8"
indexmap = { version = "2", features = ["serde"] }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ Example: official version `13.0.1` is `13.0.100` for crate version. `13.0.102` m
To update current version use provided [update.ts](./update.ts) `deno` script:

```sh
deno run --allow-env=KEYCLOAK_RUST_VERSION,KEYCLOAK_VERSION,KEYCLOAK_RUST_MAJOR_VERSION --allow-read=Cargo.toml --allow-write=Cargo.toml,docs/rest-api.html,src/types.rs,src/rest/generated_rest.rs --allow-net=keycloak.org,www.keycloak.org --allow-run=cargo,gh,git update.ts
deno run --allow-env=KEYCLOAK_RUST_VERSION,KEYCLOAK_VERSION,KEYCLOAK_RUST_MAJOR_VERSION --allow-read=Cargo.toml --allow-write=Cargo.toml,docs/rest-api.html,src/types.rs,src/rest/generated_rest.rs --allow-net=keycloak.org,www.keycloak.org --allow-run=cargo,docker,gh,git,handlebars-magic update.ts
```
21 changes: 21 additions & 0 deletions docker/Dockerfile.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM eclipse-temurin:17 as build-prepare

RUN apt-get update && apt-get install -y git maven

FROM build-prepare as build

ARG VERSION=22.0.5

RUN --mount=type=cache,target=/root/.m2/ git clone \
--config core.symlinks=true \
--depth 1 \
--branch ${VERSION} \
https://github.com/keycloak/keycloak.git && \
cd /keycloak && \
./mvnw -pl quarkus/deployment,quarkus/dist -am -DskipTests clean install && \
cd services && \
mvn -s ../maven-settings.xml -Pjboss-release -DskipTests clean package

FROM scratch

COPY --from=build /keycloak/services/target/apidocs-rest/swagger/apidocs/openapi.json .
Loading

0 comments on commit 3e6443b

Please sign in to comment.