mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 04:27:02 +01:00
Fixing dependabot and its mistakes (#2232)
* updating to utoipa 4.0.0 * hi dependabot
This commit is contained in:
parent
4757ed8a50
commit
eead47aec8
170
.github/dependabot.yml
vendored
170
.github/dependabot.yml
vendored
|
@ -8,6 +8,10 @@ updates:
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: pip
|
- package-ecosystem: pip
|
||||||
directory: "/pykanidm"
|
directory: "/pykanidm"
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -15,6 +19,10 @@ updates:
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -22,20 +30,32 @@ updates:
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/kanidm_client"
|
directory: "/libs/client"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/kanidm_proto"
|
directory: "/proto"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/server/core"
|
directory: "/server/core"
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -43,13 +63,65 @@ updates:
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/server/score"
|
directory: "/server/testkit"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/server/testkit-macros"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "06:00"
|
||||||
|
timezone: Australia/Brisbane
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/libs/crypto"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "06:00"
|
||||||
|
timezone: Australia/Brisbane
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/server/lib"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "06:00"
|
||||||
|
timezone: Australia/Brisbane
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/server/lib-macros"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "06:00"
|
||||||
|
timezone: Australia/Brisbane
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/server/daemon"
|
directory: "/server/daemon"
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -57,6 +129,10 @@ updates:
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/tools/cli"
|
directory: "/tools/cli"
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -64,6 +140,10 @@ updates:
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/server/web_ui"
|
directory: "/server/web_ui"
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -71,47 +151,115 @@ updates:
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/kanidm_unix_int"
|
directory: "/unix_integration"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/kanidm_unix_int/nss_kanidm"
|
directory: "/unix_integration/nss_kanidm"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/kanidm_unix_int/pam_kanidm"
|
directory: "/unix_integration/pam_kanidm"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/kanidm_unix_int/pam_tester"
|
directory: "/tools/orca"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/orca"
|
directory: "/libs/file_permissions"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/profiles"
|
directory: "/libs/profiles"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/libs/sketching"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "06:00"
|
||||||
|
timezone: Australia/Brisbane
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/libs/user"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "06:00"
|
||||||
|
timezone: Australia/Brisbane
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/tools/iam_migrations/ldap"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "06:00"
|
||||||
|
timezone: Australia/Brisbane
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/tools/iam_migrations/freeipa"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "06:00"
|
||||||
|
timezone: Australia/Brisbane
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
# Maintain dependencies for GitHub Actions
|
# Maintain dependencies for GitHub Actions
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
|
@ -120,3 +268,7 @@ updates:
|
||||||
time: "06:00"
|
time: "06:00"
|
||||||
timezone: Australia/Brisbane
|
timezone: Australia/Brisbane
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
|
groups:
|
||||||
|
all: # group all the things
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
16
.github/workflows/rust_build.yml
vendored
16
.github/workflows/rust_build.yml
vendored
|
@ -17,6 +17,11 @@ concurrency:
|
||||||
jobs:
|
jobs:
|
||||||
rust_build:
|
rust_build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
SCCACHE_GHA_ENABLED: true
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
|
@ -38,10 +43,21 @@ jobs:
|
||||||
run: cargo build --workspace
|
run: cargo build --workspace
|
||||||
- name: "Build the idv-tui feature kanidm binary"
|
- name: "Build the idv-tui feature kanidm binary"
|
||||||
run: cargo build --bin kanidm --features idv-tui
|
run: cargo build --bin kanidm --features idv-tui
|
||||||
|
- name: "Check disk space and size of target, then clean it"
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
du -sh target/
|
||||||
|
rm -rf target/*
|
||||||
|
|
||||||
- name: "Run cargo test"
|
- name: "Run cargo test"
|
||||||
run: cargo test
|
run: cargo test
|
||||||
run_release:
|
run_release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
SCCACHE_GHA_ENABLED: true
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
|
|
34
Cargo.lock
generated
34
Cargo.lock
generated
|
@ -2952,7 +2952,7 @@ dependencies = [
|
||||||
"tracing",
|
"tracing",
|
||||||
"url",
|
"url",
|
||||||
"urlencoding",
|
"urlencoding",
|
||||||
"utoipa 3.5.0",
|
"utoipa",
|
||||||
"uuid",
|
"uuid",
|
||||||
"webauthn-rs-proto",
|
"webauthn-rs-proto",
|
||||||
]
|
]
|
||||||
|
@ -3082,7 +3082,7 @@ dependencies = [
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"url",
|
"url",
|
||||||
"urlencoding",
|
"urlencoding",
|
||||||
"utoipa 3.5.0",
|
"utoipa",
|
||||||
"utoipa-swagger-ui",
|
"utoipa-swagger-ui",
|
||||||
"uuid",
|
"uuid",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
|
@ -5712,18 +5712,6 @@ version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
|
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "utoipa"
|
|
||||||
version = "3.5.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d82b1bc5417102a73e8464c686eef947bdfb99fcdfc0a4f228e81afa9526470a"
|
|
||||||
dependencies = [
|
|
||||||
"indexmap 2.0.2",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"utoipa-gen 3.5.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "utoipa"
|
name = "utoipa"
|
||||||
version = "4.0.0"
|
version = "4.0.0"
|
||||||
|
@ -5733,20 +5721,7 @@ dependencies = [
|
||||||
"indexmap 2.0.2",
|
"indexmap 2.0.2",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"utoipa-gen 4.0.0",
|
"utoipa-gen",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "utoipa-gen"
|
|
||||||
version = "3.5.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "05d96dcd6fc96f3df9b3280ef480770af1b7c5d14bc55192baa9b067976d920c"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro-error",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"regex",
|
|
||||||
"syn 2.0.38",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -5758,6 +5733,7 @@ dependencies = [
|
||||||
"proc-macro-error",
|
"proc-macro-error",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
"regex",
|
||||||
"syn 2.0.38",
|
"syn 2.0.38",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -5773,7 +5749,7 @@ dependencies = [
|
||||||
"rust-embed",
|
"rust-embed",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"utoipa 4.0.0",
|
"utoipa",
|
||||||
"zip",
|
"zip",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,8 @@ tss-esapi = "^7.4.0"
|
||||||
url = "^2.4.1"
|
url = "^2.4.1"
|
||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
users = "^0.11.0"
|
users = "^0.11.0"
|
||||||
utoipa = "3.5.0"
|
utoipa = "4.0.0"
|
||||||
|
utoipa-swagger-ui = "4.0.0"
|
||||||
uuid = "^1.4.1"
|
uuid = "^1.4.1"
|
||||||
|
|
||||||
wasm-bindgen = "^0.2.86"
|
wasm-bindgen = "^0.2.86"
|
||||||
|
|
|
@ -7,20 +7,27 @@ fi
|
||||||
|
|
||||||
PR_URL="$1"
|
PR_URL="$1"
|
||||||
|
|
||||||
# are we good?
|
|
||||||
CONCLUSIONS="$(gh pr status --json statusCheckRollup | jq '.currentBranch | .[] | .[] | select(.conclusion != "SUCCESS") | select(.conclusion != "NEUTRAL")| {status: .status, workfFlowName: .workFlowName, conclusion: .conclusion}')"
|
|
||||||
# check approval
|
|
||||||
APPROVED="$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)"
|
|
||||||
|
|
||||||
# sets the upstream metadata for `gh pr status`
|
# sets the upstream metadata for `gh pr status`
|
||||||
gh pr checkout "$PR_URL"
|
gh pr checkout "$PR_URL"
|
||||||
if [ "${APPROVED}" != "APPROVED" ]; then
|
|
||||||
echo "PR not approved!"
|
|
||||||
exit 1
|
# are we good?
|
||||||
fi
|
echo "Checking Conclusions"
|
||||||
|
CONCLUSIONS="$(gh pr status --json statusCheckRollup | jq '.currentBranch | .[] | .[] | select(.conclusion != "SUCCESS") | select(.conclusion != "NEUTRAL")| {status: .status, workfFlowName: .workFlowName, conclusion: .conclusion}')"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$(echo "${CONCLUSIONS}" | wc -l)" -eq 0 ]; then
|
if [ "$(echo "${CONCLUSIONS}" | wc -l)" -eq 0 ]; then
|
||||||
gh pr review --approve "$PR_URL"
|
gh pr review --approve "$PR_URL"
|
||||||
else
|
else
|
||||||
echo "Already running or failed: ${CONCLUSIONS}";
|
echo "Already running or failed: ${CONCLUSIONS}";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${APPROVED}" != "APPROVED" ]; then
|
||||||
|
echo "PR isn't approved!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check approval
|
||||||
|
echo "Checking if already approved...."
|
||||||
|
APPROVED="$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)"
|
|
@ -67,7 +67,7 @@ utoipa = { workspace = true, features = [
|
||||||
"openapi_extensions",
|
"openapi_extensions",
|
||||||
"preserve_order", # Preserve order of properties when serializing the schema for a component.
|
"preserve_order", # Preserve order of properties when serializing the schema for a component.
|
||||||
] }
|
] }
|
||||||
utoipa-swagger-ui = { version = "4.0.0", features = ["axum"] }
|
utoipa-swagger-ui = { workspace = true, features = ["axum"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
walkdir = { workspace = true }
|
walkdir = { workspace = true }
|
||||||
|
|
|
@ -238,12 +238,7 @@ pub(crate) struct ApiDoc;
|
||||||
|
|
||||||
pub(crate) fn router() -> Router<ServerState> {
|
pub(crate) fn router() -> Router<ServerState> {
|
||||||
Router::new()
|
Router::new()
|
||||||
.route("/docs", get(Redirect::temporary("/docs/swagger-ui")))
|
.route("/docs", get(Redirect::temporary("/docs/swagger-ui")))
|
||||||
.route("/docs/", get(Redirect::temporary("/docs/swagger-ui")))
|
.route("/docs/", get(Redirect::temporary("/docs/swagger-ui")))
|
||||||
.merge(
|
.merge(SwaggerUi::new("/docs/swagger-ui").url("/docs/v1/openapi.json", ApiDoc::openapi()))
|
||||||
SwaggerUi::new("/docs/swagger-ui").url(
|
|
||||||
"/docs/v1/openapi.json",
|
|
||||||
<ApiDoc as utoipa::OpenApi>::openapi(),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
21
server/testkit/tests/apidocs.rs
Normal file
21
server/testkit/tests/apidocs.rs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use tracing::info;
|
||||||
|
|
||||||
|
#[kanidmd_testkit::test]
|
||||||
|
async fn check_that_the_swagger_api_loads(rsclient: kanidm_client::KanidmClient) {
|
||||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
struct OpenAPIResponse {
|
||||||
|
pub openapi: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
rsclient.set_token("".into()).await;
|
||||||
|
info!("Running test: check_that_the_swagger_api_loads");
|
||||||
|
let url = rsclient.make_url("/docs/v1/openapi.json");
|
||||||
|
let foo: OpenAPIResponse = reqwest::get(url)
|
||||||
|
.await
|
||||||
|
.expect("Failed to get openapi.json")
|
||||||
|
.json()
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
assert!(foo.openapi != "1.2.3");
|
||||||
|
}
|
Loading…
Reference in a new issue