0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-04-01 02:42:49 -05:00

Merge remote-tracking branch 'dani/main' into sso-support

This commit is contained in:
Timshel 2025-03-24 17:50:26 +01:00
commit 2c8027b0d2
21 changed files with 677 additions and 319 deletions

View file

@ -80,7 +80,7 @@ jobs:
# Only install the clippy and rustfmt components on the default rust-toolchain
- name: "Install rust-toolchain version"
uses: dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c # master @ Jan 30, 2025, 8:16 PM GMT+1
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # master @ Mar 18, 2025, 8:14 PM GMT+1
if: ${{ matrix.channel == 'rust-toolchain' }}
with:
toolchain: "${{steps.toolchain.outputs.RUST_TOOLCHAIN}}"
@ -90,7 +90,7 @@ jobs:
# Install the any other channel to be used for which we do not execute clippy and rustfmt
- name: "Install MSRV version"
uses: dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c # master @ Jan 30, 2025, 8:16 PM GMT+1
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # master @ Mar 18, 2025, 8:14 PM GMT+1
if: ${{ matrix.channel != 'rust-toolchain' }}
with:
toolchain: "${{steps.toolchain.outputs.RUST_TOOLCHAIN}}"
@ -115,7 +115,7 @@ jobs:
# Enable Rust Caching
- name: Rust Caching
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
# Use a custom prefix-key to force a fresh start. This is sometimes needed with bigger changes.
# Like changing the build host from Ubuntu 20.04 to 22.04 for example.

View file

@ -14,7 +14,7 @@ jobs:
steps:
# Start Docker Buildx
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
# https://github.com/moby/buildkit/issues/3969
# Also set max parallelism to 2, the default of 4 breaks GitHub Actions and causes OOMKills
with:

View file

@ -70,13 +70,13 @@ jobs:
steps:
- name: Initialize QEMU binfmt support
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
platforms: "arm64,arm"
# Start Docker Buildx
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
# https://github.com/moby/buildkit/issues/3969
# Also set max parallelism to 2, the default of 4 breaks GitHub Actions and causes OOMKills
with:
@ -120,7 +120,7 @@ jobs:
# Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
@ -136,7 +136,7 @@ jobs:
# Login to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@ -153,7 +153,7 @@ jobs:
# Login to Quay.io
- name: Login to Quay.io
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
@ -192,7 +192,7 @@ jobs:
- name: Bake ${{ matrix.base_image }} containers
id: bake_vw
uses: docker/bake-action@7bff531c65a5cda33e52e43950a795b91d450f63 # v6.3.0
uses: docker/bake-action@4ba453fbc2db7735392b93edf935aaf9b1e8f747 # v6.5.0
env:
BASE_TAGS: "${{ env.BASE_TAGS }}"
SOURCE_COMMIT: "${{ env.SOURCE_COMMIT }}"
@ -220,7 +220,7 @@ jobs:
# Attest container images
- name: Attest - docker.io - ${{ matrix.base_image }}
if: ${{ env.HAVE_DOCKERHUB_LOGIN == 'true' && steps.bake_vw.outputs.metadata != ''}}
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
with:
subject-name: ${{ vars.DOCKERHUB_REPO }}
subject-digest: ${{ env.DIGEST_SHA }}
@ -228,7 +228,7 @@ jobs:
- name: Attest - ghcr.io - ${{ matrix.base_image }}
if: ${{ env.HAVE_GHCR_LOGIN == 'true' && steps.bake_vw.outputs.metadata != ''}}
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
with:
subject-name: ${{ vars.GHCR_REPO }}
subject-digest: ${{ env.DIGEST_SHA }}
@ -236,7 +236,7 @@ jobs:
- name: Attest - quay.io - ${{ matrix.base_image }}
if: ${{ env.HAVE_QUAY_LOGIN == 'true' && steps.bake_vw.outputs.metadata != ''}}
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
with:
subject-name: ${{ vars.QUAY_REPO }}
subject-digest: ${{ env.DIGEST_SHA }}
@ -290,31 +290,31 @@ jobs:
# Upload artifacts to Github Actions and Attest the binaries
- name: "Upload amd64 artifact ${{ matrix.base_image }}"
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4.6.1
with:
name: vaultwarden-${{ env.SOURCE_VERSION }}-linux-amd64-${{ matrix.base_image }}
path: vaultwarden-amd64-${{ matrix.base_image }}
- name: "Upload arm64 artifact ${{ matrix.base_image }}"
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4.6.1
with:
name: vaultwarden-${{ env.SOURCE_VERSION }}-linux-arm64-${{ matrix.base_image }}
path: vaultwarden-arm64-${{ matrix.base_image }}
- name: "Upload armv7 artifact ${{ matrix.base_image }}"
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4.6.1
with:
name: vaultwarden-${{ env.SOURCE_VERSION }}-linux-armv7-${{ matrix.base_image }}
path: vaultwarden-armv7-${{ matrix.base_image }}
- name: "Upload armv6 artifact ${{ matrix.base_image }}"
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4.6.1
with:
name: vaultwarden-${{ env.SOURCE_VERSION }}-linux-armv6-${{ matrix.base_image }}
path: vaultwarden-armv6-${{ matrix.base_image }}
- name: "Attest artifacts ${{ matrix.base_image }}"
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
with:
subject-path: vaultwarden-*
# End Upload artifacts to Github Actions

View file

@ -36,7 +36,7 @@ jobs:
persist-credentials: false
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # v0.29.0
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
env:
TRIVY_DB_REPOSITORY: docker.io/aquasec/trivy-db:2,public.ecr.aws/aquasecurity/trivy-db:2,ghcr.io/aquasecurity/trivy-db:2
TRIVY_JAVA_DB_REPOSITORY: docker.io/aquasec/trivy-java-db:1,public.ecr.aws/aquasecurity/trivy-java-db:1,ghcr.io/aquasecurity/trivy-java-db:1

View file

@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-json

326
Cargo.lock generated
View file

