Merge pull request #82 from privatevoid-net/pr-flake-update

`flake.lock`: Update
This commit is contained in:
Max Headroom 2023-07-25 01:27:30 +02:00 committed by GitHub
commit 43c6ec4e9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 113 additions and 404 deletions

View file

@ -9,11 +9,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1684153753, "lastModified": 1690228878,
"narHash": "sha256-PVbWt3qrjYAK+T5KplFcO+h7aZWfEj1UtyoKlvcDxh0=", "narHash": "sha256-9Xe7JV0krp4RJC9W9W9WutZVlw6BlHTFMiUP/k48LQY=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "db5637d10f797bb251b94ef9040b237f4702cde3", "rev": "d8c973fd228949736dedf61b7f8cc1ece3236792",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -39,11 +39,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1685309025, "lastModified": 1689457600,
"narHash": "sha256-pZxMM3AMP/ojwhrFD0A2ML4NOgehlBLGHseInnO5evc=", "narHash": "sha256-1XLn2ZZMaqQx+Ys3eel5hQRkgUn3DeHcVb2JT8WYU0A=",
"owner": "zhaofengli", "owner": "zhaofengli",
"repo": "attic", "repo": "attic",
"rev": "b1fb790b5f2afaaa1b2f7f18979b8318abe604bb", "rev": "4902d57f5dae8ec660ee9ee14c45c2192f9fe8b1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -157,11 +157,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1685972731, "lastModified": 1688380630,
"narHash": "sha256-VpwVUthxs3AFgvWxGTHu+KVDnS/zT3xkCtmjX2PjNQs=", "narHash": "sha256-8ilApWVb1mAi4439zS3iFeIT0ODlbrifm/fegWwgHjA=",
"owner": "numtide", "owner": "numtide",
"repo": "devshell", "repo": "devshell",
"rev": "6b2554d28d46bfa6e24b941e999a145760dad0e1", "rev": "f9238ec3d75cefbb2b42a44948c4e8fb1ae9a205",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -170,70 +170,9 @@
"type": "github" "type": "github"
} }
}, },
"dream2nix": {
"inputs": {
"all-cabal-json": [
"blank"
],
"crane": [
"blank"
],
"devshell": [
"blank"
],
"drv-parts": [
"drv-parts"
],
"flake-compat": "flake-compat",
"flake-parts": [
"flake-parts"
],
"flake-utils-pre-commit": [
"blank"
],
"ghc-utils": [
"blank"
],
"gomod2nix": [
"blank"
],
"mach-nix": [
"blank"
],
"nix-pypi-fetcher": [
"blank"
],
"nixpkgs": [
"nixpkgs"
],
"nixpkgsV1": [
"nixpkgs"
],
"poetry2nix": "poetry2nix",
"pre-commit-hooks": [
"blank"
],
"pruned-racket-catalog": [
"blank"
]
},
"locked": {
"lastModified": 1686064244,
"narHash": "sha256-ffsa/q0MSKyrwy12RjPhIFe6VTq96uW9bfuRkUqqUo0=",
"owner": "nix-community",
"repo": "dream2nix",
"rev": "3a53602466318eb3fdb0bc4135078930eea22683",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "dream2nix",
"type": "github"
}
},
"drv-parts": { "drv-parts": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat",
"flake-parts": [ "flake-parts": [
"flake-parts" "flake-parts"
], ],
@ -242,11 +181,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1680698112, "lastModified": 1686841148,
"narHash": "sha256-FgnobN/DvCjEsc0UAZEAdPLkL4IZi2ZMnu2K2bUaElc=", "narHash": "sha256-IgQbs5v0hIRt0DT9szry35VV+ajvaCjtc9SNWmsDGbQ=",
"owner": "DavHau", "owner": "DavHau",
"repo": "drv-parts", "repo": "drv-parts",
"rev": "e8c2ec1157dc1edb002989669a0dbd935f430201", "rev": "db0acec6cffff6f29f08f5e2a014949a5fbd877c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -287,38 +226,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -326,11 +233,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1685662779, "lastModified": 1688466019,
"narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -339,55 +246,18 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"hercules-ci-agent",
"pre-commit-hooks-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"haskell-flake": { "haskell-flake": {
"locked": { "locked": {
"lastModified": 1678745009, "lastModified": 1684780604,
"narHash": "sha256-ujfwSrkxThmHJozibkCnJmlXLVyxm+Cbo2Q4wXPbCS4=", "narHash": "sha256-2uMZsewmRn7rRtAnnQNw1lj0uZBMh4m6Cs/7dV5YF08=",
"owner": "srid", "owner": "srid",
"repo": "haskell-flake", "repo": "haskell-flake",
"rev": "26852ade574c712bc3912ad28de52b0c4cf7d4cb", "rev": "74210fa80a49f1b6f67223debdbf1494596ff9f2",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "srid", "owner": "srid",
"ref": "0.2.0", "ref": "0.3.0",
"repo": "haskell-flake", "repo": "haskell-flake",
"type": "github" "type": "github"
} }
@ -398,18 +268,14 @@
"flake-parts" "flake-parts"
], ],
"haskell-flake": "haskell-flake", "haskell-flake": "haskell-flake",
"nix-darwin": [ "nixpkgs": "nixpkgs"
"blank"
],
"nixpkgs": "nixpkgs",
"pre-commit-hooks-nix": "pre-commit-hooks-nix"
}, },
"locked": { "locked": {
"lastModified": 1686047099, "lastModified": 1688568579,
"narHash": "sha256-eA+MPbOhF2mbkYqmxX4TFZFLF0AOXyuIXOvO3E8Hz9w=", "narHash": "sha256-ON0M56wtY/TIIGPkXDlJboAmuYwc73Hi8X9iJGtxOhM=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-agent", "repo": "hercules-ci-agent",
"rev": "9958fea1a5a2f8ce31d9ef051a6a264cda175e77", "rev": "367dd8cd649b57009a6502e878005a1e54ad78c5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -431,11 +297,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1685557007, "lastModified": 1689397210,
"narHash": "sha256-0prbgwFJeBuLGJgNdOXCXQ8/oSamzkcNZYHr04ZXI2I=", "narHash": "sha256-fVxZnqxMbsDkB4GzGAs/B41K0wt/e+B/fLxmTFF/S20=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-effects", "repo": "hercules-ci-effects",
"rev": "6d8e62977dc34fd2c187879856ebb6cf1faabba9", "rev": "0a63bfa3f00a3775ea3a6722b247880f1ffe91ce",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -536,11 +402,11 @@
}, },
"nix-filter": { "nix-filter": {
"locked": { "locked": {
"lastModified": 1681154353, "lastModified": 1687178632,
"narHash": "sha256-MCJ5FHOlbfQRFwN0brqPbCunLEVw05D/3sRVoNVt2tI=", "narHash": "sha256-HS7YR5erss0JCaUijPeyg2XrisEb959FIct3n2TMGbE=",
"owner": "numtide", "owner": "numtide",
"repo": "nix-filter", "repo": "nix-filter",
"rev": "f529f42792ade8e32c4be274af6b6d60857fbee7", "rev": "d90c75e8319d0dd9be67d933d8eb9d0894ec9174",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -551,7 +417,7 @@
}, },
"nix-super": { "nix-super": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_4", "flake-compat": "flake-compat_2",
"lowdown-src": "lowdown-src", "lowdown-src": "lowdown-src",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -562,11 +428,11 @@
}, },
"locked": { "locked": {
"host": "git.privatevoid.net", "host": "git.privatevoid.net",
"lastModified": 1685886360, "lastModified": 1689005785,
"narHash": "sha256-mQ6Eryo7CFkt8KHVJcbg0HfXMGFrjMq04XnL9b9TsX0=", "narHash": "sha256-gxJmO6Y6L+iEgIhBlyOLlruQQqixERkWkByYSH4LaTg=",
"owner": "max", "owner": "max",
"repo": "nix-super", "repo": "nix-super",
"rev": "518ce777422c6ade8988a3dd1bebb407a08f3851", "rev": "6ff67e40b495e79aa6b2dc9356f1e9ade3b77bca",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -578,11 +444,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1680213900, "lastModified": 1688322751,
"narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=", "narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e3652e0735fbec227f342712f180f4f21f0594f2", "rev": "0fbe93c5a7cac99f90b60bdf5f149383daaa615f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -592,29 +458,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1678872516,
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1686043861, "lastModified": 1690176526,
"narHash": "sha256-duF1U12b7vVkf2Lt6noPYVeW8dVFw4CwJmQivhyZxYQ=", "narHash": "sha256-SHdHTRu1RMLhIkTlFMSSyUJYsPNWw50Ky9W6znxGN9A=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "96f8f4a038a190f7511da79ef7e77bec5e4b811a", "rev": "a58eb89c7fcb703554aa53b4d25b50bd62e16786",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -624,48 +474,6 @@
"type": "github" "type": "github"
} }
}, },
"poetry2nix": {
"flake": false,
"locked": {
"lastModified": 1666918719,
"narHash": "sha256-BkK42fjAku+2WgCOv2/1NrPa754eQPV7gPBmoKQBWlc=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "289efb187123656a116b915206e66852f038720e",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "1.36.0",
"repo": "poetry2nix",
"type": "github"
}
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": [
"hercules-ci-agent",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1680170909,
"narHash": "sha256-FtKU/edv1jFRr/KwUxWTYWXEyj9g8GBrHntC2o8oFI8=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "29dbe1efaa91c3a415d8b45d62d48325a4748816",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"repin-flake-utils": { "repin-flake-utils": {
"inputs": { "inputs": {
"systems": [ "systems": [
@ -673,11 +481,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1685518550, "lastModified": 1689068808,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -693,7 +501,6 @@
"blank": "blank", "blank": "blank",
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"devshell": "devshell", "devshell": "devshell",
"dream2nix": "dream2nix",
"drv-parts": "drv-parts", "drv-parts": "drv-parts",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"hercules-ci-agent": "hercules-ci-agent", "hercules-ci-agent": "hercules-ci-agent",

View file

@ -1,7 +1,7 @@
{ {
description = "Private Void system configurations"; description = "Private Void system configurations";
nixConfig = { nixConfig = {
allow-import-from-derivation = true; #allow-import-from-derivation = true;
extra-substituters = "https://cache.privatevoid.net"; extra-substituters = "https://cache.privatevoid.net";
extra-trusted-public-keys = "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg="; extra-trusted-public-keys = "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg=";
}; };
@ -14,7 +14,6 @@
imports = [ imports = [
inputs.hercules-ci-effects.flakeModule inputs.hercules-ci-effects.flakeModule
inputs.drv-parts.modules.flake-parts.drv-parts inputs.drv-parts.modules.flake-parts.drv-parts
inputs.dream2nix.flakeModuleBeta
./hosts/part.nix ./hosts/part.nix
./modules/part.nix ./modules/part.nix
./packages/part.nix ./packages/part.nix
@ -67,26 +66,6 @@
}; };
}; };
dream2nix = {
url = "github:nix-community/dream2nix";
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgsV1.follows = "nixpkgs";
all-cabal-json.follows = "blank";
crane.follows = "blank";
devshell.follows = "blank";
drv-parts.follows = "drv-parts";
flake-utils-pre-commit.follows = "blank";
flake-parts.follows = "flake-parts";
ghc-utils.follows = "blank";
gomod2nix.follows = "blank";
mach-nix.follows = "blank";
nix-pypi-fetcher.follows = "blank";
pre-commit-hooks.follows = "blank";
pruned-racket-catalog.follows = "blank";
};
};
devshell = { devshell = {
url = "github:numtide/devshell"; url = "github:numtide/devshell";
inputs = { inputs = {
@ -109,7 +88,6 @@
url = "github:hercules-ci/hercules-ci-agent"; url = "github:hercules-ci/hercules-ci-agent";
inputs = { inputs = {
flake-parts.follows = "flake-parts"; flake-parts.follows = "flake-parts";
nix-darwin.follows = "blank";
}; };
}; };
hercules-ci-effects = { hercules-ci-effects = {

View file

@ -12,10 +12,6 @@
./websites/landing/project.nix ./websites/landing/project.nix
./websites/stop-using-nix-env/project.nix ./websites/stop-using-nix-env/project.nix
]; ];
dream2nix.config = {
projectRoot = ./.;
overridesDirs = [ ./dream2nix-overrides ];
};
perSystem = { config, filters, pkgs, self', ... }: perSystem = { config, filters, pkgs, self', ... }:
let let
inherit (self'.packages) nix-super; inherit (self'.packages) nix-super;
@ -23,26 +19,11 @@
pins = import ./sources; pins = import ./sources;
in in
{ {
dream2nix = {
inputs = filters.doFilter filters.packages {
excalidraw = {
source = pins.excalidraw;
projects.excalidraw = {
subsystem = "nodejs";
translator = "yarn-lock";
subsystemInfo.nodejs = "18";
};
};
};
};
packages = filters.doFilter filters.packages rec { packages = filters.doFilter filters.packages rec {
cinny = pkgs.callPackage ./web-apps/cinny { inherit pins; }; cinny = pkgs.callPackage ./web-apps/cinny { inherit pins; };
excalidraw = let excalidraw = pkgs.callPackage ./web-apps/excalidraw { inherit pins; };
inherit (config.dream2nix.outputs.excalidraw.packages) excalidraw;
in excalidraw // { webroot = "${excalidraw}/${excalidraw.webPath}"; };
graf = pkgs.callPackage ./tools/graf { }; graf = pkgs.callPackage ./tools/graf { };

View file

@ -0,0 +1,68 @@
{ lib
, fetchFromGitHub
, mkYarnPackage
, fetchYarnDeps
, fixup_yarn_lock
, npins
, pins
}:
let
inherit (pins) excalidraw;
app = mkYarnPackage rec {
pname = "excalidraw";
version = "0.0.0+${builtins.substring 0 7 excalidraw.revision}";
REACT_APP_DISABLE_SENTRY = "true";
REACT_APP_FIREBASE_CONFIG = "";
REACT_APP_GOOGLE_ANALYTICS_ID = "";
src = npins.mkSource excalidraw;
packageJSON = "${excalidraw}/package.json";
nativeBuildInputs = [ fixup_yarn_lock ];
offlineCache = fetchYarnDeps {
name = "excalidraw-yarn-cache-${builtins.hashString "sha256" (builtins.readFile "${excalidraw}/yarn.lock")}";
yarnLock = src + "/yarn.lock";
hash = "sha256-PuMqjAFhl+IPnpZyOlRPFazQbU5yKHe2iQJNgq4Cvh0=";
};
configurePhase = ''
runHook preConfigure
export HOME="$TMPDIR"
yarn config --offline set yarn-offline-mirror "$offlineCache"
fixup_yarn_lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
runHook postConfigure
'';
buildPhase = ''
yarn --offline build:app
'';
installPhase = ''
distRoot=$out/share/www
dist=$distRoot/excalidraw
mkdir -p $distRoot
mv build $dist
find $dist -type f -name "*.map" -delete
'';
doDist = false;
passthru.webroot = "${app}/share/www/excalidraw";
meta = with lib; {
description = "Virtual whiteboard for sketching hand-drawn like diagrams";
homepage = "https://github.com/excalidraw/excalidraw";
changelog = "https://github.com/excalidraw/excalidraw/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
};
};
in app

View file

@ -1,14 +0,0 @@
diff --git a/server/lib/src/valueset/session.rs b/server/lib/src/valueset/session.rs
index e8034f00a..736720a91 100644
--- a/server/lib/src/valueset/session.rs
+++ b/server/lib/src/valueset/session.rs
@@ -1195,4 +1195,9 @@ impl ValueSetT for ValueSetApiToken {
// This is what ties us as a type that can be refint checked.
Some(Box::new(self.map.keys().copied()))
}
+
+ fn migrate_session_to_apitoken(&self) -> Result<ValueSet, OperationError> {
+ // We are already in the api token format, don't do anything.
+ Ok(Box::new(self.clone()))
+ }
}

View file

@ -1,111 +0,0 @@
diff --git a/server/lib/src/plugins/refint.rs b/server/lib/src/plugins/refint.rs
index 1fd331170..6da81d654 100644
--- a/server/lib/src/plugins/refint.rs
+++ b/server/lib/src/plugins/refint.rs
@@ -21,8 +21,6 @@ use crate::plugins::Plugin;
use crate::prelude::*;
use crate::schema::SchemaTransaction;
-// NOTE: This *must* be after base.rs!!!
-
pub struct ReferentialIntegrity;
impl ReferentialIntegrity {
@@ -223,9 +221,19 @@ impl ReferentialIntegrity {
// Fast Path
let mut vsiter = cand.iter().flat_map(|c| {
- ref_types
- .values()
- .filter_map(move |rtype| c.get_ava_set(&rtype.name))
+ // If it's dyngroup, skip member since this will be reset in the next step.
+ let dyn_group = c.attribute_equality("class", &PVCLASS_DYNGROUP);
+
+ ref_types.values().filter_map(move |rtype| {
+ let skip_mb = dyn_group && rtype.name == "member";
+ // Skip memberOf.
+ let skip_mo = rtype.name == "memberof";
+ if skip_mb || skip_mo {
+ None
+ } else {
+ c.get_ava_set(&rtype.name)
+ }
+ })
});
// Could check len first?
@@ -252,6 +260,7 @@ impl ReferentialIntegrity {
#[cfg(test)]
mod tests {
+ use kanidm_proto::v1::Filter as ProtoFilter;
use kanidm_proto::v1::PluginError;
use crate::event::CreateEvent;
@@ -892,4 +901,66 @@ mod tests {
assert!(server_txn.commit().is_ok());
}
+
+ #[qs_test]
+ async fn test_ignore_references_for_regen(server: &QueryServer) {
+ // Test that we ignore certain reference types that are specifically
+ // regenerated in the code paths that *follow* refint. We have to have
+ // refint before memberof just due to the nature of how it works. But
+ // we still want to ignore invalid memberOf values and certain invalid
+ // member sets from dyngroups to allow them to self-heal at run time.
+ let curtime = duration_from_epoch_now();
+ let mut server_txn = server.write(curtime).await;
+
+ let tgroup_uuid = Uuid::new_v4();
+ let dyn_uuid = Uuid::new_v4();
+ let inv_mo_uuid = Uuid::new_v4();
+ let inv_mb_uuid = Uuid::new_v4();
+
+ let e_dyn = entry_init!(
+ ("class", Value::new_class("object")),
+ ("class", Value::new_class("group")),
+ ("class", Value::new_class("dyngroup")),
+ ("uuid", Value::Uuid(dyn_uuid)),
+ ("name", Value::new_iname("test_dyngroup")),
+ ("member", Value::Refer(inv_mb_uuid)),
+ (
+ "dyngroup_filter",
+ Value::JsonFilt(ProtoFilter::Eq("name".to_string(), "testgroup".to_string()))
+ )
+ );
+
+ let e_group: Entry<EntryInit, EntryNew> = entry_init!(
+ ("class", Value::new_class("group")),
+ ("class", Value::new_class("memberof")),
+ ("name", Value::new_iname("testgroup")),
+ ("uuid", Value::Uuid(tgroup_uuid)),
+ ("memberof", Value::Refer(inv_mo_uuid))
+ );
+
+ let ce = CreateEvent::new_internal(vec![e_dyn, e_group]);
+ assert!(server_txn.create(&ce).is_ok());
+
+ let dyna = server_txn
+ .internal_search_uuid(dyn_uuid)
+ .expect("Failed to access dyn group");
+
+ let dyn_member = dyna
+ .get_ava_refer("member")
+ .expect("Failed to get member attribute");
+ assert!(dyn_member.len() == 1);
+ assert!(dyn_member.contains(&tgroup_uuid));
+
+ let group = server_txn
+ .internal_search_uuid(tgroup_uuid)
+ .expect("Failed to access mo group");
+
+ let grp_member = group
+ .get_ava_refer("memberof")
+ .expect("Failed to get memberof attribute");
+ assert!(grp_member.len() == 1);
+ assert!(grp_member.contains(&dyn_uuid));
+
+ assert!(server_txn.commit().is_ok());
+ }
}