nixosTests.nginx-sso: migrate to runTest

Part of #386873
This commit is contained in:
Piotr Kwiecinski 2025-03-30 14:03:48 +02:00
parent 7a830b19d7
commit ff716504b0
No known key found for this signature in database
GPG key ID: EC0DE1CB9D5258B4
2 changed files with 14 additions and 5 deletions

View file

@ -810,7 +810,7 @@ in {
nginx-proxyprotocol = runTest ./nginx-proxyprotocol/default.nix;
nginx-pubhtml = runTest ./nginx-pubhtml.nix;
nginx-redirectcode = runTest ./nginx-redirectcode.nix;
nginx-sso = handleTest ./nginx-sso.nix {};
nginx-sso = runTest ./nginx-sso.nix;
nginx-status-page = handleTest ./nginx-status-page.nix {};
nginx-tmpdir = handleTest ./nginx-tmpdir.nix {};
nginx-unix-socket = handleTest ./nginx-unix-socket.nix {};

View file

@ -1,4 +1,5 @@
import ./make-test-python.nix ({ pkgs, ... }: {
{ pkgs, ... }:
{
name = "nginx-sso";
meta = {
maintainers = with pkgs.lib.maintainers; [ ambroisie ];
@ -8,7 +9,10 @@ import ./make-test-python.nix ({ pkgs, ... }: {
services.nginx.sso = {
enable = true;
configuration = {
listen = { addr = "127.0.0.1"; port = 8080; };
listen = {
addr = "127.0.0.1";
port = 8080;
};
providers.token.tokens = {
myuser = {
@ -19,7 +23,12 @@ import ./make-test-python.nix ({ pkgs, ... }: {
acl = {
rule_sets = [
{
rules = [ { field = "x-application"; equals = "MyApp"; } ];
rules = [
{
field = "x-application";
equals = "MyApp";
}
];
allow = [ "myuser" ];
}
];
@ -47,4 +56,4 @@ import ./make-test-python.nix ({ pkgs, ... }: {
"curl -sSf -H 'Authorization: Token MyToken' -H 'X-Application: MyApp' http://localhost:8080/auth"
)
'';
})
}