@ -200,6 +200,17 @@ dependencies = [
"tracing",
]
[[package]]
name = "async-recursion"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "async-signal"
version = "0.2.10"
@ -465,9 +476,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
[[package]]
name = "cached"
version = "0.54.0"
version = "0.55.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9718806c4a2fe9e8a56fd736f97b340dd10ed1be8ed733ed50449f351dc33cae"
checksum = "b0839c297f8783316fcca9d90344424e968395413f0662a5481f79c6648bbc14"
dependencies = [
"ahash",
"async-trait",
@ -476,16 +487,16 @@ dependencies = [
"futures",
"hashbrown 0.14.5",
"once_cell",
"thiserror 1.0.69",
"thiserror 2.0.12",
"tokio",
"web-time",
]
[[package]]
name = "cached_proc_macro"
version = "0.23.0"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f42a145ed2d10dce2191e1dcf30cfccfea9026660e143662ba5eec4017d5daa"
checksum = "673992d934f0711b68ebb3e1b79cdc4be31634b37c98f26867ced0438ca5c603"
dependencies = [
"darling",
"proc-macro2",
@ -532,9 +543,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.2.16"
version = "1.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c"
checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a"
dependencies = [
"shlex",
]
@ -568,9 +579,9 @@ dependencies = [
[[package]]
name = "chrono-tz"
version = "0.10.1"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c6ac4f2c0bf0f44e9161aec9675e1050aa4a530663c4a9e37e108fa948bca9f"
checksum = "efdce149c370f133a071ca8ef6ea340b7b88748ab0810097a9e2976eaa34b4f3"
dependencies = [
"chrono",
"chrono-tz-build",
@ -579,9 +590,9 @@ dependencies = [
[[package]]
name = "chrono-tz-build"
version = "0.4.0"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e94fea34d77a245229e7746bd2beb786cd2a896f306ff491fb8cecb3074b10a7"
checksum = "8f10f8c9340e31fc120ff885fcdb54a0b48e474bbd77cab557f0c30a3e569402"
dependencies = [
"parse-zoneinfo",
"phf_codegen",
@ -681,6 +692,12 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "critical-section"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
[[package]]
name = "cron"
version = "0.12.1"
@ -701,6 +718,15 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.21"
@ -843,9 +869,9 @@ dependencies = [
[[package]]
name = "deranged"
version = "0.3.11"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058"
dependencies = [
"powerfmt",
"serde",
@ -1444,6 +1470,19 @@ dependencies = [
"windows 0.48.0",
]
[[package]]
name = "generator"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd"
dependencies = [
"cfg-if",
"libc",
"log",
"rustversion",
"windows 0.58.0",
]
[[package]]
name = "generic-array"
version = "0.14.7"
@ -1470,16 +1509,16 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.3.1"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0"
dependencies = [
"cfg-if",
"js-sys",
"libc",
"wasi 0.13.3+wasi-0.2.2",
"r-efi",
"wasi 0.14.2+wasi-0.2.4",
"wasm-bindgen",
"windows-targets 0.52.6",
]
[[package]]
@ -1517,7 +1556,7 @@ dependencies = [
"futures-sink",
"futures-timer",
"futures-util",
"getrandom 0.3.1",
"getrandom 0.3.2",
"no-std-compat",
"nonzero_ext",
"parking_lot",
@ -1649,12 +1688,14 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hickory-proto"
version = "0.24.4"
version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92652067c9ce6f66ce53cc38d1169daa36e6e7eb7dd3b63b5103bd9d97117248"
checksum = "6d844af74f7b799e41c78221be863bade11c430d46042c3b49ca8ae0c6d27287"
dependencies = [
"async-recursion",
"async-trait",
"cfg-if",
"critical-section",
"data-encoding",
"enum-as-inner",
"futures-channel",
@ -1663,8 +1704,9 @@ dependencies = [
"idna",
"ipnet",
"once_cell",
"rand 0.8.5",
"thiserror 1.0.69",
"rand 0.9.0",
"ring",
"thiserror 2.0.12",
"tinyvec",
"tokio",
"tracing",
@ -1673,21 +1715,21 @@ dependencies = [
[[package]]
name = "hickory-resolver"
version = "0.24.4"
version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e"
checksum = "a128410b38d6f931fcc6ca5c107a3b02cabd6c05967841269a4ad65d23c44331"
dependencies = [
"cfg-if",
"futures-util",
"hickory-proto",
"ipconfig",
"lru-cache",
"moka",
"once_cell",
"parking_lot",
"rand 0.8.5",
"rand 0.9.0",
"resolv-conf",
"smallvec",
"thiserror 1.0.69",
"thiserror 2.0.12",
"tokio",
"tracing",
]
@ -1896,16 +1938,17 @@ dependencies = [
[[package]]
name = "iana-time-zone"
version = "0.1.61"
version = "0.1.62"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"log",
"wasm-bindgen",
"windows-core",
"windows-core 0.52.0",
]
[[package]]
@ -2248,9 +2291,9 @@ checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"
[[package]]
name = "libmimalloc-sys"
version = "0.1.39"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44"
checksum = "07d0e07885d6a754b9c7993f2625187ad694ee985d60f23355ff0e7077261502"
dependencies = [
"cc",
"libc",
@ -2267,12 +2310,6 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "linux-raw-sys"
version = "0.4.15"
@ -2309,9 +2346,9 @@ dependencies = [
[[package]]
name = "log"
version = "0.4.26"
version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
dependencies = [
"value-bag",
]
@ -2323,7 +2360,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5"
dependencies = [
"cfg-if",
"generator",
"generator 0.7.5",
"scoped-tls",
"serde",
"serde_json",
@ -2332,12 +2369,16 @@ dependencies = [
]
[[package]]
name = "lru-cache"
version = "0.1.2"
name = "loom"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c"
checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca"
dependencies = [
"linked-hash-map",
"cfg-if",
"generator 0.8.4",
"scoped-tls",
"tracing",
"tracing-subscriber",
]
[[package]]
@ -2386,9 +2427,9 @@ dependencies = [
[[package]]
name = "mimalloc"
version = "0.1.43"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633"
checksum = "99585191385958383e13f6b822e6b6d8d9cf928e7d286ceb092da92b43c87bc1"
dependencies = [
"libmimalloc-sys",
]
@ -2440,6 +2481,25 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "moka"
version = "0.12.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926"
dependencies = [
"crossbeam-channel",
"crossbeam-epoch",
"crossbeam-utils",
"loom 0.7.2",
"parking_lot",
"portable-atomic",
"rustc_version",
"smallvec",
"tagptr",
"thiserror 1.0.69",
"uuid",
]
[[package]]
name = "multer"
version = "3.1.0"
@ -2669,6 +2729,10 @@ name = "once_cell"
version = "1.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc"
dependencies = [
"critical-section",
"portable-atomic",
]
[[package]]
name = "openidconnect"
@ -2849,6 +2913,12 @@ version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "pastey"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3a8cb46bdc156b1c90460339ae6bfd45ba0394e5effbaa640badb4987fdc261"
[[package]]
name = "pear"
version = "0.2.9"
@ -3083,7 +3153,7 @@ version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
dependencies = [
"zerocopy 0.8.23",
"zerocopy 0.8.24",
]
[[package]]
@ -3180,11 +3250,12 @@ dependencies = [
[[package]]
name = "quinn"
version = "0.11.6"
version = "0.11.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef"
checksum = "c3bd15a6f2967aef83887dcb9fec0014580467e33720d073560cf015a5683012"
dependencies = [
"bytes",
"cfg_aliases",
"pin-project-lite",
"quinn-proto",
"quinn-udp",
@ -3194,17 +3265,18 @@ dependencies = [
"thiserror 2.0.12",
"tokio",
"tracing",
"web-time",
]
[[package]]
name = "quinn-proto"
version = "0.11.9"
version = "0.11.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d"
checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc"
dependencies = [
"bytes",
"getrandom 0.2.15",
"rand 0.8.5",
"getrandom 0.3.2",
"rand 0.9.0",
"ring",
"rustc-hash",
"rustls 0.23.25",
@ -3245,6 +3317,12 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "640c9bd8497b02465aeef5375144c26062e0dcd5939dfcbb0f5db76cb8c17c73"
[[package]]
name = "r-efi"
version = "5.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
[[package]]
name = "r2d2"
version = "0.8.10"
@ -3275,7 +3353,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
dependencies = [
"rand_chacha 0.9.0",
"rand_core 0.9.3",
"zerocopy 0.8.23",
"zerocopy 0.8.24",
]
[[package]]
@ -3313,7 +3391,7 @@ version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
dependencies = [
"getrandom 0.3.1",
"getrandom 0.3.2",
]
[[package]]
@ -3411,9 +3489,9 @@ dependencies = [
[[package]]
name = "reqwest"
version = "0.12.14"
version = "0.12.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254"
checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb"
dependencies = [
"async-compression",
"base64 0.22.1",
@ -3691,9 +3769,9 @@ dependencies = [
[[package]]
name = "rustix"
version = "1.0.2"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825"
checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96"
dependencies = [
"bitflags",
"errno",
@ -4171,9 +4249,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "stacker"
version = "0.1.19"
version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9156ebd5870ef293bfb43f91c7a74528d363ec0d424afe24160ed5a4343d08a"
checksum = "601f9201feb9b09c00266478bf459952b9ef9a6b94edb2f21eba14ab681a60a9"
dependencies = [
"cc",
"cfg-if",
@ -4188,7 +4266,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8"
dependencies = [
"loom",
"loom 0.5.6",
]
[[package]]
@ -4275,14 +4353,14 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
[[package]]
name = "tempfile"
version = "3.19.0"
version = "3.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600"
checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf"
dependencies = [
"fastrand",
"getrandom 0.3.1",
"getrandom 0.3.2",
"once_cell",
"rustix 1.0.2",
"rustix 1.0.3",
"windows-sys 0.59.0",
]
@ -4347,9 +4425,9 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.39"
version = "0.3.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8"
checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
dependencies = [
"deranged",
"itoa",
@ -4364,15 +4442,15 @@ dependencies = [
[[package]]
name = "time-core"
version = "0.1.3"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef"
checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"
[[package]]
name = "time-macros"
version = "0.2.20"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c"
checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49"
dependencies = [
"num-conv",
"time-core",
@ -4767,7 +4845,7 @@ version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9"
dependencies = [
"getrandom 0.3.1",
"getrandom 0.3.2",
]
[[package]]
@ -4824,7 +4902,7 @@ dependencies = [
"once_cell",
"openidconnect",
"openssl",
"paste",
"pastey",
"percent-encoding",
"pico-args",
"rand 0.9.0",
@ -4890,9 +4968,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasi"
version = "0.13.3+wasi-0.2.2"
version = "0.14.2+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2"
checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3"
dependencies = [
"wit-bindgen-rt",
]
@ -5093,7 +5171,17 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
"windows-core 0.52.0",
"windows-targets 0.52.6",
]
[[package]]
name = "windows"
version = "0.58.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6"
dependencies = [
"windows-core 0.58.0",
"windows-targets 0.52.6",
]
@ -5107,10 +5195,45 @@ dependencies = [
]
[[package]]
name = "windows-link"
version = "0.1.0"
name = "windows-core"
version = "0.58.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3"
checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"
dependencies = [
"windows-implement",
"windows-interface",
"windows-result 0.2.0",
"windows-strings 0.1.0",
"windows-targets 0.52.6",
]
[[package]]
name = "windows-implement"
version = "0.58.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "windows-interface"
version = "0.58.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "windows-link"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
[[package]]
name = "windows-registry"
@ -5118,20 +5241,39 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3"
dependencies = [
"windows-result",
"windows-strings",
"windows-result 0.3.2",
"windows-strings 0.3.1",
"windows-targets 0.53.0",
]
[[package]]
name = "windows-result"
version = "0.3.1"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189"
checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-result"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252"
dependencies = [
"windows-link",
]
[[package]]
name = "windows-strings"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10"
dependencies = [
"windows-result 0.2.0",
"windows-targets 0.52.6",
]
[[package]]
name = "windows-strings"
version = "0.3.1"
@ -5380,9 +5522,9 @@ checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904"
[[package]]
name = "wit-bindgen-rt"
version = "0.33.0"
version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
dependencies = [
"bitflags",
]
@ -5458,11 +5600,11 @@ dependencies = [
[[package]]
name = "zerocopy"
version = "0.8.23"
version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6"
checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879"
dependencies = [
"zerocopy-derive 0.8.23",
"zerocopy-derive 0.8.24",
]
[[package]]
@ -5478,9 +5620,9 @@ dependencies = [
[[package]]
name = "zerocopy-derive"
version = "0.8.23"
version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154"
checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be"
dependencies = [
"proc-macro2",
"quote",

View file

@ -56,7 +56,7 @@ tracing = { version = "0.1.41", features = ["log"] } # Needed to have lettre and
dotenvy = { version = "0.15.7", default-features = false }
# Lazy initialization
once_cell = "1.20.3"
once_cell = "1.21.1"
# Numerical libraries
num-traits = "0.2.19"
@ -75,14 +75,14 @@ dashmap = "6.1.0"
# Async futures
futures = "0.3.31"
tokio = { version = "1.43.0", features = ["rt-multi-thread", "fs", "io-util", "parking_lot", "time", "signal", "net"] }
tokio = { version = "1.44.1", features = ["rt-multi-thread", "fs", "io-util", "parking_lot", "time", "signal", "net"] }
# A generic serialization/deserialization framework
serde = { version = "1.0.218", features = ["derive"] }
serde_json = "1.0.139"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
# A safe, extensible ORM and Query builder
diesel = { version = "2.2.7", features = ["chrono", "r2d2", "numeric"] }
diesel = { version = "2.2.8", features = ["chrono", "r2d2", "numeric"] }
diesel_migrations = "2.2.0"
diesel_logger = { version = "0.4.0", optional = true }
@ -94,16 +94,16 @@ libsqlite3-sys = { version = "0.31.0", features = ["bundled"], optional = true }
# Crypto-related libraries
rand = "0.9.0"
ring = "0.17.13"
ring = "0.17.14"
subtle = "2.6.1"
# UUID generation
uuid = { version = "1.14.0", features = ["v4"] }
uuid = { version = "1.16.0", features = ["v4"] }
# Date and time libraries
chrono = { version = "0.4.39", features = ["clock", "serde"], default-features = false }
chrono = { version = "0.4.40", features = ["clock", "serde"], default-features = false }
chrono-tz = "0.10.1"
time = "0.3.37"
time = "0.3.40"
# Job scheduler
job_scheduler_ng = "2.0.5"
@ -127,25 +127,25 @@ webauthn-rs = "0.3.2"
url = "2.5.4"
# Email libraries
lettre = { version = "0.11.14", features = ["smtp-transport", "sendmail-transport", "builder", "serde", "tokio1-native-tls", "hostname", "tracing", "tokio1"], default-features = false }
lettre = { version = "0.11.15", features = ["smtp-transport", "sendmail-transport", "builder", "serde", "tokio1-native-tls", "hostname", "tracing", "tokio1"], default-features = false }
percent-encoding = "2.3.1" # URL encoding library used for URL's in the emails
email_address = "0.2.9"
# HTML Template library
handlebars = { version = "6.3.1", features = ["dir_source"] }
handlebars = { version = "6.3.2", features = ["dir_source"] }
# HTTP client (Used for favicons, version check, DUO and HIBP API)
reqwest = { version = "0.12.12", features = ["native-tls-alpn", "stream", "json", "gzip", "brotli", "socks", "cookies"] }
hickory-resolver = "0.24.4"
reqwest = { version = "0.12.15", features = ["native-tls-alpn", "stream", "json", "gzip", "brotli", "socks", "cookies"] }
hickory-resolver = "0.25.1"
# Favicon extraction libraries
html5gum = "0.7.0"
regex = { version = "1.11.1", features = ["std", "perf", "unicode-perl"], default-features = false }
data-url = "0.3.1"
bytes = "1.10.0"
bytes = "1.10.1"
# Cache function results (Used for version check and favicon fetching)
cached = { version = "0.54.0", features = ["async"] }
cached = { version = "0.55.1", features = ["async"] }
# Used for custom short lived cookie jar during favicon extraction
cookie = "0.18.1"
@ -158,19 +158,19 @@ openssl = "0.10.71"
pico-args = "0.5.0"
# Macro ident concatenation
paste = "1.0.15"
governor = "0.8.0"
pastey = "0.1.0"
governor = "0.8.1"
# OIDC for SSO
openidconnect = { version = "4.0.0", features = ["reqwest", "native-tls"] }
mini-moka = "0.10.2"
# Check client versions for specific features.
semver = "1.0.25"
semver = "1.0.26"
# Allow overriding the default memory allocator
# Mainly used for the musl builds, since the default musl malloc is very slow
mimalloc = { version = "0.1.43", features = ["secure"], default-features = false, optional = true }
mimalloc = { version = "0.1.44", features = ["secure"], default-features = false, optional = true }
which = "7.0.2"
# Argon2 library with support for the PHC format
@ -257,6 +257,9 @@ tail_expr_drop_order = "allow"
dbg_macro = "warn"
todo = "warn"
# Ignore/Allow
result_large_err = "allow"
# Deny
case_sensitive_file_extension_comparisons = "deny"
cast_lossless = "deny"

View file

@ -48,8 +48,8 @@ fn main() {
fn run(args: &[&str]) -> Result<String, std::io::Error> {
let out = Command::new(args[0]).args(&args[1..]).output()?;
if !out.status.success() {
use std::io::{Error, ErrorKind};
return Err(Error::new(ErrorKind::Other, "Command not successful"));
use std::io::Error;
return Err(Error::other("Command not successful"));
}
Ok(String::from_utf8(out.stdout).unwrap().trim().to_string())
}

View file

@ -5,7 +5,7 @@ vault_image_digest: "sha256:cb6b2095a4afc1d9d243a33f6d09211f40e3d82c7ae829fd025d
# We use the linux/amd64 platform shell scripts since there is no difference between the different platform scripts
# https://github.com/tonistiigi/xx | https://hub.docker.com/r/tonistiigi/xx/tags
xx_image_digest: "sha256:9c207bead753dda9430bdd15425c6518fc7a03d866103c516a2c6889188f5894"
rust_version: 1.85.0 # Rust version to be used
rust_version: 1.85.1 # Rust version to be used
debian_version: bookworm # Debian release name to be used
alpine_version: "3.21" # Alpine version to be used
# For which platforms/architectures will we try to build images

View file

@ -32,10 +32,10 @@ FROM --platform=linux/amd64 docker.io/vaultwarden/web-vault@sha256:cb6b2095a4afc
########################## ALPINE BUILD IMAGES ##########################
## NOTE: The Alpine Base Images do not support other platforms then linux/amd64
## And for Alpine we define all build images here, they will only be loaded when actually used
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:x86_64-musl-stable-1.85.0 AS build_amd64
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:aarch64-musl-stable-1.85.0 AS build_arm64
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:armv7-musleabihf-stable-1.85.0 AS build_armv7
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:arm-musleabi-stable-1.85.0 AS build_armv6
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:x86_64-musl-stable-1.85.1 AS build_amd64
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:aarch64-musl-stable-1.85.1 AS build_arm64
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:armv7-musleabihf-stable-1.85.1 AS build_armv7
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:arm-musleabi-stable-1.85.1 AS build_armv6
########################## BUILD IMAGE ##########################
# hadolint ignore=DL3006

View file

@ -36,7 +36,7 @@ FROM --platform=linux/amd64 docker.io/tonistiigi/xx@sha256:9c207bead753dda9430bd
########################## BUILD IMAGE ##########################
# hadolint ignore=DL3006
FROM --platform=$BUILDPLATFORM docker.io/library/rust:1.85.0-slim-bookworm AS build
FROM --platform=$BUILDPLATFORM docker.io/library/rust:1.85.1-slim-bookworm AS build
COPY --from=xx / /
ARG TARGETARCH
ARG TARGETVARIANT

View file

@ -1,4 +1,4 @@
[toolchain]
channel = "1.85.0"
channel = "1.85.1"
components = [ "rustfmt", "clippy" ]
profile = "minimal"

View file

@ -618,7 +618,7 @@ async fn has_http_access() -> bool {
use cached::proc_macro::cached;
/// Cache this function to prevent API call rate limit. Github only allows 60 requests per hour, and we use 3 here already.
/// It will cache this function for 300 seconds (5 minutes) which should prevent the exhaustion of the rate limit.
#[cached(time = 300, sync_writes = true)]
#[cached(time = 300, sync_writes = "default")]
async fn get_release_info(has_http_access: bool, running_within_container: bool) -> (String, String, String) {
// If the HTTP Check failed, do not even attempt to check for new versions since we were not able to connect with github.com anyway.
if has_http_access {

View file

@ -104,7 +104,7 @@ macro_rules! make_config {
let mut builder = ConfigBuilder::default();
$($(
builder.$name = make_config! { @getenv paste::paste!(stringify!([<$name:upper>])), $ty };
builder.$name = make_config! { @getenv pastey::paste!(stringify!([<$name:upper>])), $ty };
)+)+
builder
@ -133,7 +133,7 @@ macro_rules! make_config {
builder.$name = v.clone();
if self.$name.is_some() {
overrides.push(paste::paste!(stringify!([<$name:upper>])).into());
overrides.push(pastey::paste!(stringify!([<$name:upper>])).into());
}
}
)+)+
@ -231,7 +231,7 @@ macro_rules! make_config {
element.insert("default".into(), serde_json::to_value(def.$name).unwrap());
element.insert("type".into(), (_get_form_type(stringify!($ty))).into());
element.insert("doc".into(), (_get_doc(concat!($($doc),+))).into());
element.insert("overridden".into(), (overridden.contains(&paste::paste!(stringify!([<$name:upper>])).into())).into());
element.insert("overridden".into(), (overridden.contains(&pastey::paste!(stringify!([<$name:upper>])).into())).into());
element
}),
)+

View file

@ -130,7 +130,7 @@ macro_rules! generate_connections {
DbConnType::$name => {
#[cfg($name)]
{
paste::paste!{ [< $name _migrations >]::run_migrations()?; }
pastey::paste!{ [< $name _migrations >]::run_migrations()?; }
let manager = ConnectionManager::new(&url);
let pool = Pool::builder()
.max_size(CONFIG.database_max_conns())
@ -259,7 +259,7 @@ macro_rules! db_run {
$($(
#[cfg($db)]
$crate::db::DbConnInner::$db($conn) => {
paste::paste! {
pastey::paste! {
#[allow(unused)] use $crate::db::[<__ $db _schema>]::{self as schema, *};
#[allow(unused)] use [<__ $db _model>]::*;
}
@ -280,7 +280,7 @@ macro_rules! db_run {
$($(
#[cfg($db)]
$crate::db::DbConnInner::$db($conn) => {
paste::paste! {
pastey::paste! {
#[allow(unused)] use $crate::db::[<__ $db _schema>]::{self as schema, *};
// @ RAW: #[allow(unused)] use [<__ $db _model>]::*;
}
@ -337,7 +337,7 @@ macro_rules! db_object {
};
( @db $db:ident | $( #[$attr:meta] )* | $name:ident | $( $( #[$field_attr:meta] )* $vis:vis $field:ident : $typ:ty),+) => {
paste::paste! {
pastey::paste! {
#[allow(unused)] use super::*;
#[allow(unused)] use diesel::prelude::*;
#[allow(unused)] use $crate::db::[<__ $db _schema>]::*;

View file

@ -21,7 +21,7 @@ db_object! {
}
}
// https://github.com/bitwarden/server/blob/b86a04cef9f1e1b82cf18e49fc94e017c641130c/src/Core/Enums/PolicyType.cs
// https://github.com/bitwarden/server/blob/abfdf6f5cb0f1f1504dbaaaa0e04ce9cb60faf19/src/Core/AdminConsole/Enums/PolicyType.cs
#[derive(Copy, Clone, Eq, PartialEq, num_derive::FromPrimitive)]
pub enum OrgPolicyType {
TwoFactorAuthentication = 0,
@ -35,6 +35,10 @@ pub enum OrgPolicyType {
ResetPassword = 8,
// MaximumVaultTimeout = 9, // Not supported (Not AGPLv3 Licensed)
// DisablePersonalVaultExport = 10, // Not supported (Not AGPLv3 Licensed)
// ActivateAutofill = 11,
// AutomaticAppLogIn = 12,
// FreeFamiliesSponsorshipPolicy = 13,
RemoveUnlockWithPin = 14,
}
// https://github.com/bitwarden/server/blob/5cbdee137921a19b1f722920f0fa3cd45af2ef0f/src/Core/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs

View file

@ -182,8 +182,8 @@ impl User {
/// * `password` - A str which contains a hashed version of the users master password.
/// * `new_key` - A String which contains the new aKey value of the users master password.
/// * `allow_next_route` - A Option<Vec<String>> with the function names of the next allowed (rocket) routes.
/// These routes are able to use the previous stamp id for the next 2 minutes.
/// After these 2 minutes this stamp will expire.
/// These routes are able to use the previous stamp id for the next 2 minutes.
/// After these 2 minutes this stamp will expire.
///
pub fn set_password(
&mut self,
@ -215,8 +215,8 @@ impl User {
///
/// # Arguments
/// * `route_exception` - A Vec<String> with the function names of the next allowed (rocket) routes.
/// These routes are able to use the previous stamp id for the next 2 minutes.
/// After these 2 minutes this stamp will expire.
/// These routes are able to use the previous stamp id for the next 2 minutes.
/// After these 2 minutes this stamp will expire.
///
pub fn set_stamp_exception(&mut self, route_exception: Vec<String>) {
let stamp_exception = UserStampException {

View file

@ -6,7 +6,7 @@ use std::{
time::Duration,
};
use hickory_resolver::{system_conf::read_system_conf, TokioAsyncResolver};
use hickory_resolver::{name_server::TokioConnectionProvider, TokioResolver};
use once_cell::sync::Lazy;
use regex::Regex;
use reqwest::{
@ -173,7 +173,7 @@ impl std::error::Error for CustomHttpClientError {}
#[derive(Debug, Clone)]
enum CustomDnsResolver {
Default(),
Hickory(Arc<TokioAsyncResolver>),
Hickory(Arc<TokioResolver>),
}
type BoxError = Box<dyn std::error::Error + Send + Sync>;
@ -184,9 +184,9 @@ impl CustomDnsResolver {
}
fn new() -> Arc<Self> {
match read_system_conf() {
Ok((config, opts)) => {
let resolver = TokioAsyncResolver::tokio(config.clone(), opts.clone());
match TokioResolver::builder(TokioConnectionProvider::default()) {
Ok(builder) => {
let resolver = builder.build();
Arc::new(Self::Hickory(Arc::new(resolver)))
}
Err(e) => {

View file

@ -447,7 +447,7 @@ pub async fn exchange_code(wrapped_code: &str, conn: &mut DbConn) -> ApiResult<U
if CONFIG.sso_debug_tokens() {
debug!("Id token: {}", id_token.to_string());
debug!("Access token: {}", token_response.access_token().secret().to_string());
debug!("Access token: {}", token_response.access_token().secret());
debug!("Refresh token: {:?}", token_response.refresh_token().map(|t| t.secret().to_string()));
debug!("Expiration time: {:?}", token_response.expires_in());
}

View file

@ -4,13 +4,12 @@
*
* To rebuild or modify this file with the latest versions of the included
* software please visit:
* https://datatables.net/download/#bs5/dt-2.1.8
* https://datatables.net/download/#bs5/dt-2.2.2
*
* Included libraries:
* DataTables 2.1.8
* DataTables 2.2.2
*/
@charset "UTF-8";
:root {
--dt-row-selected: 13, 110, 253;
--dt-row-selected-text: 255, 255, 255;
@ -43,6 +42,9 @@ table.dataTable tr.dt-hasChild td.dt-control:before {
border-bottom: 0px solid transparent;
border-right: 5px solid transparent;
}
table.dataTable tfoot:empty {
display: none;
}
html.dark table.dataTable td.dt-control:before,
:root[data-bs-theme=dark] table.dataTable td.dt-control:before,
@ -90,8 +92,8 @@ table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order:before {
position: absolute;
display: block;
bottom: 50%;
content: "";
content: ""/"";
content: "\25B2";
content: "\25B2"/"";
}
table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:after, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after,
table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order:after,
@ -99,8 +101,8 @@ table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order:after {
position: absolute;
display: block;
top: 50%;
content: "";
content: ""/"";
content: "\25BC";
content: "\25BC"/"";
}
table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc, table.dataTable thead > tr > th.dt-ordering-asc, table.dataTable thead > tr > th.dt-ordering-desc,
table.dataTable thead > tr > td.dt-orderable-asc,
@ -251,6 +253,11 @@ table.dataTable th,
table.dataTable td {
box-sizing: border-box;
}
table.dataTable th.dt-type-numeric, table.dataTable th.dt-type-date,
table.dataTable td.dt-type-numeric,
table.dataTable td.dt-type-date {
text-align: right;
}
table.dataTable th.dt-left,
table.dataTable td.dt-left {
text-align: left;
@ -276,11 +283,6 @@ table.dataTable td.dt-empty {
text-align: center;
vertical-align: top;
}
table.dataTable th.dt-type-numeric, table.dataTable th.dt-type-date,
table.dataTable td.dt-type-numeric,
table.dataTable td.dt-type-date {
text-align: right;
}
table.dataTable thead th,
table.dataTable thead td,
table.dataTable tfoot th,

View file

@ -4,34 +4,16 @@
*
* To rebuild or modify this file with the latest versions of the included
* software please visit:
* https://datatables.net/download/#bs5/dt-2.1.8
* https://datatables.net/download/#bs5/dt-2.2.2
*
* Included libraries:
* DataTables 2.1.8
* DataTables 2.2.2
*/
/*! DataTables 2.1.8
/*! DataTables 2.2.2
* © SpryMedia Ltd - datatables.net/license
*/
/**
* @summary DataTables
* @description Paginate, search and order HTML tables
* @version 2.1.8
* @author SpryMedia Ltd
* @contact www.datatables.net
* @copyright SpryMedia Ltd.
*
* This source file is free software, available under the following license:
* MIT license - https://datatables.net/license
*
* This source file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
*
* For details please refer to: https://www.datatables.net
*/
(function( factory ) {
"use strict";
@ -441,7 +423,6 @@
thead = $('<thead/>').appendTo($this);
}
oSettings.nTHead = thead[0];
$('tr', thead).addClass(oClasses.thead.row);
var tbody = $this.children('tbody');
if ( tbody.length === 0 ) {
@ -456,7 +437,6 @@
tfoot = $('<tfoot/>').appendTo($this);
}
oSettings.nTFoot = tfoot[0];
$('tr', tfoot).addClass(oClasses.tfoot.row);
// Copy the data index array
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
@ -539,7 +519,7 @@
*
* @type string
*/
builder: "bs5/dt-2.1.8",
builder: "bs5/dt-2.2.2",
/**
@ -2173,6 +2153,10 @@
var width = _fnColumnsSumWidth(settings, [i], false, false);
cols[i].colEl.css('width', width);
if (settings.oScroll.sX) {
cols[i].colEl.css('min-width', width);
}
}
}
@ -3240,9 +3224,13 @@
// Add the number of cells needed to make up to the number of columns
if (row.length === 1) {
var cells = $('td, th', row);
var cellCount = 0;
$('td, th', row).each(function () {
cellCount += this.colSpan;
});
for ( i=cells.length, ien=columns.length ; i<ien ; i++ ) {
for ( i=cellCount, ien=columns.length ; i<ien ; i++ ) {
$('<th/>')
.html( columns[i][titleProp] || '' )
.appendTo( row );
@ -3254,9 +3242,11 @@
if (side === 'header') {
settings.aoHeader = detected;
$('tr', target).addClass(classes.thead.row);
}
else {
settings.aoFooter = detected;
$('tr', target).addClass(classes.tfoot.row);
}
// Every cell needs to be passed through the renderer
@ -4519,7 +4509,7 @@
// So the array reference doesn't break set the results into the
// existing array
displayRows.length = 0;
displayRows.push.apply(displayRows, rows);
_fnArrayApply(displayRows, rows);
}
}
@ -5247,8 +5237,11 @@
// [].find, but it wasn't supported in Chrome until Sept 2015, and DT has 10 year
// browser support
var firstTr = null;
var start = _fnDataSource( settings ) !== 'ssp'
? settings._iDisplayStart
: 0;
for (i=settings._iDisplayStart ; i<settings.aiDisplay.length ; i++) {
for (i=start ; i<start + settings.aiDisplay.length ; i++) {
var idx = settings.aiDisplay[i];
var tr = settings.aoData[idx].nTr;
@ -5263,7 +5256,7 @@
return {
idx: _fnVisibleToColumnIndex(settings, vis),
width: $(this).outerWidth()
}
};
});
// Check against what the colgroup > col is set to and correct if needed
@ -5273,6 +5266,10 @@
if (colWidth !== colSizes[i].width) {
colEl.style.width = colSizes[i].width + 'px';
if (scroll.sX) {
colEl.style.minWidth = colSizes[i].width + 'px';
}
}
}
}
@ -5365,6 +5362,14 @@
i, column, columnIdx;
var styleWidth = table.style.width;
var containerWidth = _fnWrapperWidth(settings);
// Don't re-run for the same width as the last time
if (containerWidth === settings.containerWidth) {
return false;
}
settings.containerWidth = containerWidth;
// If there is no width applied as a CSS style or as an attribute, we assume that
// the width is intended to be 100%, which is usually is in CSS, but it is very
@ -5422,6 +5427,8 @@
// browser will collapse it. If this width is smaller than the
// width the column requires, then it will have no effect
if ( scrollX ) {
this.style.minWidth = width;
$( this ).append( $('<div/>').css( {
width: width,
margin: 0,
@ -5490,15 +5497,15 @@
// If there is no width attribute or style, then allow the table to
// collapse
if ( tmpTable.width() < tableContainer.clientWidth && tableWidthAttr ) {
tmpTable.width( tableContainer.clientWidth );
if ( tmpTable.outerWidth() < tableContainer.clientWidth && tableWidthAttr ) {
tmpTable.outerWidth( tableContainer.clientWidth );
}
}
else if ( scrollY ) {
tmpTable.width( tableContainer.clientWidth );
tmpTable.outerWidth( tableContainer.clientWidth );
}
else if ( tableWidthAttr ) {
tmpTable.width( tableWidthAttr );
tmpTable.outerWidth( tableWidthAttr );
}
// Get the width of each column in the constructed table
@ -5531,20 +5538,64 @@
}
if ( (tableWidthAttr || scrollX) && ! settings._reszEvt ) {
var bindResize = function () {
$(window).on('resize.DT-'+settings.sInstance, DataTable.util.throttle( function () {
if (! settings.bDestroying) {
_fnAdjustColumnSizing( settings );
}
} ) );
};
var resize = DataTable.util.throttle( function () {
var newWidth = _fnWrapperWidth(settings);
bindResize();
// Don't do it if destroying or the container width is 0
if (! settings.bDestroying && newWidth !== 0) {
_fnAdjustColumnSizing( settings );
}
} );
// For browsers that support it (~2020 onwards for wide support) we can watch for the
// container changing width.
if (window.ResizeObserver) {
// This is a tricky beast - if the element is visible when `.observe()` is called,
// then the callback is immediately run. Which we don't want. If the element isn't
// visible, then it isn't run, but we want it to run when it is then made visible.
// This flag allows the above to be satisfied.
var first = $(settings.nTableWrapper).is(':visible');
// Use an empty div to attach the observer so it isn't impacted by height changes
var resizer = $('<div>')
.css({
width: '100%',
height: 0
})
.addClass('dt-autosize')
.appendTo(settings.nTableWrapper);
settings.resizeObserver = new ResizeObserver(function (e) {
if (first) {
first = false;
}
else {
resize();
}
});
settings.resizeObserver.observe(resizer[0]);
}
else {
// For old browsers, the best we can do is listen for a window resize
$(window).on('resize.DT-'+settings.sInstance, resize);
}
settings._reszEvt = true;
}
}
/**
* Get the width of the DataTables wrapper element
*
* @param {*} settings DataTables settings object
* @returns Width
*/
function _fnWrapperWidth(settings) {
return $(settings.nTableWrapper).is(':visible')
? $(settings.nTableWrapper).width()
: 0;
}
/**
* Get the maximum strlen for each data column
@ -5855,10 +5906,14 @@
displayMaster = oSettings.aiDisplayMaster,
aSort;
// Make sure the columns all have types defined
_fnColumnTypes(oSettings);
// Allow a specific column to be sorted, which will _not_ alter the display
// master
if (col !== undefined) {
var srcCol = oSettings.aoColumns[col];
aSort = [{
src: col,
col: col,
@ -6153,15 +6208,26 @@
return;
}
// Sort state saving uses [[idx, order]] structure.
var sorting = [];
_fnSortResolve(settings, sorting, settings.aaSorting );
/* Store the interesting variables */
var columns = settings.aoColumns;
var state = {
time: +new Date(),
start: settings._iDisplayStart,
length: settings._iDisplayLength,
order: $.extend( true, [], settings.aaSorting ),
order: sorting.map(function (sort) {
// If a column name is available, use it
return columns[sort[0]] && columns[sort[0]].sName
? [ columns[sort[0]].sName, sort[1] ]
: sort.slice();
} ),
search: $.extend({}, settings.oPreviousSearch),
columns: settings.aoColumns.map( function ( col, i ) {
return {
name: col.sName,
visible: col.bVisible,
search: $.extend({}, settings.aoPreSearchCols[i])
};
@ -6209,6 +6275,8 @@
function _fnImplementState ( settings, s, callback) {
var i, ien;
var columns = settings.aoColumns;
var currentNames = _pluck(settings.aoColumns, 'sName');
settings._bLoadingState = true;
// When StateRestore was introduced the state could now be implemented at any time
@ -6238,13 +6306,6 @@
return;
}
// Number of columns have changed - all bets are off, no restore of settings
if ( s.columns && columns.length !== s.columns.length ) {
settings._bLoadingState = false;
callback();
return;
}
// Store the saved state so it might be accessed at any time
settings.oLoadedState = $.extend( true, {}, s );
@ -6278,10 +6339,23 @@
if ( s.order !== undefined ) {
settings.aaSorting = [];
$.each( s.order, function ( i, col ) {
settings.aaSorting.push( col[0] >= columns.length ?
[ 0, col[1] ] :
col
);
var set = [ col[0], col[1] ];
// A column name was stored and should be used for restore
if (typeof col[0] === 'string') {
var idx = currentNames.indexOf(col[0]);
// Find the name from the current list of column names, or fallback to index 0
set[0] = idx >= 0
? idx
: 0;
}
else if (set[0] >= columns.length) {
// If a column name, but it is out of bounds, set to 0
set[0] = 0;
}
settings.aaSorting.push(set);
} );
}
@ -6292,31 +6366,65 @@
// Columns
if ( s.columns ) {
for ( i=0, ien=s.columns.length ; i<ien ; i++ ) {
var col = s.columns[i];
var set = s.columns;
var incoming = _pluck(s.columns, 'name');
// Visibility
if ( col.visible !== undefined ) {
// If the api is defined, the table has been initialised so we need to use it rather than internal settings
if (api) {
// Don't redraw the columns on every iteration of this loop, we will do this at the end instead
api.column(i).visible(col.visible, false);
// Check if it is a 2.2 style state object with a `name` property for the columns, and if
// the name was defined. If so, then create a new array that will map the state object
// given, to the current columns (don't bother if they are already matching tho).
if (incoming.join('').length && incoming.join('') !== currentNames.join('')) {
set = [];
// For each column, try to find the name in the incoming array
for (i=0 ; i<currentNames.length ; i++) {
if (currentNames[i] != '') {
var idx = incoming.indexOf(currentNames[i]);
if (idx >= 0) {
set.push(s.columns[idx]);
}
else {
// No matching column name in the state's columns, so this might be a new
// column and thus can't have a state already.
set.push({});
}
}
else {
columns[i].bVisible = col.visible;
// If no name, but other columns did have a name, then there is no knowing
// where this one came from originally so it can't be restored.
set.push({});
}
}
}
// If the number of columns to restore is different from current, then all bets are off.
if (set.length === columns.length) {
for ( i=0, ien=set.length ; i<ien ; i++ ) {
var col = set[i];
// Visibility
if ( col.visible !== undefined ) {
// If the api is defined, the table has been initialised so we need to use it rather than internal settings
if (api) {
// Don't redraw the columns on every iteration of this loop, we will do this at the end instead
api.column(i).visible(col.visible, false);
}
else {
columns[i].bVisible = col.visible;
}
}
// Search
if ( col.search !== undefined ) {
$.extend( settings.aoPreSearchCols[i], col.search );
}
}
// Search
if ( col.search !== undefined ) {
$.extend( settings.aoPreSearchCols[i], col.search );
// If the api is defined then we need to adjust the columns once the visibility has been changed
if (api) {
api.columns.adjust();
}
}
// If the api is defined then we need to adjust the columns once the visibility has been changed
if (api) {
api.columns.adjust();
}
}
settings._bLoadingState = false;
@ -6633,6 +6741,30 @@
replace(/_ENTRIES-TOTAL_/g, settings.api.i18n('entries', '', vis) );
}
/**
* Add elements to an array as quickly as possible, but stack stafe.
*
* @param {*} arr Array to add the data to
* @param {*} data Data array that is to be added
* @returns
*/
function _fnArrayApply(arr, data) {
if (! data) {
return;
}
// Chrome can throw a max stack error if apply is called with
// too large an array, but apply is faster.
if (data.length < 10000) {
arr.push.apply(arr, data);
}
else {
for (i=0 ; i<data.length ; i++) {
arr.push(data[i]);
}
}
}
/**
@ -6825,18 +6957,7 @@
: settings;
// Initial data
if ( data ) {
// Chrome can throw a max stack error if apply is called with
// too large an array, but apply is faster.
if (data.length < 10000) {
this.push.apply(this, data);
}
else {
for (i=0 ; i<data.length ; i++) {
this.push(data[i]);
}
}
}
_fnArrayApply(this, data);
// selector
this.selector = {
@ -7217,7 +7338,7 @@
selector.forEach(function (sel) {
var inner = __table_selector(sel, a);
result.push.apply(result, inner);
_fnArrayApply(result, inner);
});
return result.filter( function (item) {
@ -8071,7 +8192,7 @@
// Return an Api.rows() extended instance, so rows().nodes() etc can be used
var modRows = this.rows( -1 );
modRows.pop();
modRows.push.apply(modRows, newRows);
_fnArrayApply(modRows, newRows);
return modRows;
} );
@ -8584,7 +8705,10 @@
.map( function () {
return _fnColumnsFromHeader( this ); // `nodes` is column index complete and in order
} )
.toArray();
.toArray()
.sort(function (a, b) {
return a - b;
});
if ( jqResult.length || ! s.nodeName ) {
return jqResult;
@ -8838,6 +8962,10 @@
_api_register( 'columns.adjust()', function () {
return this.iterator( 'table', function ( settings ) {
// Force a column sizing to happen with a manual call - otherwise it can skip
// if the size hasn't changed
settings.containerWidth = -1;
_fnAdjustColumnSizing( settings );
}, 1 );
} );
@ -9403,6 +9531,10 @@
} );
} );
// Can be assigned in DateTable.use() - note luxon and moment vars are in helpers.js
var __bootstrap;
var __foundation;
/**
* Set the libraries that DataTables uses, or the global objects.
* Note that the arguments can be either way around (legacy support)
@ -9436,6 +9568,14 @@
case 'moment':
return __moment;
case 'bootstrap':
// Use local if set, otherwise try window, which could be undefined
return __bootstrap || window.bootstrap;
case 'foundation':
// Ditto
return __foundation || window.Foundation;
default:
return null;
}
@ -9445,7 +9585,7 @@
if (type === 'lib' || type === 'jq' || (module && module.fn && module.fn.jquery)) {
$ = module;
}
else if (type == 'win' || (module && module.document)) {
else if (type === 'win' || (module && module.document)) {
window = module;
document = module.document;
}
@ -9458,6 +9598,14 @@
else if (type === 'moment' || (module && module.isMoment)) {
__moment = module;
}
else if (type === 'bootstrap' || (module && module.Modal && module.Modal.NAME === 'modal'))
{
// This is currently for BS5 only. BS3/4 attach to jQuery, so no need to use `.use()`
__bootstrap = module;
}
else if (type === 'foundation' || (module && module.Reveal)) {
__foundation = module;
}
}
/**
@ -9709,12 +9857,14 @@
// Function to run either once the table becomes ready or
// immediately if it is already ready.
return this.tables().every(function () {
var api = this;
if (this.context[0]._bInitComplete) {
fn.call(this);
fn.call(api);
}
else {
this.on('init.dt.DT', function () {
fn.call(this);
fn.call(api);
});
}
} );
@ -9748,6 +9898,11 @@
new _Api( settings ).columns().visible( true );
}
// Container width change listener
if (settings.resizeObserver) {
settings.resizeObserver.disconnect();
}
// Blitz all `DT` namespaced events (these are internal events, the
// lowercase, `dt` events are user subscribed and they are responsible
// for removing them
@ -9765,20 +9920,37 @@
jqTable.append( tfoot );
}
// Clean up the header
$(thead).find('span.dt-column-order').remove();
$(thead).find('span.dt-column-title').each(function () {
var title = $(this).html();
$(this).parent().append(title);
$(this).remove();
});
settings.colgroup.remove();
settings.aaSorting = [];
settings.aaSortingFixed = [];
_fnSortingClasses( settings );
$(jqTable).find('th, td').removeClass(
$.map(DataTable.ext.type.className, function (v) {
return v;
}).join(' ')
);
$('th, td', thead)
.removeClass(
orderClasses.none + ' ' +
orderClasses.canAsc + ' ' +
orderClasses.canDesc + ' ' +
orderClasses.isAsc + ' ' +
orderClasses.isDesc
)
.css('width', '');
.css('width', '')
.removeAttr('data-dt-column')
.removeAttr('aria-sort');
// Add the TR elements back into the table in their original order
jqTbody.children().detach();
@ -9866,7 +10038,7 @@
* @type string
* @default Version number
*/
DataTable.version = "2.1.8";
DataTable.version = "2.2.2";
/**
* Private data store, containing all of the settings objects that are
@ -11969,7 +12141,13 @@
deferLoading: null,
/** Allow auto type detection */
typeDetect: true
typeDetect: true,
/** ResizeObserver for the container div */
resizeObserver: null,
/** Keep a record of the last size of the container, so we can skip duplicates */
containerWidth: -1
};
/**
@ -12111,8 +12289,8 @@
var __mlWarning = false;
var __luxon; // Can be assigned in DateTeble.use()
var __moment; // Can be assigned in DateTeble.use()
var __luxon; // Can be assigned in DateTable.use()
var __moment; // Can be assigned in DateTable.use()
/**
*
@ -12148,7 +12326,7 @@
return null;
}
dt.setLocale(locale);
dt = dt.setLocale(locale);
}
else if (! format) {
// No format given, must be ISO
@ -12531,6 +12709,13 @@
});
}
var __diacriticHtmlSort = function (a, b) {
a = _stripHtml(a);
b = _stripHtml(b);
return __diacriticSort(a, b);
}
//
// Built in data types
//
@ -12601,6 +12786,31 @@
});
DataTable.type('html-utf8', {
detect: {
allOf: function ( d ) {
return _empty( d ) || (typeof d === 'string' && d.indexOf('<') !== -1);
},
oneOf: function ( d ) {
// At least one data point must contain a `<` and a non-ASCII character
// eslint-disable-next-line compat/compat
return navigator.languages &&
! _empty( d ) &&
typeof d === 'string' &&
d.indexOf('<') !== -1 &&
typeof d === 'string' && d.match(/[^\x00-\x7F]/);
}
},
order: {
asc: __diacriticHtmlSort,
desc: function (a, b) {
return __diacriticHtmlSort(a, b) * -1;
}
},
search: _filterString(true, true)
});
DataTable.type('date', {
className: 'dt-type-date',
detect: {
@ -12811,6 +13021,7 @@
var indexes = columns.indexes();
var sortDirs = columns.orderable(true).flatten();
var orderedColumns = _pluck(sorting, 'col');
var tabIndex = settings.iTabIndex;
cell
.removeClass(
@ -12868,15 +13079,20 @@
cell.removeAttr('aria-sort');
}
cell.attr('aria-label', orderable
? col.ariaTitle + ctx.api.i18n('oAria.orderable' + ariaType)
: col.ariaTitle
);
// Make the headers tab-able for keyboard navigation
if (orderable) {
cell.find('.dt-column-title').attr('role', 'button');
cell.attr('tabindex', 0)
var orderSpan = cell.find('.dt-column-order');
orderSpan
.attr('role', 'button')
.attr('aria-label', orderable
? col.ariaTitle + ctx.api.i18n('oAria.orderable' + ariaType)
: col.ariaTitle
);
if (tabIndex !== -1) {
orderSpan.attr('tabindex', tabIndex);
}
}
} );
}
@ -12890,7 +13106,7 @@
.addClass(items.className || classes.row)
.appendTo( container );
$.each( items, function (key, val) {
DataTable.ext.renderer.layout._forLayoutRow(items, function (key, val) {
if (key === 'id' || key === 'className') {
return;
}
@ -12921,7 +13137,31 @@
})
.append( val.contents )
.appendTo( row );
} );
});
},
// Shared for use by the styling frameworks
_forLayoutRow: function (items, fn) {
// As we are inserting dom elements, we need start / end in a
// specific order, this function is used for sorting the layout
// keys.
var layoutEnum = function (x) {
switch (x) {
case '': return 0;
case 'start': return 1;
case 'end': return 2;
default: return 3;
}
};
Object
.keys(items)
.sort(function (a, b) {
return layoutEnum(a) - layoutEnum(b);
})
.forEach(function (key) {
fn(key, items[key]);
});
}
}
} );
@ -13273,7 +13513,7 @@
'data-dt-idx': button,
'tabIndex': btnInfo.disabled
? -1
: settings.iTabIndex
: settings.iTabIndex && btn.clicker[0].nodeName.toLowerCase() !== 'span'
? settings.iTabIndex
: null, // `0` doesn't need a tabIndex since it is the default
});
@ -13307,12 +13547,16 @@
// Responsive - check if the buttons are over two lines based on the
// height of the buttons and the container.
if (
buttonEls.length && // any buttons
opts.buttons > 1 && // prevent infinite
$(host).height() >= ($(buttonEls[0]).outerHeight() * 2) - 10
) {
_pagingDraw(settings, host, $.extend({}, opts, { buttons: opts.buttons - 2 }));
if (buttonEls.length) {
var outerHeight = $(buttonEls[0]).outerHeight();
if (
opts.buttons > 1 && // prevent infinite
outerHeight > 0 && // will be 0 if hidden
$(host).height() >= (outerHeight * 2) - 10
) {
_pagingDraw(settings, host, $.extend({}, opts, { buttons: opts.buttons - 2 }));
}
}
}
@ -13336,7 +13580,6 @@
switch ( button ) {
case 'ellipsis':
o.display = '&#x2026;';
o.disabled = true;
break;
case 'first':
@ -13523,7 +13766,7 @@
// Save text node content for macro updating
var textNodes = [];
Array.from(div.find('label')[0].childNodes).forEach(function (el) {
Array.prototype.slice.call(div.find('label')[0].childNodes).forEach(function (el) {
if (el.nodeType === Node.TEXT_NODE) {
textNodes.push({
el: el,
@ -13541,7 +13784,6 @@
// Next, the select itself, along with the options
var select = $('<select/>', {
'name': tableId+'_length',
'aria-controls': tableId,
'class': classes.select
} );
@ -13732,41 +13974,6 @@ DataTable.ext.renderer.pagingContainer.bootstrap = function (settings, buttonEls
return $('<ul/>').addClass('pagination').append(buttonEls);
};
// DataTable.ext.renderer.layout.bootstrap = function ( settings, container, items ) {
// var row = $( '<div/>', {
// "class": items.full ?
// 'row mt-2 justify-content-md-center' :
// 'row mt-2 justify-content-between'
// } )
// .appendTo( container );
// $.each( items, function (key, val) {
// var klass;
// var cellClass = '';
// // Apply start / end (left / right when ltr) margins
// if (val.table) {
// klass = 'col-12';
// }
// else if (key === 'start') {
// klass = '' + cellClass;
// }
// else if (key === 'end') {
// klass = '' + cellClass;
// }
// else {
// klass = ' ' + cellClass;
// }
// $( '<div/>', {
// id: val.id || null,
// "class": klass + ' ' + (val.className || '')
// } )
// .append( val.contents )
// .appendTo( row );
// } );
// };
return DataTable;
}));