feat(123_open): show only the fields of the selected auth mode - #9647
Merged
okatu-loli merged 1 commit intoSep 19, 2026
Merged
Conversation
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.
2 tasks
skysliences
approved these changes
Sep 12, 2026
JoaHuang
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
show_whenstruct tag for driver additions (e.g.show_when:"auth_mode=token", multiple values with|). It is exposed in/admin/driver/infoso the storage form can hide fields that do not apply. Purely a UI hint; drivers keep validating on their own.token.access_token/refresh_tokenappear only in token mode,client_id/client_secretonly 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.htmlFrontend counterpart: AlistGo/alist-web (hides items by
show_when, renders URLs in tips as links).Test plan
go test ./internal/op/ ./drivers/123_open/(newTestDriverItemsShowWhen)