From fd2677af1f57894721374459442bbf9a4d06b655 Mon Sep 17 00:00:00 2001 From: Jens L Date: Sat, 1 Apr 2023 18:10:52 +0200 Subject: [PATCH] root: bump api generator (#5139) * root: bump api generator Signed-off-by: Jens Langhammer * bump api diff too Signed-off-by: Jens Langhammer * bump go api client Signed-off-by: Jens Langhammer * simplify go api generation Signed-off-by: Jens Langhammer --------- Signed-off-by: Jens Langhammer --- Makefile | 21 +++++++++-------- go.mod | 2 +- go.sum | 23 ++----------------- .../proxyv2/application/application.go | 4 ++-- .../proxyv2/application/endpoint_test.go | 6 ++--- .../proxyv2/application/mode_common_test.go | 4 ++-- .../application/mode_forward_caddy_test.go | 4 ++-- .../application/mode_forward_envoy_test.go | 2 +- .../application/mode_forward_nginx_test.go | 4 ++-- .../application/mode_forward_traefik_test.go | 4 ++-- .../outpost/proxyv2/application/oauth_test.go | 2 +- internal/outpost/proxyv2/application/test.go | 4 ++-- .../outpost/proxyv2/application/utils_test.go | 8 +++---- 13 files changed, 35 insertions(+), 53 deletions(-) diff --git a/Makefile b/Makefile index 053e00fb5..49845df42 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ gen-diff: docker run \ --rm -v ${PWD}:/local \ --user ${UID}:${GID} \ - docker.io/openapitools/openapi-diff:2.1.0-beta.3 \ + docker.io/openapitools/openapi-diff:2.1.0-beta.6 \ --markdown /local/diff.md \ /local/old_schema.yml /local/schema.yml rm old_schema.yml @@ -84,7 +84,7 @@ gen-client-ts: docker run \ --rm -v ${PWD}:/local \ --user ${UID}:${GID} \ - docker.io/openapitools/openapi-generator-cli:v6.0.0 generate \ + docker.io/openapitools/openapi-generator-cli:v6.5.0 generate \ -i /local/schema.yml \ -g typescript-fetch \ -o /local/gen-ts-api \ @@ -97,20 +97,21 @@ gen-client-ts: \cp -rfv gen-ts-api/* web/node_modules/@goauthentik/api gen-client-go: - wget https://raw.githubusercontent.com/goauthentik/client-go/main/config.yaml -O config.yaml - mkdir -p templates - wget https://raw.githubusercontent.com/goauthentik/client-go/main/templates/README.mustache -O templates/README.mustache - wget https://raw.githubusercontent.com/goauthentik/client-go/main/templates/go.mod.mustache -O templates/go.mod.mustache + mkdir -p ./gen-go-api ./gen-go-api/templates + wget https://raw.githubusercontent.com/goauthentik/client-go/main/config.yaml -O ./gen-go-api/config.yaml + wget https://raw.githubusercontent.com/goauthentik/client-go/main/templates/README.mustache -O ./gen-go-api/templates/README.mustache + wget https://raw.githubusercontent.com/goauthentik/client-go/main/templates/go.mod.mustache -O ./gen-go-api/templates/go.mod.mustache + cp schema.yml ./gen-go-api/ docker run \ - --rm -v ${PWD}:/local \ + --rm -v ${PWD}/gen-go-api:/local \ --user ${UID}:${GID} \ - docker.io/openapitools/openapi-generator-cli:v6.0.0 generate \ + docker.io/openapitools/openapi-generator-cli:v6.5.0 generate \ -i /local/schema.yml \ -g go \ - -o /local/gen-go-api \ + -o /local/ \ -c /local/config.yaml go mod edit -replace goauthentik.io/api/v3=./gen-go-api - rm -rf config.yaml ./templates/ + rm -rf ./gen-go-api/config.yaml ./gen-go-api/templates/ gen-dev-config: python -m scripts.generate_config diff --git a/go.mod b/go.mod index 59bc74d88..e6a480466 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 github.com/stretchr/testify v1.8.2 - goauthentik.io/api/v3 v3.2023031.10 + goauthentik.io/api/v3 v3.2023031.11 golang.org/x/exp v0.0.0-20230210204819-062eb4c674ab golang.org/x/oauth2 v0.6.0 golang.org/x/sync v0.1.0 diff --git a/go.sum b/go.sum index 4a3d171d7..05b03cc46 100644 --- a/go.sum +++ b/go.sum @@ -19,7 +19,6 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -203,7 +202,6 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -368,7 +366,6 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7Jul github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.11.3 h1:Ql6K6qYHEzB6xvu4+AU0BoRoqf9vFPcc4o7MUIdPW8Y= @@ -384,8 +381,8 @@ go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZp go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= -goauthentik.io/api/v3 v3.2023031.10 h1:jBRAMQdW6xVaLeOMiUVuFvyAuZQYTjVvsxrDqwRumIM= -goauthentik.io/api/v3 v3.2023031.10/go.mod h1:H76Cdv9Nio0vnivoh6u12nlVIrW6x/kkvUwj8udFs4s= +goauthentik.io/api/v3 v3.2023031.11 h1:NpW5itIUFwItuzASaW5lmH5uuj+DEa6A8plReEaqnSo= +goauthentik.io/api/v3 v3.2023031.11/go.mod h1:iqIfjEuAWLMhBjOj9bAGukRrMOrOrCWlsAUV+ukziEw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= @@ -395,7 +392,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be h1:fmw3UbQh+nxngCAHrDCCztao/kbYFnWjoqop8dHx05A= golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -432,8 +428,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -462,14 +456,11 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -492,7 +483,6 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -537,16 +527,11 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -555,7 +540,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -605,9 +589,7 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -689,7 +671,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= diff --git a/internal/outpost/proxyv2/application/application.go b/internal/outpost/proxyv2/application/application.go index 6cddbb929..000f8704c 100644 --- a/internal/outpost/proxyv2/application/application.go +++ b/internal/outpost/proxyv2/application/application.go @@ -192,7 +192,7 @@ func NewApplication(p api.ProxyOutpostConfig, c *http.Client, server Server) (*A mux.HandleFunc("/outpost.goauthentik.io/start", a.handleAuthStart) mux.HandleFunc("/outpost.goauthentik.io/callback", a.handleAuthCallback) mux.HandleFunc("/outpost.goauthentik.io/sign_out", a.handleSignOut) - switch *p.Mode.Get() { + switch *p.Mode { case api.PROXYMODE_PROXY: err = a.configureProxy() case api.PROXYMODE_FORWARD_SINGLE: @@ -229,7 +229,7 @@ func NewApplication(p api.ProxyOutpostConfig, c *http.Client, server Server) (*A } func (a *Application) Mode() api.ProxyMode { - return *a.proxyConfig.Mode.Get() + return *a.proxyConfig.Mode } func (a *Application) HasQuerySignature(r *http.Request) bool { diff --git a/internal/outpost/proxyv2/application/endpoint_test.go b/internal/outpost/proxyv2/application/endpoint_test.go index 145226f36..cf267350a 100644 --- a/internal/outpost/proxyv2/application/endpoint_test.go +++ b/internal/outpost/proxyv2/application/endpoint_test.go @@ -10,7 +10,7 @@ import ( func TestEndpointDefault(t *testing.T) { pc := api.ProxyOutpostConfig{ - OidcConfiguration: api.ProxyOutpostConfigOidcConfiguration{ + OidcConfiguration: api.OpenIDConnectConfiguration{ AuthorizationEndpoint: "https://test.goauthentik.io/application/o/authorize/", EndSessionEndpoint: "https://test.goauthentik.io/application/o/test-app/end-session/", IntrospectionEndpoint: "https://test.goauthentik.io/application/o/introspect/", @@ -38,7 +38,7 @@ func TestEndpointAuthentikHostBrowser(t *testing.T) { c.AuthentikHostBrowser = "" }() pc := api.ProxyOutpostConfig{ - OidcConfiguration: api.ProxyOutpostConfigOidcConfiguration{ + OidcConfiguration: api.OpenIDConnectConfiguration{ AuthorizationEndpoint: "https://test.goauthentik.io/application/o/authorize/", EndSessionEndpoint: "https://test.goauthentik.io/application/o/test-app/end-session/", IntrospectionEndpoint: "https://test.goauthentik.io/application/o/introspect/", @@ -62,7 +62,7 @@ func TestEndpointAuthentikHostBrowser(t *testing.T) { func TestEndpointEmbedded(t *testing.T) { pc := api.ProxyOutpostConfig{ - OidcConfiguration: api.ProxyOutpostConfigOidcConfiguration{ + OidcConfiguration: api.OpenIDConnectConfiguration{ AuthorizationEndpoint: "https://test.goauthentik.io/application/o/authorize/", EndSessionEndpoint: "https://test.goauthentik.io/application/o/test-app/end-session/", IntrospectionEndpoint: "https://test.goauthentik.io/application/o/introspect/", diff --git a/internal/outpost/proxyv2/application/mode_common_test.go b/internal/outpost/proxyv2/application/mode_common_test.go index fc553b644..a258cf17d 100644 --- a/internal/outpost/proxyv2/application/mode_common_test.go +++ b/internal/outpost/proxyv2/application/mode_common_test.go @@ -19,7 +19,7 @@ func urlMustParse(u string) *url.URL { func TestIsAllowlisted_Proxy_Single(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_PROXY.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_PROXY.Ptr() assert.Equal(t, false, a.IsAllowlisted(urlMustParse(""))) a.UnauthenticatedRegex = []*regexp.Regexp{ @@ -30,7 +30,7 @@ func TestIsAllowlisted_Proxy_Single(t *testing.T) { func TestIsAllowlisted_Proxy_Domain(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() assert.Equal(t, false, a.IsAllowlisted(urlMustParse(""))) a.UnauthenticatedRegex = []*regexp.Regexp{ diff --git a/internal/outpost/proxyv2/application/mode_forward_caddy_test.go b/internal/outpost/proxyv2/application/mode_forward_caddy_test.go index b762ce8e7..c2994f7da 100644 --- a/internal/outpost/proxyv2/application/mode_forward_caddy_test.go +++ b/internal/outpost/proxyv2/application/mode_forward_caddy_test.go @@ -110,7 +110,7 @@ func TestForwardHandleCaddy_Single_Claims(t *testing.T) { func TestForwardHandleCaddy_Domain_Blank(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.CookieDomain = api.PtrString("foo") req, _ := http.NewRequest("GET", "/outpost.goauthentik.io/auth/caddy", nil) @@ -122,7 +122,7 @@ func TestForwardHandleCaddy_Domain_Blank(t *testing.T) { func TestForwardHandleCaddy_Domain_Header(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.CookieDomain = api.PtrString("foo") a.proxyConfig.ExternalHost = "http://auth.test.goauthentik.io" req, _ := http.NewRequest("GET", "/outpost.goauthentik.io/auth/caddy", nil) diff --git a/internal/outpost/proxyv2/application/mode_forward_envoy_test.go b/internal/outpost/proxyv2/application/mode_forward_envoy_test.go index a55314247..a8b2abfa0 100644 --- a/internal/outpost/proxyv2/application/mode_forward_envoy_test.go +++ b/internal/outpost/proxyv2/application/mode_forward_envoy_test.go @@ -92,7 +92,7 @@ func TestForwardHandleEnvoy_Single_Claims(t *testing.T) { func TestForwardHandleEnvoy_Domain_Header(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.CookieDomain = api.PtrString("foo") a.proxyConfig.ExternalHost = "http://auth.test.goauthentik.io" req, _ := http.NewRequest("GET", "http:///app", nil) diff --git a/internal/outpost/proxyv2/application/mode_forward_nginx_test.go b/internal/outpost/proxyv2/application/mode_forward_nginx_test.go index 13eaa6231..43729c059 100644 --- a/internal/outpost/proxyv2/application/mode_forward_nginx_test.go +++ b/internal/outpost/proxyv2/application/mode_forward_nginx_test.go @@ -109,7 +109,7 @@ func TestForwardHandleNginx_Single_Claims(t *testing.T) { func TestForwardHandleNginx_Domain_Blank(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.CookieDomain = api.PtrString("foo") req, _ := http.NewRequest("GET", "/outpost.goauthentik.io/auth/nginx", nil) @@ -121,7 +121,7 @@ func TestForwardHandleNginx_Domain_Blank(t *testing.T) { func TestForwardHandleNginx_Domain_Header(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.CookieDomain = api.PtrString("foo") a.proxyConfig.ExternalHost = "http://auth.test.goauthentik.io" req, _ := http.NewRequest("GET", "/outpost.goauthentik.io/auth/nginx", nil) diff --git a/internal/outpost/proxyv2/application/mode_forward_traefik_test.go b/internal/outpost/proxyv2/application/mode_forward_traefik_test.go index 6b3b20c82..227dc1cb5 100644 --- a/internal/outpost/proxyv2/application/mode_forward_traefik_test.go +++ b/internal/outpost/proxyv2/application/mode_forward_traefik_test.go @@ -110,7 +110,7 @@ func TestForwardHandleTraefik_Single_Claims(t *testing.T) { func TestForwardHandleTraefik_Domain_Blank(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.CookieDomain = api.PtrString("foo") req, _ := http.NewRequest("GET", "/outpost.goauthentik.io/auth/traefik", nil) @@ -122,7 +122,7 @@ func TestForwardHandleTraefik_Domain_Blank(t *testing.T) { func TestForwardHandleTraefik_Domain_Header(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.CookieDomain = api.PtrString("foo") a.proxyConfig.ExternalHost = "http://auth.test.goauthentik.io" req, _ := http.NewRequest("GET", "/outpost.goauthentik.io/auth/traefik", nil) diff --git a/internal/outpost/proxyv2/application/oauth_test.go b/internal/outpost/proxyv2/application/oauth_test.go index c68e882da..79e84382d 100644 --- a/internal/outpost/proxyv2/application/oauth_test.go +++ b/internal/outpost/proxyv2/application/oauth_test.go @@ -34,7 +34,7 @@ func TestCheckRedirectParam(t *testing.T) { func TestCheckRedirectParam_Domain(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.CookieDomain = api.PtrString("t.goauthentik.io") req, _ := http.NewRequest("GET", "https://a.t.goauthentik.io/outpost.goauthentik.io/auth/start", nil) diff --git a/internal/outpost/proxyv2/application/test.go b/internal/outpost/proxyv2/application/test.go index b2d693ac0..827bf7970 100644 --- a/internal/outpost/proxyv2/application/test.go +++ b/internal/outpost/proxyv2/application/test.go @@ -50,12 +50,12 @@ func newTestApplication() *Application { InternalHost: api.PtrString("http://backend"), InternalHostSslValidation: api.PtrBool(true), CookieDomain: api.PtrString(""), - Mode: *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_SINGLE.Ptr()), + Mode: api.PROXYMODE_FORWARD_SINGLE.Ptr(), SkipPathRegex: api.PtrString("/skip.*"), BasicAuthEnabled: api.PtrBool(true), BasicAuthUserAttribute: api.PtrString("username"), BasicAuthPasswordAttribute: api.PtrString("password"), - OidcConfiguration: api.ProxyOutpostConfigOidcConfiguration{ + OidcConfiguration: api.OpenIDConnectConfiguration{ AuthorizationEndpoint: "http://fake-auth.t.goauthentik.io/auth", TokenEndpoint: "http://fake-auth.t.goauthentik.io/token", UserinfoEndpoint: "http://fake-auth.t.goauthentik.io/userinfo", diff --git a/internal/outpost/proxyv2/application/utils_test.go b/internal/outpost/proxyv2/application/utils_test.go index 7fa5518c4..eb6f34935 100644 --- a/internal/outpost/proxyv2/application/utils_test.go +++ b/internal/outpost/proxyv2/application/utils_test.go @@ -12,7 +12,7 @@ import ( func TestRedirectToStart_Proxy(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_PROXY.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_PROXY.Ptr() a.proxyConfig.ExternalHost = "https://test.goauthentik.io" req, _ := http.NewRequest("GET", "/foo/bar/baz", nil) @@ -29,7 +29,7 @@ func TestRedirectToStart_Proxy(t *testing.T) { func TestRedirectToStart_Forward(t *testing.T) { a := newTestApplication() - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_SINGLE.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_SINGLE.Ptr() a.proxyConfig.ExternalHost = "https://test.goauthentik.io" req, _ := http.NewRequest("GET", "/foo/bar/baz", nil) @@ -47,7 +47,7 @@ func TestRedirectToStart_Forward(t *testing.T) { func TestRedirectToStart_Forward_Domain_Invalid(t *testing.T) { a := newTestApplication() a.proxyConfig.CookieDomain = api.PtrString("foo") - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.ExternalHost = "https://test.goauthentik.io" req, _ := http.NewRequest("GET", "/foo/bar/baz", nil) @@ -65,7 +65,7 @@ func TestRedirectToStart_Forward_Domain_Invalid(t *testing.T) { func TestRedirectToStart_Forward_Domain(t *testing.T) { a := newTestApplication() a.proxyConfig.CookieDomain = api.PtrString("goauthentik.io") - a.proxyConfig.Mode = *api.NewNullableProxyMode(api.PROXYMODE_FORWARD_DOMAIN.Ptr()) + a.proxyConfig.Mode = api.PROXYMODE_FORWARD_DOMAIN.Ptr() a.proxyConfig.ExternalHost = "https://test.goauthentik.io" req, _ := http.NewRequest("GET", "/foo/bar/baz", nil)