Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(handlers): authz authrequest authelia url #5181

Merged
merged 20 commits into from
Apr 8, 2023

Conversation

james-d-elliott
Copy link
Member

@james-d-elliott james-d-elliott commented Apr 6, 2023

This adjusts the AuthRequest Authz implementation behave similarly to the other implementations in as much as Authelia can return the relevant redirection to the proxy and the proxy just utilizes it if possible. In addition it swaps the HAProxy examples over to the ForwardAuth implementation as that's now supported.

This returns a location header for the updated NGINX implementation allowing users to utilize the correct URL as determined by Authelia.

Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
@authelia
Copy link

authelia bot commented Apr 6, 2023

Artifacts

These changes are published for testing on Buildkite, DockerHub and GitHub Container Registry.

Docker Container

  • docker pull authelia/authelia:feat-nginx-proxy-url
  • docker pull ghcr.io/authelia/authelia:feat-nginx-proxy-url

@james-d-elliott james-d-elliott changed the title feat(handlers): nginx authelia url feat(handlers): authz authrequest authelia url Apr 6, 2023
@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Merging #5181 (97e23c8) into master (fa250ea) will increase coverage by 0.08%.
The diff coverage is 61.78%.

❗ Current head 97e23c8 differs from pull request most recent head b503f6c. Consider uploading reports for the commit b503f6c to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5181      +/-   ##
==========================================
+ Coverage   68.01%   68.10%   +0.08%     
==========================================
  Files         283      283              
  Lines       21230    21269      +39     
  Branches      443      443              
==========================================
+ Hits        14440    14485      +45     
+ Misses       6016     6013       -3     
+ Partials      774      771       -3     
Flag Coverage Δ
backend 68.49% <61.78%> (+0.09%) ⬆️
frontend 63.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/handlers/handler_authz_types.go 83.33% <ø> (ø)
internal/handlers/handler_oidc_userinfo.go 0.00% <0.00%> (ø)
internal/handlers/handler_authz_util.go 31.08% <2.56%> (-7.91%) ⬇️
internal/handlers/handler_authz_authn.go 79.93% <72.00%> (+0.19%) ⬆️
internal/middlewares/authelia_context.go 69.61% <84.61%> (+0.29%) ⬆️
internal/handlers/handler_authz.go 96.21% <88.46%> (+1.05%) ⬆️
internal/handlers/handler_authz_builder.go 89.10% <100.00%> (+11.24%) ⬆️
...nternal/handlers/handler_authz_impl_authrequest.go 100.00% <100.00%> (ø)
internal/handlers/handler_authz_impl_extauthz.go 92.30% <100.00%> (+1.13%) ⬆️
...nternal/handlers/handler_authz_impl_forwardauth.go 100.00% <100.00%> (ø)
... and 3 more

... and 3 files with indirect coverage changes

Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
@netlify
Copy link

netlify bot commented Apr 6, 2023

Deploy Preview for authelia-staging ready!

Name Link
🔨 Latest commit 8d117be
🔍 Latest deploy log https://app.netlify.com/sites/authelia-staging/deploys/6430edad9812c500082172fe
😎 Deploy Preview https://deploy-preview-5181--authelia-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
@james-d-elliott james-d-elliott added the status/needs-review Pull requests that need to be reviewed label Apr 8, 2023
Copy link
Member

@nightah nightah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple small nits and considerations, WDYT?

internal/handlers/handler_authz.go Outdated Show resolved Hide resolved
internal/middlewares/authelia_context.go Show resolved Hide resolved
internal/suites/example/compose/haproxy/haproxy.cfg Outdated Show resolved Hide resolved
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
# Conflicts:
#	docs/content/en/integration/proxies/caddy.md
#	docs/content/en/integration/proxies/envoy.md
#	docs/content/en/integration/proxies/haproxy.md
#	docs/content/en/integration/proxies/nginx.md
#	docs/content/en/integration/proxies/traefikv1.md
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
@james-d-elliott james-d-elliott removed the status/needs-review Pull requests that need to be reviewed label Apr 8, 2023
@james-d-elliott james-d-elliott enabled auto-merge (squash) April 8, 2023 03:33
"os"
"testing"

"github.com/authelia/authelia/v4/internal/session"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
File is not goimports-ed with -local github.com/authelia/authelia (goimports)

Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
@james-d-elliott james-d-elliott merged commit 2dcfc0b into master Apr 8, 2023
10 checks passed
@james-d-elliott james-d-elliott deleted the feat-nginx-proxy-url branch April 8, 2023 04:48
@james-d-elliott james-d-elliott added this to the v4.38.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants