Skip to content

feat(123_open): show only the fields of the selected auth mode - #9647

Merged
okatu-loli merged 1 commit into
AlistGo:mainfrom
okatu-loli:feat/123-open-auth-mode-fields
Sep 19, 2026
Merged

okatu-loli merged 1 commit into
AlistGo:mainfrom
okatu-loli:feat/123-open-auth-mode-fields

Conversation

@okatu-loli

Copy link
Copy Markdown
Collaborator

Summary

  • Add a generic show_when struct tag for driver additions (e.g. show_when:"auth_mode=token", multiple values with |). It is exposed in /admin/driver/info so the storage form can hide fields that do not apply. Purely a UI hint; drivers keep validating on their own.
  • 123 Open: default auth mode is now token. access_token/refresh_token appear only in token mode, client_id/client_secret only in client_credentials mode, each marked required for its mode. Help text now links to the token tool: https://alistgo.com/zh/tool/123pan/request.html

Frontend counterpart: AlistGo/alist-web (hides items by show_when, renders URLs in tips as links).

Test plan

  • go test ./internal/op/ ./drivers/123_open/ (new TestDriverItemsShowWhen)
  • Manually verified the storage form: default Token shows token fields only; switching to Client credentials swaps to clientID/clientSecret; editing an existing client_credentials storage shows the right fields.

Add a generic `show_when` struct tag for driver additions. It is parsed
into the driver info sent to the frontend, which hides an item unless the
referenced field equals one of the listed values.

For 123 Open the default auth mode is now `token`; access_token and
refresh_token are shown only in token mode, clientID/clientSecret only in
client_credentials mode. The help text points to the token tool at
https://alistgo.com/zh/tool/123pan/request.html.
@okatu-loli
okatu-loli merged commit 5451b6e into AlistGo:main Sep 19, 2026
12 checks passed
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.

3 participants