Skip to content

internal/outpost/ak: handle empty outpost list during refresh - #23827

Merged
rissson merged 2 commits into
goauthentik:mainfrom
rabindra789:fix/outpost-refresh-empty-list
Jul 8, 2026
Merged

rissson merged 2 commits into
goauthentik:mainfrom
rabindra789:fix/outpost-refresh-empty-list

Conversation

@rabindra789

Copy link
Copy Markdown
Contributor

Fixes #22673.

Details

What does this PR change?

This PR adds a guard in OnRefresh() before accessing
outposts.Results[0].

If the API returns no outposts, the function now returns an error
instead of accessing the first element.

Why is this change needed?

OnRefresh() assumes the API always returns at least one outpost.

If the response is empty, accessing outposts.Results[0] can cause a
runtime panic.

Returning an error allows the refresh to fail gracefully while keeping
the existing configuration unchanged.

How was this tested?

  • Reviewed the complete OnRefresh() call chain.
  • Verified that all callers already handle refresh errors and continue
    running.
  • Compared the implementation with the existing LDAP and RADIUS
    outpost controllers to follow the same error handling pattern.
  • Verified the modified package compiles.
  • The full project build on Windows is currently blocked by a
    pre-existing platform-specific syscall.SIGUSR1 build error, which is
    unrelated to this change.

Linked issues

Closes #22673.


Checklist

  • The project has been linted, built, and tested (make all)
  • The documentation has been updated and formatted (make docs)

@rabindra789
rabindra789 requested a review from a team as a code owner July 7, 2026 17:30
@netlify

netlify Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 9a1c1ac
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a4e5b02c6cb350008ea8f7e
😎 Deploy Preview https://deploy-preview-23827--authentik-storybook.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 project configuration.

@netlify

netlify Bot commented Jul 7, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit ad4303d
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a4d3799a287a20008a198c9
😎 Deploy Preview https://deploy-preview-23827--authentik-integrations.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 project configuration.

@netlify

netlify Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 9a1c1ac
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a4e5b02554f7300083d9a0c
😎 Deploy Preview https://deploy-preview-23827--authentik-docs.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 project configuration.

@codecov

codecov Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.19%. Comparing base (9734620) to head (9a1c1ac).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23827      +/-   ##
==========================================
- Coverage   93.24%   93.19%   -0.06%     
==========================================
  Files        1043     1043              
  Lines       60981    60981              
  Branches      424      424              
==========================================
- Hits        56864    56831      -33     
- Misses       4117     4150      +33     
Flag Coverage Δ
conformance 36.32% <ø> (+<0.01%) ⬆️
e2e 41.52% <ø> (+<0.01%) ⬆️
integration 32.69% <ø> (-0.04%) ⬇️
rust 0.00% <ø> (ø)
unit 92.31% <ø> (ø)
unit-migrate 92.33% <ø> (-0.02%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@rabindra789
rabindra789 requested a review from rissson July 8, 2026 14:12
@rabindra789

rabindra789 commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Sorry for the mistake i accidentally clicked the request for re-reiew.

@rissson
rissson merged commit 7b60a54 into goauthentik:main Jul 8, 2026
106 checks passed
@rabindra789
rabindra789 deleted the fix/outpost-refresh-empty-list branch July 8, 2026 18:59
kensternberg-authentik added a commit that referenced this pull request Jul 9, 2026
* main: (34 commits)
  lifecycle/container: increase start time to 120s (#23896)
  ci: fix fork checks (#23894)
  root: fix docker compose pg volume path for compatibility with pg18 (#23883)
  ci: better image building (#23359)
  core: bump library/postgres from 16 to 18 in /scripts (#23812)
  core: Form friendly error on uniqueness constraint. (#23864)
  packages: migrate shared pins to the pnpm catalog: protocol (#23784)
  core, web: update translations (#23863)
  core: bump github.com/coreos/go-oidc/v3 from 3.19.0 to 3.20.0 (#23867)
  core: bump github.com/pires/go-proxyproto from 0.13.0 to 0.14.0 (#23868)
  core: bump golang.org/x/sync from 0.21.0 to 0.22.0 (#23866)
  core: bump library/node from `a1d9d67` to `ffc7838` in /lifecycle/container (#23871)
  core: bump axllent/mailpit from v1.30.3 to v1.30.4 in /tests/e2e (#23869)
  core: bump goauthentik/fips-python from `0d4cd1a` to `80d28af` in /lifecycle/container (#23872)
  core: bump library/golang from `756f3b7` to `ee5a795` in /lifecycle/container (#23873)
  core: bump library/node from 26.4.0-trixie to 26.5.0-trixie in /website (#23874)
  web: fix table refresh button not refreshing table data (#23780)
  endpoints: handle exception in connector controller sync setup (#23852)
  internal/outpost/ak: handle empty outpost list during refresh (#23827)
  web/admin/stages/captcha: fix float values in score tresholds fix provider parsing (#22782)
  ...
kensternberg-authentik added a commit that referenced this pull request Jul 9, 2026
* web/cleanup/task-card: (35 commits)
  Just trying to make life a little better.
  lifecycle/container: increase start time to 120s (#23896)
  ci: fix fork checks (#23894)
  root: fix docker compose pg volume path for compatibility with pg18 (#23883)
  ci: better image building (#23359)
  core: bump library/postgres from 16 to 18 in /scripts (#23812)
  core: Form friendly error on uniqueness constraint. (#23864)
  packages: migrate shared pins to the pnpm catalog: protocol (#23784)
  core, web: update translations (#23863)
  core: bump github.com/coreos/go-oidc/v3 from 3.19.0 to 3.20.0 (#23867)
  core: bump github.com/pires/go-proxyproto from 0.13.0 to 0.14.0 (#23868)
  core: bump golang.org/x/sync from 0.21.0 to 0.22.0 (#23866)
  core: bump library/node from `a1d9d67` to `ffc7838` in /lifecycle/container (#23871)
  core: bump axllent/mailpit from v1.30.3 to v1.30.4 in /tests/e2e (#23869)
  core: bump goauthentik/fips-python from `0d4cd1a` to `80d28af` in /lifecycle/container (#23872)
  core: bump library/golang from `756f3b7` to `ee5a795` in /lifecycle/container (#23873)
  core: bump library/node from 26.4.0-trixie to 26.5.0-trixie in /website (#23874)
  web: fix table refresh button not refreshing table data (#23780)
  endpoints: handle exception in connector controller sync setup (#23852)
  internal/outpost/ak: handle empty outpost list during refresh (#23827)
  ...
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.

panic: nil pointer dereference in outpost/ak.OnRefresh via startIntervalUpdater and startEventHandler (possible 2026.5.0 regression)

2 participants