From 677422fdd1ad48d1002377202b6e4ca07e3d2209 Mon Sep 17 00:00:00 2001 From: wsalles Date: Wed, 23 Feb 2022 13:48:54 +0000 Subject: [PATCH 1/5] feat(cookie): Include Cookie Name as Env Var closes [PLT-296] --- cmd/main.go | 8 ++- go.mod | 48 +------------ go.sum | 69 ++----------------- ...ookie_credentials_handler_configuration.go | 15 ++++ .../rest_controller_configuration.go | 1 + internal/controllers/rest_controller.go | 18 ++--- .../handlers/cookie_credentials_handler.go | 12 ++-- .../cookie_credentials_handler_test.go | 6 +- 8 files changed, 48 insertions(+), 129 deletions(-) create mode 100644 internal/configurations/cookie_credentials_handler_configuration.go diff --git a/cmd/main.go b/cmd/main.go index 668bc33..11c3d47 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -23,17 +23,19 @@ var ( func main() { loggerConfiguration := logging.LoggerConfiguration{} - serverConfiguration := server.HTTPServerConfiguration{} oidcClientConfiguration := configurations.OIDCClientConfiguration{} oidcServiceConfiguration := configurations.OIDCServiceConfiguration{} + cookieCredentialsHandlerConfiguration := configurations.CookieCredentialsHandlerConfiguration{} restConfiguration := configurations.RESTControllerConfiguration{} + serverConfiguration := server.HTTPServerConfiguration{} if err := config.InitConfigurationVariables([]config.ConfigurationVariables{ &loggerConfiguration, - &serverConfiguration, &oidcClientConfiguration, &oidcServiceConfiguration, + &cookieCredentialsHandlerConfiguration, &restConfiguration, + &serverConfiguration, }); err != nil { fmt.Println(fmt.Errorf("[✖️] Could not set configuration variables. Err: %v", err)) os.Exit(1) @@ -52,7 +54,7 @@ func main() { // Gathering the Credentials Handler. headerCredentials := handlers.NewHeaderCredentialsHandler(logger) - cookieCredentials := handlers.NewCookieCredentialsHandler(logger) + cookieCredentials := handlers.NewCookieCredentialsHandler(logger, cookieCredentialsHandlerConfiguration) // preference is chosen here. credentials := []handlers.CredentialsHandler{ headerCredentials, diff --git a/go.mod b/go.mod index d11ba74..7781412 100644 --- a/go.mod +++ b/go.mod @@ -4,78 +4,36 @@ go 1.17 require ( github.com/coreos/go-oidc/v3 v3.1.0 - github.com/gin-gonic/gin v1.7.4 + github.com/gin-gonic/gin v1.7.7 github.com/golang-jwt/jwt/v4 v4.2.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/stretchr/testify v1.7.0 - github.com/ydataai/go-core v0.7.3 + github.com/ydataai/go-core v0.9.0 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 ) require ( - github.com/armon/go-metrics v0.3.9 // indirect - github.com/armon/go-radix v1.0.0 // indirect - github.com/cenkalti/backoff/v3 v3.0.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/fatih/color v1.7.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-playground/validator/v10 v10.4.1 // indirect - github.com/go-redis/redis/v8 v8.11.4 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.1.2 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.1 // indirect - github.com/hashicorp/go-hclog v0.16.2 // indirect - github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.4.3 // indirect - github.com/hashicorp/go-retryablehttp v0.6.6 // indirect - github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/go-secure-stdlib/mlock v0.1.1 // indirect - github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1 // indirect - github.com/hashicorp/go-secure-stdlib/strutil v0.1.1 // indirect - github.com/hashicorp/go-sockaddr v1.0.2 // indirect - github.com/hashicorp/go-uuid v1.0.2 // indirect - github.com/hashicorp/go-version v1.2.0 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/vault/api v1.3.0 // indirect - github.com/hashicorp/vault/sdk v0.3.0 // indirect - github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/json-iterator/go v1.1.11 // indirect + github.com/kr/text v0.2.0 // indirect github.com/leodido/go-urn v1.2.0 // indirect - github.com/mattn/go-colorable v0.1.6 // indirect github.com/mattn/go-isatty v0.0.12 // indirect - github.com/mitchellh/copystructure v1.0.0 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/go-testing-interface v1.0.0 // indirect - github.com/mitchellh/mapstructure v1.4.2 // indirect - github.com/mitchellh/reflectwalk v1.0.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/oklog/run v1.0.0 // indirect - github.com/pierrec/lz4 v2.5.2+incompatible // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.11.0 // indirect - github.com/prometheus/common v0.26.0 // indirect - github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/ugorji/go/codec v1.1.7 // indirect - go.uber.org/atomic v1.9.0 // indirect golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 // indirect - golang.org/x/text v0.3.6 // indirect - golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect - google.golang.org/grpc v1.41.0 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/square/go-jose.v2 v2.5.1 // indirect diff --git a/go.sum b/go.sum index d080b69..f686050 100644 --- a/go.sum +++ b/go.sum @@ -57,30 +57,24 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.9 h1:O2sNqxBdvq8Eq5xmzljcYzAORli6RWCvEym4cJf9m18= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -111,7 +105,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -129,25 +122,22 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= -github.com/frankban/quicktest v1.13.0 h1:yNZif1OkDfNoDfb9zZa9aXIpejNR4F23Wely0c+Qdqk= github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= +github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -177,11 +167,9 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -221,7 +209,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -267,66 +254,47 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.4.3 h1:DXmvivbWD5qdiBts9TpBC7BYL1Aia5sxbRgQB+v6UZM= github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-secure-stdlib/base62 v0.1.1/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw= -github.com/hashicorp/go-secure-stdlib/mlock v0.1.1 h1:cCRo8gK7oq6A2L6LICkUZ+/a5rLiRXFMf1Qd4xSwxTc= github.com/hashicorp/go-secure-stdlib/mlock v0.1.1/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1 h1:78ki3QBevHwYrVxnyVeaEz+7WtifHhauYF23es/0KlI= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= github.com/hashicorp/go-secure-stdlib/password v0.1.1/go.mod h1:9hH302QllNwu1o2TGYtSk8I8kTAN0ca1EHpwhm5Mmzo= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.1 h1:nd0HIW15E6FG1MsnArYaHfuw9C2zgzM8LxkG5Ty/788= github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.1/go.mod h1:l8slYwnJA26yBz+ErHpp2IRCLr0vuOMGBORIz4rRiAs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/vault/api v1.3.0 h1:uDy39PLSvy6gtKyjOCRPizy2QdFiIYSWBR2pxCEzYL8= github.com/hashicorp/vault/api v1.3.0/go.mod h1:EabNQLI0VWbWoGlA+oBLC8PXmR9D60aUVgQGvangFWQ= -github.com/hashicorp/vault/sdk v0.3.0 h1:kR3dpxNkhh/wr6ycaJYqp6AFT/i2xaftbfnwZduTKEY= github.com/hashicorp/vault/sdk v0.3.0/go.mod h1:aZ3fNuL5VNydQk8GcLJ2TV8YCRVvyaakYkhZRoVuhj0= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -334,12 +302,10 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -362,7 +328,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -376,7 +341,6 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -384,17 +348,13 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= @@ -402,9 +362,7 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= @@ -417,36 +375,29 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -460,26 +411,22 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -488,7 +435,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -514,7 +460,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -532,8 +477,8 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/ydataai/go-core v0.7.3 h1:K1z4zQS0CWv/DygzyOX0XS5h3InST1+oJK3P88q7RyU= -github.com/ydataai/go-core v0.7.3/go.mod h1:iqZ6dM1MSGvSO0w2BpsCbNkTgKxAJ4EczQz8+jTe50k= +github.com/ydataai/go-core v0.9.0 h1:LtSjY6gmNfMgK7QF7ipLY/mkvGvfOx3Asvl399cN6Xk= +github.com/ydataai/go-core v0.9.0/go.mod h1:iqZ6dM1MSGvSO0w2BpsCbNkTgKxAJ4EczQz8+jTe50k= 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= @@ -567,7 +512,6 @@ go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16g go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -747,14 +691,12 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 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 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -870,7 +812,6 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -889,7 +830,6 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -920,7 +860,6 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/internal/configurations/cookie_credentials_handler_configuration.go b/internal/configurations/cookie_credentials_handler_configuration.go new file mode 100644 index 0000000..1b1fc05 --- /dev/null +++ b/internal/configurations/cookie_credentials_handler_configuration.go @@ -0,0 +1,15 @@ +package configurations + +import ( + "github.com/kelseyhightower/envconfig" +) + +// CookieCredentialsHandlerConfiguration defines a struct with required environment variables. +type CookieCredentialsHandlerConfiguration struct { + AccessTokenCookie string `envconfig:"ACCESS_TOKEN_COOKIE" default:"access_token"` +} + +// LoadFromEnvVars from the Cookie Credentials Handler. +func (c *CookieCredentialsHandlerConfiguration) LoadFromEnvVars() error { + return envconfig.Process("", c) +} diff --git a/internal/configurations/rest_controller_configuration.go b/internal/configurations/rest_controller_configuration.go index 40f964c..ad42310 100644 --- a/internal/configurations/rest_controller_configuration.go +++ b/internal/configurations/rest_controller_configuration.go @@ -15,6 +15,7 @@ type RESTControllerConfiguration struct { HTTPRequestTimeout time.Duration `envconfig:"HTTP_REQUEST_TIMEOUT" default:"30s"` UserIDHeader string `envconfig:"USER_ID_HEADER" default:"userid"` CookieMaxAge int `envconfig:"COOKIE_MAX_AGE" default:"86400"` + AccessTokenCookie string `envconfig:"ACCESS_TOKEN_COOKIE" default:"access_token"` SkipURLs []string `envconfig:"SKIP_URLS" default:"/dex" split_words:"true"` } diff --git a/internal/controllers/rest_controller.go b/internal/controllers/rest_controller.go index 7509f82..1f85137 100644 --- a/internal/controllers/rest_controller.go +++ b/internal/controllers/rest_controller.go @@ -3,6 +3,7 @@ package controllers import ( "context" "encoding/json" + "fmt" "net/http" "strings" "time" @@ -76,8 +77,7 @@ func (rc RESTController) CheckForAuthentication(w http.ResponseWriter, r *http.R } // if a token was passed but it is not valid, the flow must be stopped. if err != nil { - rc.logger.Errorf("an error occurred while decoding token: %v", err) - rc.forbiddenResponse(w, err) + rc.forbiddenResponse(w, fmt.Errorf("an error occurred while decoding token: %v", err)) return } @@ -95,7 +95,6 @@ func (rc RESTController) RedirectToOIDCProvider(w http.ResponseWriter, r *http.R rc.logger.Info("Starting OIDC flow") oidcProviderURL, err := rc.oidcService.GetOIDCProviderURL() if err != nil { - rc.logger.Error(err.Error()) rc.internalServerError(w, err) return } @@ -117,7 +116,6 @@ func (rc RESTController) OIDCProviderCallback(w http.ResponseWriter, r *http.Req // Creates an OAuth2 token with the auth code returned from the OIDC Provider. token, err := rc.oidcService.Claims(ctx, codeProvider) if err != nil { - rc.logger.Error(err) rc.forbiddenResponse(w, err) return } @@ -126,7 +124,6 @@ func (rc RESTController) OIDCProviderCallback(w http.ResponseWriter, r *http.Req // with the callback from the OIDC Provider. safe, err := rc.oidcService.IsFlowSecure(stateProvider, token) if !safe { - rc.logger.Error(err) rc.forbiddenResponse(w, err) return } @@ -134,12 +131,11 @@ func (rc RESTController) OIDCProviderCallback(w http.ResponseWriter, r *http.Req // If the flow is secure, a JWT will be created... jwt, err := rc.oidcService.Create(token.CustomClaims) if err != nil { - rc.logger.Errorf("an error occurred while creating a JWT. Error: %v", err) - rc.forbiddenResponse(w, err) + rc.forbiddenResponse(w, fmt.Errorf("an error occurred while creating a JWT. Error: %v", err)) return } // ...set a session cookie. - rc.setSessionCookie(w, r, "access_token", jwt.AccessToken) + rc.setSessionCookie(w, r, rc.configuration.AccessTokenCookie, jwt.AccessToken) rc.logger.Infof("Redirecting back to %s", rc.configuration.AuthServiceURL) http.Redirect(w, r, rc.configuration.AuthServiceURL, http.StatusFound) @@ -156,8 +152,7 @@ func (rc RESTController) UserInfo(w http.ResponseWriter, r *http.Request) { } userInfo, err := rc.oidcService.Decode(token) if err != nil { - rc.logger.Errorf("an error occurred while decoding token: %v", err) - rc.forbiddenResponse(w, err) + rc.forbiddenResponse(w, fmt.Errorf("an error occurred while decoding token: %v", err)) return } @@ -176,7 +171,7 @@ func (rc RESTController) Logout(w http.ResponseWriter, r *http.Request) { return } - rc.deleteSessionCookie(w, "access_token") + rc.deleteSessionCookie(w, rc.configuration.AccessTokenCookie) w.WriteHeader(http.StatusOK) } @@ -213,6 +208,7 @@ func (rc RESTController) deleteSessionCookie(w http.ResponseWriter, name string) } func (rc RESTController) errorResponse(w http.ResponseWriter, code int, err error) { + rc.logger.Error(err) w.Header().Set("Content-Type", "application/json") w.WriteHeader(code) jsonBody := models.ErrorResponse{ diff --git a/internal/handlers/cookie_credentials_handler.go b/internal/handlers/cookie_credentials_handler.go index 45ec97c..3e6bca2 100644 --- a/internal/handlers/cookie_credentials_handler.go +++ b/internal/handlers/cookie_credentials_handler.go @@ -3,25 +3,29 @@ package handlers import ( "net/http" + "github.com/ydataai/authentication-service/internal/configurations" authErrors "github.com/ydataai/authentication-service/internal/errors" "github.com/ydataai/go-core/pkg/common/logging" ) // CookieCredentialsHandler defines a CookieCredentialsHandler struct. type CookieCredentialsHandler struct { - logger logging.Logger + logger logging.Logger + configuration configurations.CookieCredentialsHandlerConfiguration } // NewCookieCredentialsHandler defines a new CookieCredentialsHandler struct. -func NewCookieCredentialsHandler(logger logging.Logger) CredentialsHandler { +func NewCookieCredentialsHandler(logger logging.Logger, + configuration configurations.CookieCredentialsHandlerConfiguration) CredentialsHandler { return &CookieCredentialsHandler{ - logger: logger, + logger: logger, + configuration: configuration, } } // Extract is an interface that extracts credential information from the cookie. func (ac *CookieCredentialsHandler) Extract(r *http.Request) (string, error) { - token, err := r.Cookie("access_token") + token, err := r.Cookie(ac.configuration.AccessTokenCookie) if err != nil { ac.logger.Infof("%s cookie", notFoundMsg) return "", authErrors.ErrorTokenNotFound diff --git a/internal/handlers/cookie_credentials_handler_test.go b/internal/handlers/cookie_credentials_handler_test.go index fb84140..591504b 100644 --- a/internal/handlers/cookie_credentials_handler_test.go +++ b/internal/handlers/cookie_credentials_handler_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/assert" + "github.com/ydataai/authentication-service/internal/configurations" authErrors "github.com/ydataai/authentication-service/internal/errors" "github.com/ydataai/go-core/pkg/common/logging" ) @@ -15,7 +16,10 @@ func TestCookieExtract(t *testing.T) { loggerConfig := logging.LoggerConfiguration{} loggerConfig.Level = "warn" logger := logging.NewLogger(loggerConfig) - cc := NewCookieCredentialsHandler(logger) + + cookieCredentialsHandlerConfiguration := configurations.CookieCredentialsHandlerConfiguration{} + cookieCredentialsHandlerConfiguration.LoadFromEnvVars() + cc := NewCookieCredentialsHandler(logger, cookieCredentialsHandlerConfiguration) mockRequestWithCookie := func(key, value string) *http.Request { return &http.Request{Header: http.Header{ From dd1af52320eee592f312bb146588c66e96637d60 Mon Sep 17 00:00:00 2001 From: wsalles Date: Wed, 23 Feb 2022 15:01:14 +0000 Subject: [PATCH 2/5] code review --- cmd/main.go | 8 ++++---- .../configurations/authservice_configuration.go | 15 +++++++++++++++ .../cookie_credentials_handler_configuration.go | 15 --------------- .../rest_controller_configuration.go | 1 - internal/controllers/rest_controller.go | 6 ++++-- internal/handlers/cookie_credentials_handler.go | 6 +++--- .../handlers/cookie_credentials_handler_test.go | 6 +++--- 7 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 internal/configurations/authservice_configuration.go delete mode 100644 internal/configurations/cookie_credentials_handler_configuration.go diff --git a/cmd/main.go b/cmd/main.go index 11c3d47..53dc7f1 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -25,7 +25,7 @@ func main() { loggerConfiguration := logging.LoggerConfiguration{} oidcClientConfiguration := configurations.OIDCClientConfiguration{} oidcServiceConfiguration := configurations.OIDCServiceConfiguration{} - cookieCredentialsHandlerConfiguration := configurations.CookieCredentialsHandlerConfiguration{} + authServiceConfiguration := configurations.AuthServiceConfiguration{} restConfiguration := configurations.RESTControllerConfiguration{} serverConfiguration := server.HTTPServerConfiguration{} @@ -33,7 +33,7 @@ func main() { &loggerConfiguration, &oidcClientConfiguration, &oidcServiceConfiguration, - &cookieCredentialsHandlerConfiguration, + &authServiceConfiguration, &restConfiguration, &serverConfiguration, }); err != nil { @@ -54,14 +54,14 @@ func main() { // Gathering the Credentials Handler. headerCredentials := handlers.NewHeaderCredentialsHandler(logger) - cookieCredentials := handlers.NewCookieCredentialsHandler(logger, cookieCredentialsHandlerConfiguration) + cookieCredentials := handlers.NewCookieCredentialsHandler(logger, authServiceConfiguration) // preference is chosen here. credentials := []handlers.CredentialsHandler{ headerCredentials, cookieCredentials, } - restController := controllers.NewRESTController(logger, restConfiguration, oidcService, credentials) + restController := controllers.NewRESTController(logger, restConfiguration, authServiceConfiguration, oidcService, credentials) httpServer := server.NewServer(logger, serverConfiguration) restController.Boot(httpServer) diff --git a/internal/configurations/authservice_configuration.go b/internal/configurations/authservice_configuration.go new file mode 100644 index 0000000..30dd3f8 --- /dev/null +++ b/internal/configurations/authservice_configuration.go @@ -0,0 +1,15 @@ +package configurations + +import ( + "github.com/kelseyhightower/envconfig" +) + +// AuthServiceConfiguration defines a struct with required environment variables. +type AuthServiceConfiguration struct { + AccessTokenCookieName string `envconfig:"ACCESS_TOKEN_COOKIE_NAME" default:"access_token"` +} + +// LoadFromEnvVars from the Authentication Service. +func (c *AuthServiceConfiguration) LoadFromEnvVars() error { + return envconfig.Process("", c) +} diff --git a/internal/configurations/cookie_credentials_handler_configuration.go b/internal/configurations/cookie_credentials_handler_configuration.go deleted file mode 100644 index 1b1fc05..0000000 --- a/internal/configurations/cookie_credentials_handler_configuration.go +++ /dev/null @@ -1,15 +0,0 @@ -package configurations - -import ( - "github.com/kelseyhightower/envconfig" -) - -// CookieCredentialsHandlerConfiguration defines a struct with required environment variables. -type CookieCredentialsHandlerConfiguration struct { - AccessTokenCookie string `envconfig:"ACCESS_TOKEN_COOKIE" default:"access_token"` -} - -// LoadFromEnvVars from the Cookie Credentials Handler. -func (c *CookieCredentialsHandlerConfiguration) LoadFromEnvVars() error { - return envconfig.Process("", c) -} diff --git a/internal/configurations/rest_controller_configuration.go b/internal/configurations/rest_controller_configuration.go index ad42310..40f964c 100644 --- a/internal/configurations/rest_controller_configuration.go +++ b/internal/configurations/rest_controller_configuration.go @@ -15,7 +15,6 @@ type RESTControllerConfiguration struct { HTTPRequestTimeout time.Duration `envconfig:"HTTP_REQUEST_TIMEOUT" default:"30s"` UserIDHeader string `envconfig:"USER_ID_HEADER" default:"userid"` CookieMaxAge int `envconfig:"COOKIE_MAX_AGE" default:"86400"` - AccessTokenCookie string `envconfig:"ACCESS_TOKEN_COOKIE" default:"access_token"` SkipURLs []string `envconfig:"SKIP_URLS" default:"/dex" split_words:"true"` } diff --git a/internal/controllers/rest_controller.go b/internal/controllers/rest_controller.go index 1f85137..ef18e3c 100644 --- a/internal/controllers/rest_controller.go +++ b/internal/controllers/rest_controller.go @@ -22,6 +22,7 @@ import ( // RESTController defines rest controller. type RESTController struct { configuration configurations.RESTControllerConfiguration + authSvcConfig configurations.AuthServiceConfiguration oidcService services.OIDCService credentials []handlers.CredentialsHandler logger logging.Logger @@ -31,6 +32,7 @@ type RESTController struct { func NewRESTController( logger logging.Logger, configuration configurations.RESTControllerConfiguration, + authSvcConfig configurations.AuthServiceConfiguration, oidcService services.OIDCService, credentials []handlers.CredentialsHandler, ) RESTController { @@ -135,7 +137,7 @@ func (rc RESTController) OIDCProviderCallback(w http.ResponseWriter, r *http.Req return } // ...set a session cookie. - rc.setSessionCookie(w, r, rc.configuration.AccessTokenCookie, jwt.AccessToken) + rc.setSessionCookie(w, r, rc.authSvcConfig.AccessTokenCookieName, jwt.AccessToken) rc.logger.Infof("Redirecting back to %s", rc.configuration.AuthServiceURL) http.Redirect(w, r, rc.configuration.AuthServiceURL, http.StatusFound) @@ -171,7 +173,7 @@ func (rc RESTController) Logout(w http.ResponseWriter, r *http.Request) { return } - rc.deleteSessionCookie(w, rc.configuration.AccessTokenCookie) + rc.deleteSessionCookie(w, rc.authSvcConfig.AccessTokenCookieName) w.WriteHeader(http.StatusOK) } diff --git a/internal/handlers/cookie_credentials_handler.go b/internal/handlers/cookie_credentials_handler.go index 3e6bca2..1706e2e 100644 --- a/internal/handlers/cookie_credentials_handler.go +++ b/internal/handlers/cookie_credentials_handler.go @@ -11,12 +11,12 @@ import ( // CookieCredentialsHandler defines a CookieCredentialsHandler struct. type CookieCredentialsHandler struct { logger logging.Logger - configuration configurations.CookieCredentialsHandlerConfiguration + configuration configurations.AuthServiceConfiguration } // NewCookieCredentialsHandler defines a new CookieCredentialsHandler struct. func NewCookieCredentialsHandler(logger logging.Logger, - configuration configurations.CookieCredentialsHandlerConfiguration) CredentialsHandler { + configuration configurations.AuthServiceConfiguration) CredentialsHandler { return &CookieCredentialsHandler{ logger: logger, configuration: configuration, @@ -25,7 +25,7 @@ func NewCookieCredentialsHandler(logger logging.Logger, // Extract is an interface that extracts credential information from the cookie. func (ac *CookieCredentialsHandler) Extract(r *http.Request) (string, error) { - token, err := r.Cookie(ac.configuration.AccessTokenCookie) + token, err := r.Cookie(ac.configuration.AccessTokenCookieName) if err != nil { ac.logger.Infof("%s cookie", notFoundMsg) return "", authErrors.ErrorTokenNotFound diff --git a/internal/handlers/cookie_credentials_handler_test.go b/internal/handlers/cookie_credentials_handler_test.go index 591504b..79b314d 100644 --- a/internal/handlers/cookie_credentials_handler_test.go +++ b/internal/handlers/cookie_credentials_handler_test.go @@ -17,9 +17,9 @@ func TestCookieExtract(t *testing.T) { loggerConfig.Level = "warn" logger := logging.NewLogger(loggerConfig) - cookieCredentialsHandlerConfiguration := configurations.CookieCredentialsHandlerConfiguration{} - cookieCredentialsHandlerConfiguration.LoadFromEnvVars() - cc := NewCookieCredentialsHandler(logger, cookieCredentialsHandlerConfiguration) + authSvcConfig := configurations.AuthServiceConfiguration{} + authSvcConfig.LoadFromEnvVars() + cc := NewCookieCredentialsHandler(logger, authSvcConfig) mockRequestWithCookie := func(key, value string) *http.Request { return &http.Request{Header: http.Header{ From 79c272c8d9baaf6d6ac9b14bef375cf96f6313aa Mon Sep 17 00:00:00 2001 From: wsalles Date: Wed, 23 Feb 2022 18:45:58 +0000 Subject: [PATCH 3/5] code review #2 --- cmd/main.go | 14 ++--- .../authservice_configuration.go | 15 ----- ...ookie_credentials_handler_configuration.go | 15 +++++ internal/controllers/rest_controller.go | 61 +++++++++++-------- .../handlers/cookie_credentials_handler.go | 9 ++- .../cookie_credentials_handler_test.go | 4 +- internal/handlers/credentials_handler.go | 1 + .../handlers/header_credentials_handler.go | 5 ++ 8 files changed, 71 insertions(+), 53 deletions(-) delete mode 100644 internal/configurations/authservice_configuration.go create mode 100644 internal/configurations/cookie_credentials_handler_configuration.go diff --git a/cmd/main.go b/cmd/main.go index 53dc7f1..c2034ed 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -25,7 +25,7 @@ func main() { loggerConfiguration := logging.LoggerConfiguration{} oidcClientConfiguration := configurations.OIDCClientConfiguration{} oidcServiceConfiguration := configurations.OIDCServiceConfiguration{} - authServiceConfiguration := configurations.AuthServiceConfiguration{} + cookieCredentialsHandlerConfiguration := configurations.CookieCredentialsHandlerConfiguration{} restConfiguration := configurations.RESTControllerConfiguration{} serverConfiguration := server.HTTPServerConfiguration{} @@ -33,7 +33,7 @@ func main() { &loggerConfiguration, &oidcClientConfiguration, &oidcServiceConfiguration, - &authServiceConfiguration, + &cookieCredentialsHandlerConfiguration, &restConfiguration, &serverConfiguration, }); err != nil { @@ -54,14 +54,14 @@ func main() { // Gathering the Credentials Handler. headerCredentials := handlers.NewHeaderCredentialsHandler(logger) - cookieCredentials := handlers.NewCookieCredentialsHandler(logger, authServiceConfiguration) + cookieCredentials := handlers.NewCookieCredentialsHandler(logger, cookieCredentialsHandlerConfiguration) // preference is chosen here. - credentials := []handlers.CredentialsHandler{ - headerCredentials, - cookieCredentials, + credentials := map[string]handlers.CredentialsHandler{ + "header": headerCredentials, + "cookie": cookieCredentials, } - restController := controllers.NewRESTController(logger, restConfiguration, authServiceConfiguration, oidcService, credentials) + restController := controllers.NewRESTController(logger, restConfiguration, oidcService, credentials) httpServer := server.NewServer(logger, serverConfiguration) restController.Boot(httpServer) diff --git a/internal/configurations/authservice_configuration.go b/internal/configurations/authservice_configuration.go deleted file mode 100644 index 30dd3f8..0000000 --- a/internal/configurations/authservice_configuration.go +++ /dev/null @@ -1,15 +0,0 @@ -package configurations - -import ( - "github.com/kelseyhightower/envconfig" -) - -// AuthServiceConfiguration defines a struct with required environment variables. -type AuthServiceConfiguration struct { - AccessTokenCookieName string `envconfig:"ACCESS_TOKEN_COOKIE_NAME" default:"access_token"` -} - -// LoadFromEnvVars from the Authentication Service. -func (c *AuthServiceConfiguration) LoadFromEnvVars() error { - return envconfig.Process("", c) -} diff --git a/internal/configurations/cookie_credentials_handler_configuration.go b/internal/configurations/cookie_credentials_handler_configuration.go new file mode 100644 index 0000000..ea0c65a --- /dev/null +++ b/internal/configurations/cookie_credentials_handler_configuration.go @@ -0,0 +1,15 @@ +package configurations + +import ( + "github.com/kelseyhightower/envconfig" +) + +// CookieCredentialsHandlerConfiguration defines a struct with required environment variables. +type CookieCredentialsHandlerConfiguration struct { + AccessTokenCookieName string `envconfig:"ACCESS_TOKEN_COOKIE_NAME" default:"access_token"` +} + +// LoadFromEnvVars from the Cookie Credentials Handler. +func (c *CookieCredentialsHandlerConfiguration) LoadFromEnvVars() error { + return envconfig.Process("", c) +} diff --git a/internal/controllers/rest_controller.go b/internal/controllers/rest_controller.go index ef18e3c..e6bd08e 100644 --- a/internal/controllers/rest_controller.go +++ b/internal/controllers/rest_controller.go @@ -22,9 +22,8 @@ import ( // RESTController defines rest controller. type RESTController struct { configuration configurations.RESTControllerConfiguration - authSvcConfig configurations.AuthServiceConfiguration oidcService services.OIDCService - credentials []handlers.CredentialsHandler + credentials map[string]handlers.CredentialsHandler logger logging.Logger } @@ -32,9 +31,8 @@ type RESTController struct { func NewRESTController( logger logging.Logger, configuration configurations.RESTControllerConfiguration, - authSvcConfig configurations.AuthServiceConfiguration, oidcService services.OIDCService, - credentials []handlers.CredentialsHandler, + credentials map[string]handlers.CredentialsHandler, ) RESTController { return RESTController{ configuration: configuration, @@ -48,38 +46,45 @@ func NewRESTController( func (rc RESTController) Boot(s *server.Server) { s.Router.Use(rc.skipURLsMiddleware()) - s.Router.GET(rc.configuration.AuthServiceURL, gin.WrapF(rc.CheckForAuthentication)) + s.Router.GET(rc.configuration.AuthServiceURL, rc.CheckForAuthentication) s.Router.GET(rc.configuration.OIDCCallbackURL, gin.WrapF(rc.OIDCProviderCallback)) s.Router.GET(rc.configuration.UserInfoURL, gin.WrapF(rc.UserInfo)) s.Router.POST(rc.configuration.LogoutURL, gin.WrapF(rc.Logout)) - s.Router.Any("/:forward", gin.WrapF(rc.CheckForAuthentication)) - s.Router.Any("/:forward/*any", gin.WrapF(rc.CheckForAuthentication)) + s.Router.Any("/:forward", rc.CheckForAuthentication) + s.Router.Any("/:forward/*any", rc.CheckForAuthentication) } // CheckForAuthentication is responsible for knowing if the user already has a valid credential or not. // If so, forward 200 OK + UserID Headers. // If not, begin OIDC Flow. -func (rc RESTController) CheckForAuthentication(w http.ResponseWriter, r *http.Request) { +func (rc RESTController) CheckForAuthentication(c *gin.Context) { // workflow to identify if there is a token present. - token, err := rc.getCredentials(r) + token, kind, err := rc.getCredentials(c.Request) // if a token is not found, the OIDC flow will be started. if authErrors.IsTokenNotFound(err) { - rc.RedirectToOIDCProvider(w, r) + rc.RedirectToOIDCProvider(c.Writer, c.Request) return } userInfo, err := rc.oidcService.Decode(token) // check if the token is expired or signature invalid. - // if so, the OIDC flow will be started to recreate a token. if authErrors.IsTokenExpired(err) || authErrors.IsTokenSignatureInvalid(err) { - rc.logger.Warn(err) - rc.RedirectToOIDCProvider(w, r) + // check if the authentication is being done by cookie + // if so, the OIDC flow will be started to recreate a token. + if kind == "cookie" { + rc.logger.Warn(err) + rc.RedirectToOIDCProvider(c.Writer, c.Request) + return + } + // if not, return Forbidden + rc.forbiddenResponse(c.Writer, err) + c.Abort() return } // if a token was passed but it is not valid, the flow must be stopped. if err != nil { - rc.forbiddenResponse(w, fmt.Errorf("an error occurred while decoding token: %v", err)) + rc.forbiddenResponse(c.Writer, fmt.Errorf("an error occurred while decoding token: %v", err)) return } @@ -88,8 +93,9 @@ func (rc RESTController) CheckForAuthentication(w http.ResponseWriter, r *http.R rc.logger.Infof("Authorizing request for UserID: %v", userInfo.Email) // set UserID Header + 200 OK - w.Header().Set(rc.configuration.UserIDHeader, userInfo.Email) - w.WriteHeader(http.StatusOK) + c.Writer.Header().Set(rc.configuration.UserIDHeader, userInfo.Email) + c.Writer.WriteHeader(http.StatusOK) + c.Next() } // RedirectToOIDCProvider is the handler responsible for redirecting to the OIDC Provider. @@ -137,7 +143,8 @@ func (rc RESTController) OIDCProviderCallback(w http.ResponseWriter, r *http.Req return } // ...set a session cookie. - rc.setSessionCookie(w, r, rc.authSvcConfig.AccessTokenCookieName, jwt.AccessToken) + cookieName := rc.credentials["cookie"].GetKeyName() + rc.setSessionCookie(w, r, cookieName, jwt.AccessToken) rc.logger.Infof("Redirecting back to %s", rc.configuration.AuthServiceURL) http.Redirect(w, r, rc.configuration.AuthServiceURL, http.StatusFound) @@ -146,7 +153,7 @@ func (rc RESTController) OIDCProviderCallback(w http.ResponseWriter, r *http.Req // UserInfo shows user info from the OIDC Provider. func (rc RESTController) UserInfo(w http.ResponseWriter, r *http.Request) { // workflow to identify if there is a token present. - token, err := rc.getCredentials(r) + token, _, err := rc.getCredentials(r) // if a token is not found, return Forbidden. if authErrors.IsTokenNotFound(err) { rc.forbiddenResponse(w, err) @@ -166,31 +173,33 @@ func (rc RESTController) UserInfo(w http.ResponseWriter, r *http.Request) { // Logout is responsible for revoking a token and deleting an authentication cookie. func (rc RESTController) Logout(w http.ResponseWriter, r *http.Request) { // workflow to identify if there is a token present. - _, err := rc.getCredentials(r) + _, kind, err := rc.getCredentials(r) // if a token is not found, return Forbidden. if authErrors.IsTokenNotFound(err) { rc.forbiddenResponse(w, err) return } - rc.deleteSessionCookie(w, rc.authSvcConfig.AccessTokenCookieName) - w.WriteHeader(http.StatusOK) + if kind == "cookie" { + rc.deleteSessionCookie(w, rc.credentials[kind].GetKeyName()) + w.WriteHeader(http.StatusOK) + } } // getCredentials is responsible for simply getting credentials. -func (rc RESTController) getCredentials(r *http.Request) (string, error) { +func (rc RESTController) getCredentials(r *http.Request) (string, string, error) { rc.logger.Info("Get request credentials...") - for _, auth := range rc.credentials { + for kind, auth := range rc.credentials { token, err := auth.Extract(r) if authErrors.IsTokenNotFound(err) { continue } // credentials sent. - rc.logger.Debug(token) - return token, nil + rc.logger.Debugf("Token found in %s: %s", kind, token) + return token, kind, nil } // back to start OIDC flow. - return "", authErrors.ErrorTokenNotFound + return "", "", authErrors.ErrorTokenNotFound } func (rc RESTController) setSessionCookie(w http.ResponseWriter, r *http.Request, name, value string) { diff --git a/internal/handlers/cookie_credentials_handler.go b/internal/handlers/cookie_credentials_handler.go index 1706e2e..beee27f 100644 --- a/internal/handlers/cookie_credentials_handler.go +++ b/internal/handlers/cookie_credentials_handler.go @@ -11,12 +11,12 @@ import ( // CookieCredentialsHandler defines a CookieCredentialsHandler struct. type CookieCredentialsHandler struct { logger logging.Logger - configuration configurations.AuthServiceConfiguration + configuration configurations.CookieCredentialsHandlerConfiguration } // NewCookieCredentialsHandler defines a new CookieCredentialsHandler struct. func NewCookieCredentialsHandler(logger logging.Logger, - configuration configurations.AuthServiceConfiguration) CredentialsHandler { + configuration configurations.CookieCredentialsHandlerConfiguration) CredentialsHandler { return &CookieCredentialsHandler{ logger: logger, configuration: configuration, @@ -34,3 +34,8 @@ func (ac *CookieCredentialsHandler) Extract(r *http.Request) (string, error) { ac.logger.Infof("%s cookie", foundMsg) return token.Value, nil } + +// GetKeyName returns the cookie name configured. +func (ac *CookieCredentialsHandler) GetKeyName() string { + return ac.configuration.AccessTokenCookieName +} diff --git a/internal/handlers/cookie_credentials_handler_test.go b/internal/handlers/cookie_credentials_handler_test.go index 79b314d..634c279 100644 --- a/internal/handlers/cookie_credentials_handler_test.go +++ b/internal/handlers/cookie_credentials_handler_test.go @@ -17,9 +17,7 @@ func TestCookieExtract(t *testing.T) { loggerConfig.Level = "warn" logger := logging.NewLogger(loggerConfig) - authSvcConfig := configurations.AuthServiceConfiguration{} - authSvcConfig.LoadFromEnvVars() - cc := NewCookieCredentialsHandler(logger, authSvcConfig) + cc := NewCookieCredentialsHandler(logger, configurations.CookieCredentialsHandlerConfiguration{}) mockRequestWithCookie := func(key, value string) *http.Request { return &http.Request{Header: http.Header{ diff --git a/internal/handlers/credentials_handler.go b/internal/handlers/credentials_handler.go index 2e5c1a0..cacda0a 100644 --- a/internal/handlers/credentials_handler.go +++ b/internal/handlers/credentials_handler.go @@ -13,4 +13,5 @@ const ( // CredentialsHandler defines an interface for authentications. type CredentialsHandler interface { Extract(r *http.Request) (string, error) + GetKeyName() string } diff --git a/internal/handlers/header_credentials_handler.go b/internal/handlers/header_credentials_handler.go index f9f305f..23f49ea 100644 --- a/internal/handlers/header_credentials_handler.go +++ b/internal/handlers/header_credentials_handler.go @@ -41,3 +41,8 @@ func (ah *HeaderCredentialsHandler) Extract(r *http.Request) (string, error) { ah.logger.Infof("%s authorization header", foundMsg) return token, nil } + +// GetKeyName returns the cookie name configured. +func (ah *HeaderCredentialsHandler) GetKeyName() string { + return "Authorization" +} From 3f695e2796552db677578f0f3971eed5c663bbe4 Mon Sep 17 00:00:00 2001 From: wsalles Date: Wed, 23 Feb 2022 19:43:47 +0000 Subject: [PATCH 4/5] check authentication in UserInfo --- internal/controllers/rest_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controllers/rest_controller.go b/internal/controllers/rest_controller.go index e6bd08e..f70c6b0 100644 --- a/internal/controllers/rest_controller.go +++ b/internal/controllers/rest_controller.go @@ -48,7 +48,7 @@ func (rc RESTController) Boot(s *server.Server) { s.Router.GET(rc.configuration.AuthServiceURL, rc.CheckForAuthentication) s.Router.GET(rc.configuration.OIDCCallbackURL, gin.WrapF(rc.OIDCProviderCallback)) - s.Router.GET(rc.configuration.UserInfoURL, gin.WrapF(rc.UserInfo)) + s.Router.GET(rc.configuration.UserInfoURL, rc.CheckForAuthentication, gin.WrapF(rc.UserInfo)) s.Router.POST(rc.configuration.LogoutURL, gin.WrapF(rc.Logout)) s.Router.Any("/:forward", rc.CheckForAuthentication) @@ -182,8 +182,8 @@ func (rc RESTController) Logout(w http.ResponseWriter, r *http.Request) { if kind == "cookie" { rc.deleteSessionCookie(w, rc.credentials[kind].GetKeyName()) - w.WriteHeader(http.StatusOK) } + w.WriteHeader(http.StatusOK) } // getCredentials is responsible for simply getting credentials. From 29693ed6cb550834cbba4add2718d8052f505641 Mon Sep 17 00:00:00 2001 From: wsalles Date: Mon, 28 Feb 2022 12:37:59 +0000 Subject: [PATCH 5/5] code review --- internal/controllers/rest_controller.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/controllers/rest_controller.go b/internal/controllers/rest_controller.go index f70c6b0..0d7f7fd 100644 --- a/internal/controllers/rest_controller.go +++ b/internal/controllers/rest_controller.go @@ -3,6 +3,7 @@ package controllers import ( "context" "encoding/json" + "errors" "fmt" "net/http" "strings" @@ -143,8 +144,12 @@ func (rc RESTController) OIDCProviderCallback(w http.ResponseWriter, r *http.Req return } // ...set a session cookie. - cookieName := rc.credentials["cookie"].GetKeyName() - rc.setSessionCookie(w, r, cookieName, jwt.AccessToken) + cookieHandler, ok := rc.credentials["cookie"] + if !ok { + rc.internalServerError(w, errors.New("could not get 'Cookie Handler'")) + return + } + rc.setSessionCookie(w, r, cookieHandler.GetKeyName(), jwt.AccessToken) rc.logger.Infof("Redirecting back to %s", rc.configuration.AuthServiceURL) http.Redirect(w, r, rc.configuration.AuthServiceURL, http.StatusFound)