This tests loading of the argon2 OpenLDAP module. Relates to b/184 Change-Id: I661af4ddc238ad02d082b3a0cede55af5ef13f1b Reviewed-on: https://cl.tvl.fyi/c/depot/+/5750 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
		
			
				
	
	
		
			15 lines
		
	
	
	
		
			414 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
	
		
			414 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| # Utility for invoking slappasswd with the correct options for
 | |
| # creating an ARGON2 password hash.
 | |
| { pkgs, ... }:
 | |
| 
 | |
| let
 | |
|   script = pkgs.writeShellScriptBin "hash-password" ''
 | |
|     ${pkgs.openldap}/bin/slappasswd -o module-load=argon2 -h '{ARGON2}' "$@"
 | |
|   '';
 | |
| in
 | |
| script.overrideAttrs (old: {
 | |
|   doCheck = true;
 | |
|   checkPhase = ''
 | |
|     ${pkgs.stdenv.shell} $out/bin/hash-password -s example-password > /dev/null
 | |
|   '';
 | |
| })
 |